text
stringlengths
1
1.11k
source
dict
c, reinventing-the-wheel, assembly, locking And increment the nesting level. "gate_Enter_skip:\n" // We are VIP! "add %[lock], %[checkin]\n" // Checkin pass like pro! The issue is you don't actually know that the thread calling gate_Enter is the same one that originally entered the gate. If another thread calls exampleUse function it's using the same pass. You could get around this by making use of thread local storage for your pass/checkin variable. Or you could create exampleUsePass on the stack, then pass it in to recursive calls instead of using global vars. You would have a similar issue with your gate_Leave method, where you unlock the gate, then decrement the nesting count. It would be better to decrement the value, whilst you are within the locked section, something like this: "add %[checkout], %[pass]\n" "jnz gate_Leave_skip\n" // If not zero, this is a nested call "mov %[unlock], %[gate]\n" // Close the gate because I am the last one to leave. "gate_Leave_skip:\n"
{ "domain": "codereview.stackexchange", "id": 20425, "lm_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, reinventing-the-wheel, assembly, locking", "url": null }
java, algorithm private int pp; // position of pattern private int ps; // position of string private State z; // state private boolean m = false; // is match Instead of writing a comment, why don't you use the complete name? private final int length; // pattern length private final int outbound; // pattern out bound private final int stringLength; // string length private final int stringOutBound; // string out bound private final String pattern; // pattern private final String matchString; // string to match private int position; // position of pattern private int stringPos; // position of string private State state; // state private boolean matchFound = false; // is match Some examples, I used length instead of pattern because I think in this class pattern is obvious (or at least, I think.) But why you have so much fields? Do you really need all them or we can convert them to variables? And, if I don't remember wrong, the static final fields should go to the top of the class.
{ "domain": "codereview.stackexchange", "id": 8872, "lm_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", "url": null }
javascript, jquery, form } if(value > 99 && edition === "cad" && $('#checkMaintenance').is(':checked')) { var cost = cadMaintenance[5]; var savings = cadMaintenanceSavings[5]; } if(value > 199 && edition === "cad" && $('#checkMaintenance').is(':checked')) { var cost = cadMaintenance[6]; var savings = cadMaintenanceSavings[6]; } if(value > 349 && edition === "cad" && $('#checkMaintenance').is(':checked')) { var cost = cadMaintenance[7]; var savings = cadMaintenanceSavings[7]; } if(value > 499 && edition === "cad" && $('#checkMaintenance').is(':checked')) { var cost = cadMaintenance[8]; var savings = cadMaintenanceSavings[8]; } if(value > 999 && edition === "cad" && $('#checkMaintenance').is(':checked')) { var cost = cadMaintenance[9]; var savings = cadMaintenanceSavings[9]; }
{ "domain": "codereview.stackexchange", "id": 4513, "lm_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, form", "url": null }
ros, path, beaglebone, debian Title: Tutorial needed for BBB full installation When an expert can write a good tutorial for installing ROS on the microSD on a Beaglebone Black, that would be sweet! I am struggling with the path and bashrc and directories, etc. I've got over one Gig stored on the microSD but the programs won't run from there yet. ROS wants to install everything on the eMMC but of course, it won't fit!
{ "domain": "robotics.stackexchange", "id": 18113, "lm_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, path, beaglebone, debian", "url": null }
python, json def generate_json(template, name=None): return json.dumps(generate_json_object(json_data), sort_keys=False) if __name__ == '__main__': arg = sys.argv[1:][0] with open(arg) as f: json_data = json.load(f) print(generate_json(json_data)) 1. Introduction This review grew to be very long, so I'll say up front that you shouldn't take the length of this to heart: your code is not bad, especially if you are new to Python. There's always a lot of things to say about a piece of code of this length, and idiomatic Python has a bunch of features (sets, generators, comprehensions, iterators) that will be unfamiliar to users of some other languages. So take everything I have to say with a pinch of salt (except for item #1 under "General comments", which is really the only big problem here). 2. General comments
{ "domain": "codereview.stackexchange", "id": 2320, "lm_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, json", "url": null }
python, hash-map Variables _spo, _pos, _osp are different permutations of subject, predicate, object for performance reasons, and the underlying data structure is dictionary of dictionaries of sets like {'subject': {'predicate': set([object])}} or {'object': {'subject': set([predicate])}}. The class also has a method to yield triples that match the query in a form of a tuple. If one element of a tuple is None, it acts as a wildcard. def triples(self, (s, p, o)): # check which terms are present try: if s != None: if p != None: # s p o if o != None: if o in self._spo[s][p]: yield (s, p, o) # s p _ else: for ro in self._spo[s][p]: yield (s, p, ro) else: # s _ o if o != None: for rp in self._osp[o][s]: yield (s, rp, o) # s _ _
{ "domain": "codereview.stackexchange", "id": 2828, "lm_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, hash-map", "url": null }
performance, console, assembly, memory-optimization, text-editor movzx si, byte [bp-5] ;SHIFT mov dx, [bp-4] ;COL and ROW mov cx, 1 ;Replication count mov bh, [bp-1] ;PAGE .Show_Next: mov ah, 02h ;BIOS.SetCursor int 10h mov bl, 07h ;WhiteOnBlack for normal text test word [bp-10], 2 ;FLAGS.Selection ? jz .Show_None mov ax, si ;Current position cmp al, [bp-12] ;LOSEL jb .Show_None cmp al, [bp-11] ;HISEL jae .Show_None mov bl, 1Fh ;BrightWhiteOnBlue for selection .Show_None: mov al, [bp+si] ;Current character mov ah, 09h ;BIOS.WriteCharacterAndAttribute int 10h inc dl ;Next column inc si ;Next character
{ "domain": "codereview.stackexchange", "id": 30166, "lm_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, console, assembly, memory-optimization, text-editor", "url": null }
geophysics, geochemistry, volcanology, core, iron Title: Is the iron on Earth's crust a leftover of the Iron catastrophe, or it was brought back by volcanoes? When pondering the hypothesis of the Iron catastrophe, that seem to be widely accepted nowadays. It surprises me that currently the crust still contain a significant amount of Iron (5.6% in weight). I wonder if that much Iron is what didn't sink in the Iron catastrophe (just because the process wasn't perfect), or it can be explained by slow reloading with iron transported from the outer core and mantle to the crust trough convection and volcanic activity. Or perhaps it cam from other sources like meteorites?
{ "domain": "earthscience.stackexchange", "id": 1322, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geophysics, geochemistry, volcanology, core, iron", "url": null }
algorithms, complexity-theory, time-complexity I am aware of an algorithm to unrank permutations in O(n log n) time, but these responses seem to imply that all permutations in total can be generated in time O(n log n). Am I misunderstanding these responses? You have misinterpreted the SO question itself (or we have misinterpreted yours, which seems more likely). That SO quesiton is talking about generating a 'next' permutation from a previous given one, so that all permutations can be generated by calling 'next' multiple times. The answer to that is talking about the (amortized) time complexity of the C++ implementation std::next_permutation which I believe uses Narayana Pandita's algorithm, and generates them in lexicographic order. (Also, as an aside: permutations are different from combinations. There are $n!$ permutations, but $2^n$ combinations (subsets). You seem to be under the impression that permutation is same as a combination (based on your claim of $O(2^n)$)).
{ "domain": "cs.stackexchange", "id": 1339, "lm_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, complexity-theory, time-complexity", "url": null }
consequence of having exponent... Or remainder you can use the same ideas to help you figure how... To Simplifying radical expressions 1 \over 2 } by dividing the number under the radical expression to... No radicals to multiply top and bottom of the radical expression is to have the denominator the under. Can use the same ideas to help you figure out how to simplify radicals go Simplifying... Only radicals of a product to Simplifying radical expressions, we will deal with the square root which the. The dividing radicals steps you figure out how to simplify and divide radical expressions divide by! Dividing by 2 until you get a decimal or remainder if you are dealing a. Dealing with a quotient instead of a product and continue dividing by 2 until get... 1 by ( √3 − √2 ) is ( √3 − √2 ) continue by... Dividing by 2 until you get a decimal or remainder need to multiply top and bottom of the equation until... Denominator that contain no radicals what if you are dealing with a quotient
{ "domain": "com.ec", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806546550656, "lm_q1q2_score": 0.8373303299532093, "lm_q2_score": 0.8539127566694177, "openwebmath_perplexity": 695.313528980847, "openwebmath_score": 0.941363513469696, "tags": null, "url": "https://lamotora.com.ec/rain-bird-mwsgw/4ed952-dividing-radicals-steps" }
c#, linq, markdown The class is self-contained and documented but if you want more information, feel free to ask for it. OrderByVersion You've taken the time to add doc comments, but a vital piece of info is missing. The enumerable is sorted in descending order. That should be there in the doc comments. It would be nice to have an option to sort ascending. (It's also an interesting problem to solve. =;)- The mixture of query and lambda syntax seems a bit strange to me. I'd pick one and stick with it. I don't necessarily mean use just one style everywhere, but you should probably stick to just one of the two within a statement/method. ExtractSemVer There's no reason to abbreviate. This method should be named ExtractSemanticVersion. I would seriously consider introducing a SemanticVersionNumber struct. public struct SemanticVersionNumber { public int Major { get; } public int Minor { get; } public int Patch { get; } public string Build { get; } .... }
{ "domain": "codereview.stackexchange", "id": 16045, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, linq, markdown", "url": null }
ros, realtime, ros-indigo Original comments Comment by Science on 2015-10-07: May be we should try to do that! Comment by TraiBo on 2017-10-13: As you mentioned that ROS 1.0 itself (ie: the middleware and probably almost all components) is inherently not hard real-time capable -> It means that even after installation of preeemt-rt like OSes can't ROS nodes are not real time capable? Please share your opinion. Comment by gvdhoorn on 2017-10-13: If you have a real-time OS, it's perfectly possible to create real-time threads inside a ROS node / process. The ROS middleware itself will still not be real-time by default. Any interaction with other nodes will be non real-time. Comment by TraiBo on 2017-10-13: Thank you gvdhoorn, Yes I have installed Preemt-RT patch running on Ubuntu 14.04. it's perfectly possible to create real-time threads inside a ROS node / process -> Is there any help or example where I can see creating real-time threads inside a ROS node. Comment by gvdhoorn on 2017-10-13:
{ "domain": "robotics.stackexchange", "id": 22572, "lm_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, realtime, ros-indigo", "url": null }
rotation, movement, transformation, matrix, coordinate-system This is one important scale factor that we need to calculate during the calibration process (the minus sign means the encoder counts opposite to belt rotation) Along with this scale that we get during calibration, we need to calculate all members of the transformation matrix T which relates belt coordinates with robot coordinates. This has the rotation matrix R and translation matrix D. $$ p=Tb = \begin{bmatrix}& R & & D\\ 0 & 0 & 0 & 1 \end{bmatrix}b $$ $$p=\begin{bmatrix} p_x \\ p_y\\ p_z\\ 1 \end{bmatrix} = \begin{bmatrix} r_{11} & r_{12} & r_{13} & d_{x}\\ r_{21} & r_{22} & r_{23} & d_{y}\\ r_{31} & r_{32} & r_{33} & d_{z}\\ 0 & 0 & 0 & 1\\ \end{bmatrix} \begin{bmatrix} b_x \\ b_y\\ b_z\\ 1 \end{bmatrix} $$ Since b always has one component along the x axis of the belt, then the coordinate of the first calibration point with respect to belt coordinate is (Belt did not move yet): $$ b_1 = \begin{bmatrix} 0 \\ 0\\ 0\\ 1 \end{bmatrix} $$
{ "domain": "robotics.stackexchange", "id": 2176, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rotation, movement, transformation, matrix, coordinate-system", "url": null }
as desired. Let $\mathrm e_k$ and $\mathrm h_k$ denote the $k$-th columns of $\mathrm I_m$ and $\mathrm H_m$, respectively. Hence, $$\mathrm e_k^{\top} \mathrm A \mathrm A^{\top} \mathrm e_k = \| \mathrm A^{\top} \mathrm e_k \|_2^2 = \frac 1n \| \mathrm S_n^{\top} \mathrm H_m \mathrm e_k \|_2^2 = \frac 1n \| \mathrm S_n^{\top} \mathrm h_k \|_2^2 = \frac 1n \sum_{k=1}^n (\pm 1)^2 = \frac nn = 1$$ for all $k \in \{1,2,\dots,m\}$, as desired. Note that we used the fact that the entries of $\mathrm h_k$ are $\pm 1$. If $m$ is a power of $2$, then $\mathrm H_m$ can be built recursively using the Sylvester construction $$\mathrm H_{2k} = \begin{bmatrix} \mathrm H_k & \mathrm H_k\\ \mathrm H_k & -\mathrm H_k\end{bmatrix} \qquad \qquad \qquad \mathrm H_1 = 1$$ which builds (symmetric) Walsh matrices. If $m$ is not a power of $2$, we can use the Paley construction instead. Example
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.983085088220004, "lm_q1q2_score": 0.8658984761839332, "lm_q2_score": 0.8807970811069351, "openwebmath_perplexity": 166.8743115067149, "openwebmath_score": 0.8544521927833557, "tags": null, "url": "https://mathoverflow.net/questions/256696/do-these-matrices-have-a-name/256776" }
c++, boost std::string output; foo_generator_grammar<std::back_insert_iterator<std::string>> gen_grammar{}; boost::spirit::karma::generate(std::back_inserter(output), gen_grammar, foo); std::cout << "Output\"" << output << "\"\n"; return 0; } Here's what I'd do: Live On Coliru #include <string> #include <vector> struct foo_struct { std::vector<int> bar_vector; foo_struct(std::vector<int> v = {}) : bar_vector(std::move(v)) {} }; #include <boost/fusion/adapted/struct.hpp> BOOST_FUSION_ADAPT_STRUCT(foo_struct, bar_vector) #include <boost/spirit/include/qi.hpp> namespace qi = boost::spirit::qi; template <typename Iterator> struct foo_parser : qi::grammar<Iterator, foo_struct()> { foo_parser() : foo_parser::base_type(start) { using namespace qi; start = int_ % "," >> eps; } private: qi::rule<Iterator, foo_struct()> start; };
{ "domain": "codereview.stackexchange", "id": 32371, "lm_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++, boost", "url": null }
javascript, beginner, json, api Here is the HTML for the site: <!DOCTYPE html> <html> <head> <meta charset=utf-8"> <title>Local Weather</title> <meta description content="Get your Local weather using geolocation."> <meta name=viewport content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css"> <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Arimo:400,700"> <link rel="stylesheet" type="text/css" href="assets/style.css"> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <form id="toggle"> <button type="button" id="cel" class="inactive" onclick="SetCelsius();">&deg;C</button>
{ "domain": "codereview.stackexchange", "id": 8447, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, beginner, json, api", "url": null }
ruby, validation Title: Electrical engine calculations The ElectricalEngine class responds to the horsepower message. Because efficiency is calculated in percent a programmer can mistakenly initialize it with an integer instead of a float. class ElectricalEngine attr_reader :volts, :current, :efficiency def initialize(volts, current, efficiency) @volts, @current, @efficiency = volts, current, efficiency end HP_IN_WATTS = 746 def horsepower (volts * current * efficiency) / HP_IN_WATTS end end puts ElectricalEngine.new(240, 90, .6).horsepower # correct puts ElectricalEngine.new(240, 90, 60).horsepower # buggy How would you handle this scenario?
{ "domain": "codereview.stackexchange", "id": 10658, "lm_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, validation", "url": null }
javascript, php, html <!-- Submit Form Button --> <div class="form-group"> <div class="col-md-4 control-label"> <button id="submit" name="submit" class="btn btn-primary">Submit</button> </div> </div> </fieldset> </form> </div>'; } else { $dbHost = "localhost"; $dbUsername = "admin"; $dbPassword = ""; $dbName = "webdb";
{ "domain": "codereview.stackexchange", "id": 19393, "lm_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, php, html", "url": null }
python, optimization, beginner print pandigitals print time.time() - start_time, "seconds" When running this, the result is: [123456, .......] 2.968 seconds Process finished with exit code 0 The code seems to work fine, but it doesn't appear to be very efficient. Would you have any tips to improve it? Any piece of code and/or idea would be highly appreciated. PS: I chose this loop so that any improvements to the is_pandigital function would be immediately obvious. Example of numbers I am looking for: 321XXXXXXXXXXXXXXX132 - good 321XXXXXXXXXXXXXXX133 - not good, because the last 3 digits dont contain 1, 2 and 3 231 - good You can rewrite your asserts without comparing to True and False: assert is_pandigital(1423, 4) assert not is_pandigital(1423, 5) assert is_pandigital(14235554123, 4) assert not is_pandigital(14235552222, 4) # !important assert not is_pandigital(1444, 4) assert is_pandigital(123564987, 9)
{ "domain": "codereview.stackexchange", "id": 4556, "lm_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, optimization, beginner", "url": null }
Complex conjugate of function I have a wavefunction $\psi(x,t)=Ae^{i(kx-\omega t)}+ Be^{-i(kx+\omega t)}$. $A$ and $B$ are complex constants. I am trying to find the probability density, so I need to find the product of $\psi$ with it's complex conjugate. The problem is, im not sure what is it's complex conjugate, I know the complex conjugate of $5+4i$ is $5-4i$, but what would be the complex conjugate of $\psi$? Is it just $-Ae^{i(kx-\omega t)}-Be^{-i(kx+\omega t)}$? - The complex conjugation factors through sums and products. So you can take the complex conjugate of the factor with A and B separately. The constant A and B form know problem, this goes according to the usual rules. This leaves something of the form $e^{(a+bi)}$. Now note that $e^{(a+bi)}= e^a(\cos(b)+i \sin(b))$ Taking the complex conjugate now and using $\cos(b)=-\cos(b)$ and $-\sin(b)=\sin(-b)$, you find the complex conjugate $e^{a+i(-b)}$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9896718453483273, "lm_q1q2_score": 0.8544743679010147, "lm_q2_score": 0.8633916099737806, "openwebmath_perplexity": 146.93364072689, "openwebmath_score": 0.9733754992485046, "tags": null, "url": "http://math.stackexchange.com/questions/95598/complex-conjugate-of-function" }
roscpp Original comments Comment by Adolfo Rodriguez T on 2014-05-21: +1 Persistent services that (optionally) try to re-establish the connection would be very valuable. Working your way around the existing API is possible, but can indeed be cumbersome. An added inconvenience is that currently it's not possible to query if a ServiceClient is persistent or not. Comment by Adolfo Rodriguez T on 2014-05-21: Feature request created: https://github.com/ros/ros_comm/issues/416 Comment by Boris_il_forte on 2014-05-22: so, up to now, the "best" way is to recreate the ServiceClient from nodeHanlder? Comment by Adolfo Rodriguez T on 2014-05-22: I know of no other option. Comment by mihir3445@gmail.com on 2020-06-10: This feature was implemented in Kinetic release. discussion Code Changes can be found here Comment by JWCS on 2021-02-02: Actually, it was not implemented. The PR died without getting added. The referenced source files, from kinetic to noetic, don't include that code.
{ "domain": "robotics.stackexchange", "id": 18015, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "roscpp", "url": null }
java, algorithm, reinventing-the-wheel } } } Your getInt and getChar methods are very long and cumbersome, they can be replaced by this: Using arrays: private char[] values = new char[]{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
{ "domain": "codereview.stackexchange", "id": 7787, "lm_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, reinventing-the-wheel", "url": null }
A perhaps slicker rephrasing which highlights the way that topology is used to help out algebra: A set of two polynomial equations in two variables of degrees $c$ and $d$ has at most $cd$ solutions. Using Priestley duality for distributive lattices and compact, totally disconnected ordered topological spaces, many purely algebraic questions have been solved using quite simple topological tools. For instance the fact that free products of affine complete lattices are affine complete, boils down to a topological argument, as it has been done in section 3 of this article. Fundamental theorem of algebra for Quaternions. The proof for $\mathbb{H}$ uses the degree of the maps to $S^3$, very similar to the Gauss's proof for $\mathbb{C}$ with the degree of map to $S^1$. Taras Banakh today told me about a solution of a group theory problem by means of topological algebra. If I remembered it right, it is the following.
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9585377261041521, "lm_q1q2_score": 0.8028903291647906, "lm_q2_score": 0.8376199572530448, "openwebmath_perplexity": 253.8010377215201, "openwebmath_score": 0.8908846974372864, "tags": null, "url": "https://mathoverflow.net/questions/208112/solving-algebraic-problems-with-topology/208128" }
Theorem 3 follows from Theorem 1.4 in [1], which states that for any $T_0$-space $X$, $X$ is metrizable if and only if there exists a sequence $\mathcal{G}_1, \mathcal{G}_2, \mathcal{G}_3,\cdots$ of open covers of $X$ such that for each open $U \subset X$ and for each $x \in U$, there exist an open $V \subset X$ and an integer $n$ such that $x \in V$ and $St(V,\mathcal{G}_n) \subset U$. Proof of Theorem 1 Suppose $X$ is pseudocompact such that its diagonal $\Delta=\bigcap_{n=1}^\infty \overline{U_n}$ where each $U_n$ is an open subset of $X \times X$ with $\Delta \subset U_n$. We can assume that $U_1 \supset U_2 \supset \cdots$. For each $n \ge 1$, define the following: $\mathcal{U}_n=\{ U \subset X: U \text{ open in } X \text{ and } U \times U \subset U_n \}$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517469248845, "lm_q1q2_score": 0.8293563511751529, "lm_q2_score": 0.8479677622198946, "openwebmath_perplexity": 99.66562212800767, "openwebmath_score": 0.9851532578468323, "tags": null, "url": "https://dantopology.wordpress.com/tag/metrizable-spaces/" }
java, validation, rest, spring Query In the query/search handler I anticipate two dates (a from and a to). These could be used to narrow the date interval against which the metric calculation should be performed. A sample request looks like this GET /api/v1/sensors/windSpeed/metrics/avg?from=2023-05-22&till=2023-05-23 @GetMapping("/{sensor-name}/metrics/{metric-type}") ResponseEntity<?> getSensorMetricForADateRangeForADevice( @PathVariable(name="sensor-name") String sensorName, @PathVariable(name="metric-type") String metricType, @RequestParam("from") @Valid @DateTimeFormat(pattern="yyyy-MM-dd") Date from, @RequestParam("till") @Valid @DateTimeFormat(pattern="yyyy-MM-dd") Date till, @RequestParam(name="device-id",required = false) Optional<UUID> deviceId) { //Extra input data validation if (!"avg".equalsIgnoreCase(metricType)) { throw createCVE("metric-type", 1, metricType, String.class, "currently supports only 'avg'"); }
{ "domain": "codereview.stackexchange", "id": 44709, "lm_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, validation, rest, spring", "url": null }
is the mass of the body (200 kg) times the acceleration a, so -100=200a and a=-0. The hinge at the bottom of the pendulum is attached to a cart which moves back and forth on a track. Question: A mass hangs on the end of a massless rope. The collision is. The results would be available for analysis on the graph obtained. 10) The kinetic energy of rotation about the pivot point is. Obviously a real-world pendulum would live in a 3D space, but we're going to look at a simpler scenario, a Finally, a real-world pendulum is going to experience some amount of friction (at the pivot point) and air resistance. A pendulum is transported from sea-level, where the acceleration due to gravity g = 9. Suppose we have a mass m attached to a string of length ℓ. Grandfather clocks use a pendulum to keep time and a pendulum can. If you traveled to another planet, you could use a. 75 - 300 = 435. What is the value of g in Death Valley? (a) 9. The acceleration of gravity is 9. The gravi-tational signal is
{ "domain": "detectorband.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9724147153749275, "lm_q1q2_score": 0.8060722994664742, "lm_q2_score": 0.8289388125473628, "openwebmath_perplexity": 391.47228602467754, "openwebmath_score": 0.7101962566375732, "tags": null, "url": "http://detectorband.it/acceleration-of-a-pendulum-at-the-bottom.html" }
I think you may be better off using the multlined environment from the mathtools package. \documentclass[a4paper]{article} \usepackage{mathtools} \begin{document} \begin{align*} x_n&= \begin{multlined}[t] 1+\frac{1}{2}+\left( \frac{1}{3}+\frac{1}{4} \right) +\left( \frac{1}{5}+\frac{1}{6}+\frac{1}{7}+\frac{1}{8} \right) +\cdots+\left( \frac{1}{2^{k-1}+1}+\cdots+\frac{1}{2^k} \right)\\ +\cdots+\left( \frac{1}{2^{2N-1}+1}+\cdots+\frac{1}{2^{2N}} \right) \end{multlined}\\ &>1+2^0\frac{1}{2^1}+2^1\frac{1}{2^2}+2^2\frac{1}{2^3}+\cdots+2^{k-1} \frac{1}{2^k}+\cdots+2^{2N-1}\frac{1}{2^{2N}} \end{align*} \end{document}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9609517028006208, "lm_q1q2_score": 0.8224316223217654, "lm_q2_score": 0.8558511524823265, "openwebmath_perplexity": 2778.1405335758554, "openwebmath_score": 0.716151773929596, "tags": null, "url": "https://tex.stackexchange.com/questions/183495/wrong-alignment-of-split-equation-in-align-environment/183502" }
ros, rosbag, include, namespace CMakeLists: FIND_PACKAGE(OpenGL) find_package(PkgConfig REQUIRED) find_package(ASSIMP QUIET) find_package(rosbag REQUIRED) if (NOT ASSIMP_FOUND) pkg_check_modules(ASSIMP assimp) endif() if (NOT ASSIMP_FOUND) message(WARNING "ASsimp not found, not building synthetic views") endif() if( ${ASSIMP_VERSION} STRGREATER "2.0.0" ) message(STATUS "Found assimp v3") set(EXTRA_SOURCES) set(EXTRA_LIBRARIES assimp) else() message(STATUS "Building assimp v3") set(ASSIMP_INCLUDE_DIRS ./assimp/include) aux_source_directory(./assimp/contrib/clipper EXTRA_SOURCES_clipper) aux_source_directory(./assimp/contrib/ConvertUTF EXTRA_SOURCES_ConvertUTF) aux_source_directory(./assimp/contrib/irrXML EXTRA_SOURCES_irrXML) aux_source_directory(./assimp/contrib/poly2tri/poly2tri/common EXTRA_SOURCES_poly2tri) aux_source_directory(./assimp/contrib/poly2tri/poly2tri/sweep EXTRA_SOURCES_poly2tri_sweep) aux_source_directory(./assimp/contrib/unzip EXTRA_SOURCES_unzip)
{ "domain": "robotics.stackexchange", "id": 16414, "lm_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, rosbag, include, namespace", "url": null }
functional-programming, scala Title: File-to-fully qualified class name function My instincts are telling me a seasoned Scala programmer will find my code less than optimal. As will no doubt be obvious, I'm a Java guy who has just started in with Scala. Is there a more 'functional' way to accomplish this that I'm missing? /** * takes a file object and returns a string representing the fully qualified * class name represented by that file. * * @param file * @return string representation of the fully qualified class name */ def makeFqClassName(file: File): String = { // pull out the file name - we'll use this for our class name val fNameNoExtS = FilenameUtils.removeExtension(file.getName) // extract only the path val fPathOnlyS = file.getPath.substring(0, file.getPath.lastIndexOf(File.separator)) // create a list of the path name, minus the delimiter val fPathDelimList: List[String] = fPathOnlyS.split("/").toList
{ "domain": "codereview.stackexchange", "id": 12376, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "functional-programming, scala", "url": null }
homework-and-exercises, electrostatics, electric-fields, gauss-law The last case we will check is $\delta \gg R$. This should result in an almost constant field of $E\approx\frac{Q}{4\pi\epsilon_0\delta^2}$ across the whole surface, so the flux should be $\Phi \approx \frac{Q R^2\pi}{4\pi\epsilon_0\delta^2} = \frac{Q R^2}{4\epsilon_0\delta^2}$. We can re-write the second term in the result as a series in $R/\delta$ $$ \frac{Q\delta}{2\epsilon_0\sqrt{R^2+\delta^2}} = \frac{Q}{2\epsilon_0\sqrt{\left(\frac{R}{\delta}\right)^2+1}} = \frac{Q}{2\epsilon_0}\left(1-\frac{(R/\delta)^2}{2} + \mathcal{O}\left(\frac{R}{\delta}\right)^4\right)$$ With that, the flux is $$ \Phi \approx \frac{Q}{2\epsilon_0} - \frac{Q}{2\epsilon_0} + \frac{QR^2}{4\epsilon_0\delta^2} = \frac{QR^2}{4\epsilon_0\delta^2}$$ again in agreement with our expectations.
{ "domain": "physics.stackexchange", "id": 57259, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, electrostatics, electric-fields, gauss-law", "url": null }
quantum-field-theory, particle-physics, renormalization, singularities, regularization Title: On scheme dependence in QFT renormalization I searched for the answer to my question quite a while and it seems nobody ever asked similar questions or it is written explicitly in any textbooks. The question is, If physical parameters of any theory change with energy scale at which the theory tried to describe, then why are those physical parameters listed on the cover page of any physics textbook (say, on the cover of many modern physics textbooks the electric charge $e = -1.602 \times 10^{-19}\;\mathrm{C}$, electron mass = ..., and so on are listed) are not associated with any energy scale at which the experiments are conducted to measure them? Is it because these parameters are quite insensitive to the energy scale under which the parameters are measured? but then how insensitive?
{ "domain": "physics.stackexchange", "id": 60248, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, particle-physics, renormalization, singularities, regularization", "url": null }
fiber-optics Title: Single-moded optical fiber and frequency I've read at wikipedia about "Single-mode optical fiber" ( https://en.wikipedia.org/wiki/Single-mode_optical_fiber ) but maybe i have a misunderstanding at this point : "Waves can have the same mode but have different frequencies. This is the case in single-mode fibers, where we can have waves with different frequencies, but of the same mode, which means that they are distributed in space in the same way, and that gives us a single ray of light". I know that a mode have a specific frequency, is this disagree with the words above ? No, a mode does not have a specific frequency, but a specific field distribution. For each mode there is a minimum frequency that can be propagated (cut-off frequency) but above the cut-off frequency any frequency can be transmitted. In a single-mode fiber, the diameter of the core is sufficiently small to have just one mode above cut-off in the range of frequencies of interest.
{ "domain": "physics.stackexchange", "id": 38820, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fiber-optics", "url": null }
reference-frames, differential-geometry, tensor-calculus, conventions, volume I naively thought that the associativity postulate of $\wedge$ led to the first definition. Instead it also works with the second one! When applying the two constructions to the volume form the former produces the annoying factors you noticed: $$dx^1 \wedge \cdots \wedge dx^n\left(\frac{\partial}{\partial x^1}, \ldots, \frac{\partial}{\partial x^n}\right) = \frac{1}{n!}\:.$$ The latter instead fournishes $$dx^1 \wedge \cdots \wedge dx^n\left(\frac{\partial}{\partial x^1}, \ldots, \frac{\partial}{\partial x^n}\right) =1\:.$$ The exterior derivative is defined through the same procedure in both approaches and produces two different notions, however sharing the same properties if one does not check the action on vectors. In that case factors $\frac{1}{n+1}$ pops up and distinguishes the two setups. The problematic fact is that in some textbooks the authors start with a definition and -- when changing subject-- they sometimes pass to use the other definition.
{ "domain": "physics.stackexchange", "id": 73790, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reference-frames, differential-geometry, tensor-calculus, conventions, volume", "url": null }
c++, algorithm, image, matrix, c++20 template<std::ranges::input_range Range, std::same_as<std::size_t>... Sizes> Image(const Range& input, Sizes... sizes): size{sizes...}, image_data(begin(input), end(input)) { if (image_data.size() != (1 * ... * sizes)) { throw std::runtime_error("Image data input and the given size are mismatched!"); } } Image(std::vector<ElementT>&& input, std::size_t newWidth, std::size_t newHeight) { size.reserve(2); size.emplace_back(newWidth); size.emplace_back(newHeight); if (input.size() != newWidth * newHeight) { throw std::runtime_error("Image data input and the given size are mismatched!"); } image_data = std::move(input); // Reference: https://stackoverflow.com/a/51706522/6667035 }
{ "domain": "codereview.stackexchange", "id": 45545, "lm_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++, algorithm, image, matrix, c++20", "url": null }
botany, plant-physiology, respiration Title: What's the (or some of the) minimum(s) amount of atmospheric carbon dioxide needed by plants? We currently have a problem of increasing $\ce{CO2}$ in the atmosphere. But assuming we find a way to carbon sink it, what is the minimum $\ce{CO2}$ we need to leave in the atmosphere to provide a source for plants to photosynthesize? I'm assuming this may vary per plant, and that we could choke plants so they're less productive - but at some point they will starve to death if we remove too much $\ce{CO2}$. Where does this point lie? Approximations, or a specific data point (say for one plant, or one type of plant) would be an adequate place to start. Current atmosphere composition is $\pu{0.035\%}$ carbon dioxide. In the past it has been higher (has it ever been lower?), which in theory has resulted in higher plant growth - but I've seen some contradictory statements about higher Carbon Dioxide.
{ "domain": "biology.stackexchange", "id": 8586, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "botany, plant-physiology, respiration", "url": null }
python, python-2.x # only return the Nth number of pairs return word_occurence_array[:number_of_words] You can then call this function: count_words(word_string="this is an example sentence with a repeated word example", number_of_words=3) which returns [('example', 2), ('a', 1), ('an', 1)] I found the process of tuple sorting, quite tricky, and achieved it using word_occurence_array.sort(key=lambda tup: (-tup[1], tup[0])). I was wondering if there are any other improvements that I can make to my overall code.
{ "domain": "codereview.stackexchange", "id": 18312, "lm_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", "url": null }
evolution, physiology, vision, biophysics, light Insects and other organisms that can see into the UV range see mostly in the near-UV range, >300nm, not too far from our own vision range (roughly corresponding to "UVA"). However, it isn't true that humans can't see these wavelengths due to some lack of sensitivity of our photoreceptors: instead, UV light is (at least partly) blocked by the cornea and lens, presumably to protect the retina from damage! Humans and other organisms do have some sensitivity to damaging UV wavelengths, just not through vision. Instead, humans and other organisms sense UV based on the damage done within cells, which recruits repair mechanisms and apoptosis to prevent damage from leading to cancer. Summary:
{ "domain": "biology.stackexchange", "id": 6840, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, physiology, vision, biophysics, light", "url": null }
performance, vba, excel 'Add a worksheet with the name "RDBMergeSheet" Set DestSh = Sheets("Main") 'Set DestSh = ActiveWorkbook.Worksheets.Add ' DestSh.Name = "RDBMergeSheet" 'loop through all worksheets and copy the data to the DestSh For Each sh In ActiveWorkbook.Worksheets If sh.Name <> DestSh.Name And sh.Name <> "PAYPERIOD" And sh.Name <> "TECHTeamList" Then 'Find the last row with data on the DestSh Last = LastRow(DestSh) 'Fill in the range that you want to copy Set CopyRng1 = sh.Range("B3") Set CopyRng2 = sh.Range("C3") Set CopyRng3 = sh.Range("D3") Set CopyRng4 = sh.Range("G3") Set CopyRng5 = sh.Range("C5") Set CopyRng6 = sh.Range("A8:j25") Set CopyRng7 = sh.Range("A28:j45") 'Test if there enough rows in the DestSh to copy all the data If Last + CopyRng1.Rows.Count > DestSh.Rows.Count Then MsgBox "There are not enough rows in the Destsh" GoTo ExitTheSub End If
{ "domain": "codereview.stackexchange", "id": 31737, "lm_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, vba, excel", "url": null }
ros, python, integration, rostest, unit-testing And my .test file contains: <test test-name="my_node_test_suite" pkg="my_package" type="my_node_integration_tests.py" /> Originally posted by trianta2 on ROS Answers with karma: 293 on 2014-11-03 Post score: 1 A reading of the rostest.rosrun source code reveals that it is in fact overwriting the results file with each function call: http://docs.ros.org/indigo/api/rostest/html/rostest-pysrc.html#rosrun rosunit.unitrun has a similar pattern and likely has the same flaw: http://docs.ros.org/indigo/api/rosunit/html/rosunit.pyunit-pysrc.html#unitrun I think the best thing to do here is to split your tests into separate files. If this is a serious problem for you, you may want to consider filing a bug against rostest or submitting a patch which provides the behavior you need. Originally posted by ahendrix with karma: 47576 on 2014-11-03 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 19938, "lm_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, python, integration, rostest, unit-testing", "url": null }
pcl, velodyne, pointcloud Title: background subtraction of pointcloud Is there any package for background subtraction of pointclouds? I mean that "background subtraction" is the filter of pointcloud which doesn't change spatially compared with previous scene. I want to use velodyne lider sensor, so I can't use depth image. I know a PCL sample of this filter (http://pointclouds.org/documentation/tutorials/octree_change.php#octree-change-detection), and I can implement such package. However, if there is a filtering package, my implementation will come to nothing. So I asked that anyone implemented such a package. Originally posted by atsushi_tsuda on ROS Answers with karma: 91 on 2012-06-11 Post score: 5
{ "domain": "robotics.stackexchange", "id": 9752, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pcl, velodyne, pointcloud", "url": null }
procedure, any number of matching methods. Login to your Khan Academy account, go to assignments, and watch the “Interpreting ox Plots” video. mgcViz basics. For each mean and standard deviation combination a theoretical normal distribution can be determined. By a quantile, we mean the fraction (or percent) of. A normal probability plot is a plot that is typically used to assess the normality of the distribution to which the passed sample data belongs to. model1<-lm(formula = repvshr~income+presvote+pressup) • Our measure of leverage: is the h. So our model residuals have passed the test of Normality. Creation of matrices and matrix multiplication is easy and natural: Note that in Sage, the kernel of a matrix A is the “left kernel”, i. , the normal distribution). Application of proposed algorithm is broad, both in the field of wireless communications, equalization of transmitting channels, suppressing of noise and in modeling communication and control systems. The unconditional SD of
{ "domain": "clubita.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9621075711974103, "lm_q1q2_score": 0.8099268345758419, "lm_q2_score": 0.8418256532040708, "openwebmath_perplexity": 1397.0072810229867, "openwebmath_score": 0.538626492023468, "tags": null, "url": "http://clubita.it/yzob/qq-plot-pdf.html" }
ros-indigo, transform Title: Why tf is not linked on indigo? Hi! I've the problem that on ROS indigo tf is not linked to my executable even if I specify it in find_package and as dependency in package.xml. Below is a stripped down example that shows the problem. On ROS Hydro the package compiles fine. On ROS Indigo i get the linker error: undefined reference to `tf::TransformBroadcaster::TransformBroadcaster()' This are the only files in the package: tf_broadcaster.cpp: #include <ros/ros.h> #include <tf/transform_broadcaster.h> int main(int argc, char** argv){ tf::TransformBroadcaster br; return 0; }; CMakeLists.cpp: cmake_minimum_required(VERSION 2.8.3) project(tmptest) find_package(catkin REQUIRED COMPONENTS roscpp tf ) add_executable(tf_broadcaster src/tf_broadcaster.cpp) target_link_libraries(tf_broadcaster ${catkin_LIBRARIES})
{ "domain": "robotics.stackexchange", "id": 20002, "lm_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-indigo, transform", "url": null }
php, object-oriented, null What if this factory gets passed an array, object, numeric primitive, empty string, etc. for one of your parameters? Do you truly want to allow the Person object to be instantiated into this state? If you are truly OK with the values on person being set to arbitrary values (i.e. this is simple app and you are not worried about class re-use), and you are OK with the use case where not all parameters are set, then I would say just go for your first form, as there should be no problem in setting a null value to an already null property. I think the second form might imply some level of validation or state control that simply doesn't exist. If this is your preferred approach, I would just ditch the factory class and make the Person constructor behave like this factory method is doing now.
{ "domain": "codereview.stackexchange", "id": 25180, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, object-oriented, null", "url": null }
asdf wrote to sci.math on 29 Mar 2006 (paraphrased) How do you prove that for a polynomial P(X) $\rm P(c)=0\ \Rightarrow\ X-c\ |\ P(X)\$ i.e. $\rm\ (X-c)\ Q(X)\ =\ P(X)\$ for some $\rm\ Q(X)\$ For $\rm\ c=0\$ it specializes to the obvious case: $\rm\ X\ |\ P(X) \iff P(0)=0$ If $\rm\ c\ne 0\$ reduce to $\rm\ c=0\$ via shift: $\rm\ X-c\ |\ P(X) \iff\ X\ |\ P(X+c) \iff\ P(c)=0$ - By the division algorithm, if $a(x)$ and $b(x)$ are any polynomials, and $a(x)\neq 0$, then there exist unique $q(x)$ and $r(x)$ such that $$b(x) = q(x)a(x) + r(x),\qquad r(x)=0\text{ or }\deg(r)\lt \deg(a).$$ Let $b(x) = p(x)$, and $a(x)=x-c$. Then $r(x)$ must be constant (since it is either zero or of degree strictly smaller than one), so $$b(x) = q(x)(x-c) + r.$$ Now evaluate at $x=c$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754495022483, "lm_q1q2_score": 0.8072468475844797, "lm_q2_score": 0.8198933337131076, "openwebmath_perplexity": 285.0928136161858, "openwebmath_score": 0.9174551367759705, "tags": null, "url": "http://math.stackexchange.com/questions/94728/how-to-show-that-px-divided-by-x-c-has-remainder-pc" }
ros2 I supposed this was done in the factory builder but I don't see any part relevant to the naming. For example: all the current plugins come from nav2 and are action_bt_nodes so it makes sense that the naming pattern would be nav2_<plugin_name>_action_bt_node. But my plugin comes from a different library (planar_node) and naming it planar_node_planar_move_action_bt_node does not seem to work. I tried using the namespace as well its_behavior_tree_planar_move_bt_action but it lead to nothing I could just git clone the whole repo, modify the navigation behavior tree by adding my plugin and build nav2 from there but I think it would not be optimal. Thanks in advance for any kind of help or direction :)
{ "domain": "robotics.stackexchange", "id": 38360, "lm_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 }
cc.complexity-theory, cr.crypto-security But then the complement to these two problems, determining whether their full answer is not less than some number, is a simple reduction to the "less than" version. Does this mean that the existence of such an NP-complete signature system implies NP = co-NP? My argument above is highly informal. For example, checking whether an alleged private key in fact matches a given public key may not be straightforward and possibly not in P. (It is definitely in BPP, though: try signing random messages.) Also, many public-key signature systems may have multiple valid signatures (DSA, ECDSA) or multiple matching private keys (RSA). These things throw wrenches into the works. Your argument is correct about the FACTORING problem, but it does not automatically generalize to all public-key cryptosystems. Here's an excerpt from an exercise by Dominique Unruh, showing formally that if FACTORING is NP-complete, then NP = coNP.
{ "domain": "cstheory.stackexchange", "id": 4572, "lm_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, cr.crypto-security", "url": null }
work. Lines and Planes in R3 and add all scalar multiples of the vector ~v. The Introduction to Vectors March 2, 2010 What are Vectors? Vectors are pairs of a direction and a magnitude. Here comes the scalar triple product, as it measures the volume that is changing. 1 ce a Sp ves Cur We have already seen that a convenient way to describe a line in three dimensions is to provide a vector that “points to” every point on the line as a parameter t varies, like h1,2,3i+ th1,−2,2i = h1+ t,2− 2t,3+2ti. Multiplying them by scalars. A scalar product is an area and is therefore an ordinary number, a scalar. uk/resources/leaflets/firstaidkits/6 1. , a vector) in N nasa. Vector notation is a commonly used mathematical notation for working with mathematical vectors, which may be geometric vectors or members of vector spaces. Calculus I and II). 7. The product of a row vector multiplied by a column vector will be a scalar. ac. What are Scalars and Vectors? 2. PRACTICE PROBLEMS-ANSWERS TO SOME
{ "domain": "cleanupthepackers.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9852713874477228, "lm_q1q2_score": 0.8008949145233167, "lm_q2_score": 0.8128673223709251, "openwebmath_perplexity": 542.805935340855, "openwebmath_score": 0.7808359265327454, "tags": null, "url": "http://cleanupthepackers.com/uaq0/vector-and-scalar-mathematics-pdf.html" }
ros-kinetic, ubuntu, ubuntu-xenial I want to publish my proto message. I tried few things but I couldn't succeed. Protobuf is not used in ROS 1, nor in ROS 2. There is no official support for Protobuf messages in either ROS version. There is a(n ongoing) discussion about this over in ros/ros_comm/issues/1085, but personally I don't see this happening in ROS 1. Some of the comments on that issue point to user-created extensions or packages that enable the use of Protobuf, perhaps you could take a look at them. Originally posted by gvdhoorn with karma: 86574 on 2019-11-25 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 34052, "lm_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, ubuntu, ubuntu-xenial", "url": null }
lambda-calculus, functional-programming, haskell If you think in terms of Turing machines, it is possible to write a machine that performs parallel or. Consider a machine with two inputs: a description of a machine $M_1$ that calculates the first argument, and a description of a machine $M_2$ that calculates the second argument. The machine simulates one step of $M_1$, then one step of $M_2$, then again one step of each machine in turn, until one of the machine halts. If the first machine to halt outputs True, output True and stop, otherwise keep simulating the other machine and return its output (if it ever terminates).
{ "domain": "cs.stackexchange", "id": 21000, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lambda-calculus, functional-programming, haskell", "url": null }
python, beginner, python-3.x, random def the_game(): while number_pool: choice = lotto_choice() print("The random lotto is: " + str(choice)) display_cards() cross_number = input("Do you want to cross out a number") cross_number.lower() if cross_number == "y": if choice in player_card_sorted: player_card_sorted.remove(choice) elif choice in computer_card_sorted: computer_card_sorted.remove(choice) if cross_number == "n": if choice in computer_card_sorted: computer_card_sorted.remove(choice) else: continue else: if len(player_card_sorted) == 0: print("Congratulations Player ! You won") elif len(computer_card_sorted) == 0: print("The computer have won, too bad !") else: print("It is a tie you both ran out of numbers, very straange !")
{ "domain": "codereview.stackexchange", "id": 26440, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, random", "url": null }
performance, vba, excel Application.ScreenUpdating = False Application.EnableEvents = False Application.DisplayAlerts = False Application.Calculation = xlCalculationManual Dim targetBook As Workbook Dim targetSheet As Worksheet Dim sheetCount As Long Dim targetFilename As String Dim outputSheet As Worksheet Set outputSheet = ThisWorkbook.Sheets("Sheet1") '/ Get this out of the way until we need it later Dim sheetRange As Range '/ Note the *descriptive*, *unambiguous* names. '/================================================================================================================================================ '/================================================================================================================================================ '/ Create the main array object, define columns, insert headers. Dim testOutputData As Variant testOutputData = Array()
{ "domain": "codereview.stackexchange", "id": 18731, "lm_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, vba, excel", "url": null }
catkin, roscpp Anyone have pointers on what might be going wrong, or how to debug this? I have ROS Kinetic, on Ubuntu 16.04. As a new clue, catkin_make VERBOSE=1 2>&1 | grep so gives, among other things, /usr/bin/c++ -std=c++0x CMakeFiles/talker.dir/src/talker.cpp.o -o /home/tsbertalan/catkin_ws/devel/lib/beginner_tutorials/talker -rdynamic /opt/ros/kinetic/lib/libroscpp.so -lboost_signals -lboost_filesystem /opt/ros/kinetic/lib/librosconsole.so /opt/ros/kinetic/lib/librosconsole_log4cxx.so /opt/ros/kinetic/lib/librosconsole_backend_interface.so -llog4cxx -lboost_regex /opt/ros/kinetic/lib/libxmlrpcpp.so /opt/ros/kinetic/lib/libroscpp_serialization.so /opt/ros/kinetic/lib/librostime.so /opt/ros/kinetic/lib/libcpp_common.so -lboost_system -lboost_thread -lboost_chrono -lboost_date_time -lboost_atomic -lpthread -lconsole_bridge -Wl,-rpath,/opt/ros/kinetic/lib
{ "domain": "robotics.stackexchange", "id": 26889, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "catkin, roscpp", "url": null }
homework-and-exercises, electric-circuits, electrical-resistance, batteries The voltmeter will read zero when the voltage across the 4 ohm resistor is 6V (top-most terminal positive). The voltage across the battery and 4 ohm resistor is then the sum 6V and -6V which equals zero volts. Now, this requires that the current $I$ (down) through the 4 ohm resistor equal 1.5A (Ohm's law), and the current $I$ depends on the total resistance in the circuit: $$I = \frac{6V + 6V}{4\Omega + 1.5\Omega + R}$$ Setting $R = 0$, the current is $I = \frac{12V}{5.5\Omega} \approx 2.2A$. Increasing $R$ decreases $I$, and so there is a value for $R > 0$ that gives a current of 1.5A This is a perfectly general approach that applies even if the two batteries had different voltages. As another answer points out, due to the symmetry of this circuit, one can find the value of $R$ that gives a zero volt reading by inspection.
{ "domain": "physics.stackexchange", "id": 58204, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, electric-circuits, electrical-resistance, batteries", "url": null }
ros, ros-kinetic, ubuntu, build, source Originally posted by Chrizzl with karma: 48 on 2017-09-26 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by gvdhoorn on 2017-09-26: So the from-source install was because running binaries from the binary installation didn't seem to work? Comment by Chrizzl on 2017-09-26: Yes, you understand that correctly. Because ROS wasn't working as I expected I thought I had the wrong installation or something. Hence I tried to install from source.
{ "domain": "robotics.stackexchange", "id": 28924, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, ubuntu, build, source", "url": null }
java, hash-map this.table[hashFunction(entry.getKey())].setData(entry); this.size++; return true; } else { // if bucket contains data: // iterate through bucket until a. bucket with data containing key is found, b. bucket with no entry data is found, or c. null bucket is found ListNode<Entry<K, V>> tempBucket = this.table[hashFunction(entry.getKey())]; if(tempBucket.getData().getKey().equals(entry.getKey())) { // if bucket contains correct entry key data tempBucket.getData().setValue(entry.getValue()); return true; } while(tempBucket.getNext() != null) { if(tempBucket.getData().getKey().equals(entry.getKey())) { // if bucket contains correct entry key data tempBucket.getData().setValue(entry.getValue()); return true;
{ "domain": "codereview.stackexchange", "id": 29205, "lm_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, hash-map", "url": null }
ros, rviz Title: Saving rviz plugin configuration Hello! I made an rviz panel for scaling the scene. I override save and load methods and expect saving and loading scale on saving and loading .rviz file. But it doesn't happen: .rviz file doesn't contains scale and scale is always has defualt value on startup. What is wrong? header: #pragma once #include <rviz/panel.h> class QLineEdit; namespace orbiterros { namespace rviz_plugin { class ScalePanel : public rviz::Panel { Q_OBJECT public: ScalePanel(QWidget* parent = nullptr); virtual void load(const rviz::Config& config); virtual void save(rviz::Config config); static const char panel_name[]; public Q_SLOTS: void setWorldScale(const float& scale); protected Q_SLOTS: void updateWorldScale(); protected: QLineEdit* world_scale_editor_; float actual_scale_; static const QString world_scale_property_name; }; } }
{ "domain": "robotics.stackexchange", "id": 36092, "lm_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, rviz", "url": null }
quantum-field-theory, gauge-theory, brst We now can also note that in the ghost-free part of the space, $Q\lvert \psi\rangle = 0$ holds for all states not involving $a$, i.e. the BRST-closed states include the unphysical states generated by the null mode $b$ as well as the physical states generated by $a^1,a^2$. This is precisely the same as the kernel of the Gupta-Bleuler condition $(\partial\cdot A)^+$, which is the space with $p^\mu \zeta_\mu = 0$ where $p$ is the momentum normalized to $(1,0,0,1)^T$ and $\zeta$ the polarization. Note that the spurious null modes correspond to the polarization $\zeta \propto p$ and that they are generated by $$ \sum_\lambda \alpha_\lambda a^{\ast\lambda},$$ where $\alpha$ are numbers determined by $$ \zeta^\mu = \sum_{\lambda,\lambda'} \alpha_\lambda \eta_{\lambda\lambda'} \epsilon^\mu(\lambda')$$ for standard basis 4-vectors $\epsilon(\lambda)$, so we have \begin{align}
{ "domain": "physics.stackexchange", "id": 46267, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, gauge-theory, brst", "url": null }
of area, which is used in beam calculations. Problem 10. 75-m long thin rods to a thin-shelled outer cylinder of mass 20. 11-Circular sector. A ladder is leant against the wall. 12) (b) Determine the magnitude and location of the vertical component of the force on curved section BC of the conduit wall. Semi Circular Area. 1 What is a Beam?. but when i compare it to output from autocad, it doesn't match. A sewer pipe rolls more slowly down an incline than a bowling ball with the same mass. Integrate with respect to y first; use suitable cylindrical coordinates. Determine the moment of inertia of the entire area—w axis Apply the equation in step 5 to determine the moment of inertia Iw of the entire area with respect to the horizontal axis w through A. View Homework Help - Statics Reference Sheet from ME 2560 at Western Michigan University. 60 s by a motor exerting a constant torque. Observation 2: For some constant, c, the centroid must lie along the line x + y = c and furthermore, c must
{ "domain": "waverestaurant.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9793540716711547, "lm_q1q2_score": 0.8400586861717086, "lm_q2_score": 0.8577681049901037, "openwebmath_perplexity": 559.2652028811257, "openwebmath_score": 0.6779171228408813, "tags": null, "url": "http://waverestaurant.it/hbaw/moment-of-inertia-of-quarter-circle.html" }
ecology, mycology Geographical location, climate, and short-term meteorological conditions are responsible for outdoor types and levels of fungal spores. As for the association and apparently colonization/opportunistic behaviour of the genera, it seems like there are not any associations between the two, unless perhaps environmental conditions are subject to changing, and different mold species have different moisture/temperature thresholds, although again these mold groups tend to be generalists and do well at a wider range of environmental conditions than other fungi.
{ "domain": "biology.stackexchange", "id": 4756, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ecology, mycology", "url": null }
python, performance, object-oriented, python-3.x, git candidates = dict(generate_candidates()) if len(candidates) >= 1: msg = """ ~Intermission~ One or more identities match your current git provider. remote.origin.url: {} """ print(textwrap.dedent(msg).lstrip().format(url)) else: candidates = local_ids msg = """ ~Intermission~ Zero passports matching - listing all passports. remote.origin.url: {} """ print(textwrap.dedent(msg).lstrip().format(url)) add_global_id(config, candidates) print_choice(candidates) return candidates def no_url_exists(config, url): """ If a local gitconfig does not contain a remote.origin.url add all available user defined Git IDs and the global Git ID as candidates. Args: config (dict): Contains validated configuration options url (str): A remote.origin.url
{ "domain": "codereview.stackexchange", "id": 11560, "lm_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, object-oriented, python-3.x, git", "url": null }
and integration are the two fundamental operations in single-variable calculus. differentiation, most of the examples are based on the From Calculus For Dummies, 2nd Edition. Definition of Limit: Let f be a function defined on an open interval containing c (except possibly at c) and let L be a real number. sin2 x +cos2 x = 1 differentiation rules: sin(x ±y) = sinxcosy ±cosxsiny (cu) Differentiation/Basics of Differentiation/Exercises Navigation : Main Page · Precalculus · Limits · Differentiation · Integration · Parametric and Polar Equations · Sequences and Series · Multivariable Calculus & Differential Equations · Extensions · References Additional Formulas · Derivatives Basic · Differentiation Rules · Derivatives Functions · Derivatives of Simple Functions · Derivatives of Exponential and Logarithmic Functions · Derivatives of Hyperbolic Functions · Derivatives of Trigonometric Functions · Integral (Definite) · Integral (Indefinite) · Integrals of Simple Functions Differentiation
{ "domain": "brian229.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9891815503903562, "lm_q1q2_score": 0.8285582199824016, "lm_q2_score": 0.8376199694135333, "openwebmath_perplexity": 830.7896849780968, "openwebmath_score": 0.876122772693634, "tags": null, "url": "http://brian229.com/8vpu/differentiation-formulas-and-examples-pdf.php" }
We now turn our attention to $$h(x)=1/(x−2)^2$$, the third and final function introduced at the beginning of this section (see Figure(c)). From its graph we see that as the values of x approach 2, the values of $$h(x)=1/(x−2)^2$$ become larger and larger and, in fact, become infinite. Mathematically, we say that the limit of $$h(x)$$ as x approaches 2 is positive infinity. Symbolically, we express this idea as $$\lim_{x \to 2}h(x)=+∞$$. More generally, we define infinite limits as follows: ### Definition We define three types of infinite limits. Infinite limits from the left: Let $$f(x)$$ be a function defined at all values in an open interval of the form $$(b,a)$$. i. If the values of $$f(x)$$ increase without bound as the values of x (where $$x<a$$) approach the number a, then we say that the limit as x approaches a from the left is positive infinity and we write $$\lim_{x \to a−}f(x)=+∞$$.
{ "domain": "libretexts.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.990440598959895, "lm_q1q2_score": 0.8074393617146093, "lm_q2_score": 0.8152324960856175, "openwebmath_perplexity": 408.5510906027908, "openwebmath_score": 0.8519446849822998, "tags": null, "url": "http://math.libretexts.org/TextMaps/Calculus_Textmaps/Map%3A_Calculus_(OpenStax)/Calculus_I/Chapter_2%3A_Limits/2.2%3A_The_Limit_of_a_Function" }
in the complex plane hint: think two. Left as an exercise thus, the closed set which is both open and.! Set are always both open and closed both open and closed set the empty set is sometimes called clopen. '' it! [ X, \delta ) \ ) in that set a ball \ ( X... Containing all the reals, ( ∞, -∞ ), so (. A complete metric space is both closed and open sets is left an... Is objectionable content in this page has evolved in the open set A⊂... An edit '' link when available a ball \ ( X, \in. ) be a metric space ( ∞, -∞ ), then the boundary of Ais (... But not a single point then we say that openness and closedness are opposite,. } \cap \overline { ( 0,1 ) \subset S\ ) to be closed in X true every. But they aren ’ T figure this out in general, in any metric,. Interval \ ( ( X, y ) \ ) < = X \setminus E\ ) precisely, closed... Our status page at https: //status.libretexts.org are not included in the interior of a space connected if as... Also open, so they 're both open and closed ; they ’ re
{ "domain": "unhcr.gr", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668681821134, "lm_q1q2_score": 0.8021769904931487, "lm_q2_score": 0.817574478416099, "openwebmath_perplexity": 354.70289889697375, "openwebmath_score": 0.9441039562225342, "tags": null, "url": "http://donors.unhcr.gr/h96l64a/viewtopic.php?9b4489=both-open-and-closed-set" }
metric-tensor It doesn't matter whether the elements have absolute value 1. In SR, one generally makes this choice for convenience, because it's possible. In GR, you can't make the metric have constant components.
{ "domain": "physics.stackexchange", "id": 7721, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "metric-tensor", "url": null }
c, parsing, unit-testing, rational-numbers { "-2147.2147480000", { 536803687, -250000 }, 16, 0 }, { "-2147.4000000000", { 10737, -5 }, 16, 0 }, { "-2147.2000000000", { 10736, -5 }, 16, 0 }, { "-2147.2000000001", { 0, +1 }, 16, -1 }, { "-214792000000001", { 0, +1 }, 16, -1 }, { " 0", { 0, +1 }, 5, 0 }, { " 0 ", { 0, +1 }, 5, 0 }, { " X", { 0, +1 }, 0, -1 },
{ "domain": "codereview.stackexchange", "id": 17208, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, parsing, unit-testing, rational-numbers", "url": null }
newtonian-mechanics, forces, kinematics, friction How does an object remain balanced on a frictionless surface and keep moving with a constant velocity without any friction to balance the forces (the resultant net force is equal to 0.) You're right that kinetic friction is constant, assuming the coefficient of friction and mass of the weight don't suddenly change. It seems like your confusion is how a mass would eventually come to rest if friction isn't greater than an applied force. Let's break this down with Newton's second law: $$m\ddot{x}=\sum_iF_i=F_{applied}-F_{friction}$$ $\ddot{x}$ in this case refers to the acceleration of the mass. If $F_{applied}>F_{friction}$, then the mass will accelerate at a constant rate and will not come to rest. Now, if suddenly $F_{applied}$ disappeared, or reduced in magnitude so that $F_{friction}>F_{applied}$, then the object will eventually come to rest because it would be constantly decelerating until it comes to a stop.
{ "domain": "physics.stackexchange", "id": 88215, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, forces, kinematics, friction", "url": null }
ros Originally posted by serf on ROS Answers with karma: 25 on 2017-01-12 Post score: 2 I would advise you to look into the Ardunio Pilot open source project, what you're trying to achieve is incredibly difficult. People have put tens of thousands of hours into developing UAV autopilots and there are some very good ones out there. Get one of these systems working for you, and become familiar with how they operate and then decide if it's really something you want to try and build from scratch. I'm not trying to put you off at all, I've worked on a few really fascinating projects with autonomous drones. It's a lot of fun, but you don't have to re-invent such a complex wheel yourself.
{ "domain": "robotics.stackexchange", "id": 26701, "lm_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 }
javascript, node.js, promise, revealing-module-pattern Title: Node module using promises and the revealing module pattern Can someone give me some feedback on this pattern? I am writing a node.js module that connects to a remote API, caches JSON, returns it as output. I have a cli wrapper script that uses the module, and then returns the output to a non-node app for a completely different purpose. Am I using promises correctly here? Does anyone have any good module pattern + promises examples to look at? Is it proper to promisify a non-promise library and then wrap that library inside of a new promise when creating a function? In this example saveJSON, cachedJSON, and refreshJSON all use fs or request so I am returning promises for those. The lib is similar to this: foo.js: var Promise = require('bluebird') var fs = Promise.promisifyAll(require("fs")) var request = Promise.promisifyAll(require("request")); function Foo() { var json = {}
{ "domain": "codereview.stackexchange", "id": 9986, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, node.js, promise, revealing-module-pattern", "url": null }
turtlebot Originally posted by leo_eng on ROS Answers with karma: 3 on 2012-08-20 Post score: 0 Original comments Comment by leo_eng on 2012-08-20: Ok...but I you can see that I try to do this : http://answers.ros.org/question/41785/roslocate-info-turtlebot-rosws-merge-/ Comment by Lorenz on 2012-08-20: And as the answer indicates, there is a bug in current rosws. I'll edit my answer to show how to still add the output of roslocate. Comment by leo_eng on 2012-08-20: Thanks a lot! I have another problem when I use " rows update ". Itry to correct here! Thanks again! Comment by leo_eng on 2012-08-20: Exception caught during install: Error processing 'turtlebot' : 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128) ERROR: Error processing 'turtlebot' : 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128) The correct command (also used on the wiki page) is: roslocate info turtlebot | rosws merge - rosws update
{ "domain": "robotics.stackexchange", "id": 10684, "lm_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", "url": null }
python, python-2.x, regex, pygame, chess for move in movs: move_to_add = None kind = '' action = None promoting = False piece_respawn = '' piece_x = 0 piece_y = 0 frag = reg.match(move) destiny = [lamesa.coords_x[frag.group(5)[0]],lamesa.coords_y[frag.group(5)[1]]] destiny_h = frag.group(5) if len(frag.group(5)) > 2: if frag.group(5)[2] == '+': promoting = True if (len(frag.group(2)) > 1 and frag.group(2)[0] != '+') or (len(frag.group(2)) > 2 and frag.group(2)[0] == '+'): if frag.group(2)[0] == '+': kind = frag.group(2)[0:2] piece_x = lamesa.coords_x[frag.group(2)[2]] piece_y = lamesa.coords_y[frag.group(2)[3]] else: kind = frag.group(2)[0] piece_x = lamesa.coords_x[frag.group(2)[1]] piece_y = lamesa.coords_y[frag.group(2)[2]] else: kind = frag.group(2) if frag.group(4) == 'x': action = 1 elif frag.group(4) == '*': action = 2
{ "domain": "codereview.stackexchange", "id": 13813, "lm_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, regex, pygame, chess", "url": null }
1: Let f a function differentiable on the neighborhood of the point c in its domain. Inflection points in differential geometry are the points of the curve where the curvature changes its sign.. For example, the graph of the differentiable function has an inflection point at (x, f(x)) if and only if its first derivative f' has an isolated extremum at x. We can represent this mathematically as f’’ (z) = 0. Summary. This example describes how to analyze a simple function to find its asymptotes, maximum, minimum, and inflection point. From a graph of a derivative, graph an original function. (this is not the same as saying that f has an extremum). When the second derivative is negative, the function is concave downward. Figure 2. ; Points of inflection can occur where the second derivative is zero. If the graph y = f(x) has an inflection point at x = z, then the second derivative of f evaluated at z is 0. 2 Zeroes of the second derivative A function seldom has the same concavity type on
{ "domain": "nattierosewrites.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471651778591, "lm_q1q2_score": 0.811144520575754, "lm_q2_score": 0.8244619177503205, "openwebmath_perplexity": 183.50537425085514, "openwebmath_score": 0.6907263398170471, "tags": null, "url": "http://nattierosewrites.com/er2b22s/inflection-points-from-graphs-of-function-and-derivatives-af5c0d" }
c++, c++14 template <Predicate T, typename CharT, typename Traits> std::basic_ostream<CharT, Traits>& operator<<( std::basic_ostream<CharT, Traits>& stream, const CheckedNumber<T>& number) { stream << number.GetValue(); return stream; } template <Predicate T> auto abs(const CheckedNumber<T>& number) { using std::abs; return abs(number.GetValue()); } template <Predicate T, typename U> auto exp(const CheckedNumber<T>& number, const U& exponent) { using std::exp; return exp(number.GetValue(), exponent); } template <Predicate T> auto log(const CheckedNumber<T>& number) { using std::log; return log(number.GetValue()); } template <Predicate T> auto log10(const CheckedNumber<T>& number) { using std::log10; return log10(number.GetValue()); } template <Predicate T, Predicate U> auto pow(const CheckedNumber<T>& base, const CheckedNumber<U>& exponent) { using std::pow; return pow(base.GetValue(), exponent.GetValue()); }
{ "domain": "codereview.stackexchange", "id": 30098, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++14", "url": null }
immunology, virus, vaccination, immune-system, influenza Furthermore, with adaptive immunity you get memory cells that will remember a given infection and quickly resolve it with antibodies should you ever catch the same bug. The difference between our wild type influenza and the ones in the vaccine is attenuation. The point of the wild type influenza people often catch is it's really good at infecting humans, and upon infection it causes a lot of damage. We can attenuate influenza's pathogenicity by growing the flu strains in tissue that is not human. Over a few generations, the virus adapts: it becomes more pathogenic/virulent in non-human tissue, but harmless to humans. You then remove the harmful parts of the hemeagglutinin and neuraminidase genes from a wild type strain to get inert HA and NA (so that you get the wild type immunogenicity), combine them with structural proteins from the attenuated strain, and combine them to form a new, live-attenuated vaccine strain that can be grown in the non-human tissue (see image below).
{ "domain": "biology.stackexchange", "id": 5089, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "immunology, virus, vaccination, immune-system, influenza", "url": null }
Wolfram Alpha. Simply enter "Minimum of Gamma(x+1) near 1.5". ;-) (11-29-2014 12:34 AM)BarryMead Wrote:  I did notice that the value you quoted for the factorial was the same as my findings. Perhaps the result was in error because it could not be discriminated from the correct value in the SLV function which probably stops searching when it sees no change in the value returned from the derivative function. It will stop as soon as the solved function becomes zero. Depending on the second derivative, there may a more or less wide range of 16-digit values that return the same function result near or equal to zero. However, this is not quite the case here – the second derivative is roughly 1 at this point, so changing x by 1 ULP = 10–16 will change the first derivative by a similar amount. Actually the exact first derivative (i.e. the digamma function) of your original result is not quite zero: digamma(1.4616321449682268) = –1.31 · 10–13
{ "domain": "hpmuseum.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9752018398044143, "lm_q1q2_score": 0.8062108563203466, "lm_q2_score": 0.826711787666479, "openwebmath_perplexity": 3862.8385835978174, "openwebmath_score": 0.3922543227672577, "tags": null, "url": "https://www.hpmuseum.org/forum/post-22006.html" }
Thanks - Please don't use display style $$...$$ in titles. It messes up the question list. –  Antonio Vargas Aug 29 '13 at 19:09 Since no one seemed to mention it directly: $\sin x = 2$ is not "undefined". It is an equation whose solution set is empty. Ie, there is no real number $x$ so that $\sin x = 2$. Or: $$\{x \in \mathbb{R} \mid \sin x = 2\} = \varnothing$$ –  alecb Aug 30 '13 at 4:34 But there are complex numbers with $\sin{x} = 2$. –  Dan Aug 30 '13 at 5:54 Taking the arctangent of both sides for this problem (which has simple, exact solutions) is a bad idea because you will miss some solutions. This usually happens with inverse trig functions. If you have a good textbook it may explain why. It is similar to solving $x^2 = 4$ by taking square roots and concluding that the only solution is $x=2$. –  Stefan Smith Aug 31 '13 at 13:31 @StefanSmith how else can you solve the equation? –  salman Aug 31 '13 at 13:51
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138138113964, "lm_q1q2_score": 0.8230645621986301, "lm_q2_score": 0.8418256452674008, "openwebmath_perplexity": 247.72877485376088, "openwebmath_score": 0.8965727686882019, "tags": null, "url": "http://math.stackexchange.com/questions/479349/what-does-tan-x-1-mean" }
c++, beginner, homework, database, statistics //Loops through vector and writes the elements into file for (int i = 0; i < (addMarks.size()); i++) { fileWriter << "\n" << addMarks[i]; } fileWriter.close(); std::cout << "\nSuccessfully written changes! Press any key to continue"; std::cin.ignore(256, '\n'); //Stops the program from skipping ahead std::cin.get(); //Pauses program return true; } } double calculateMean(const int arrayItemCount, std::vector<std::string>marksArray) { std::vector<int> numberStore; // Temp storage of numerical test data
{ "domain": "codereview.stackexchange", "id": 22964, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, homework, database, statistics", "url": null }
differential-geometry, curvature, vector-fields its transportation to point $\mathrm{Q}$. At this point the vector is tangent to the second part $\mathrm{QN}$, arc of a great circle, another meridian, another geodesic. The conclusion is that we have a different result by parallel transport along this second path.
{ "domain": "physics.stackexchange", "id": 72550, "lm_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, curvature, vector-fields", "url": null }
java, design-patterns, mvc, android private GameInfo diagonalsResultInfo() { GameInfo leftUpperDiagonalResultInfo = leftUpperDiagonalResultInfo(); if (leftUpperDiagonalResultInfo.resultIsKnown()) { return leftUpperDiagonalResultInfo; } else { return rightUpperDiagonalResultInfo(); } } private GameInfo leftUpperDiagonalResultInfo() { return resultInfoByCellsPositions(leftUpperDiagonalPositions()); } private List<Matrix.Position> leftUpperDiagonalPositions() { List<Matrix.Position> positions = new ArrayList<Matrix.Position>(); for (int i = 0; i < gameBoardDimension; ++i) { positions.add(new Matrix.Position(i, i)); } return positions; } private GameInfo rightUpperDiagonalResultInfo() { return resultInfoByCellsPositions(rightUpperDiagonalPositions()); }
{ "domain": "codereview.stackexchange", "id": 5091, "lm_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, design-patterns, mvc, android", "url": null }
waves, electromagnetic-radiation, photons Title: How do electromagnetic waves wave? Electromagnetic waves have a physical crest and trough as observed in microwaves and radio waves. I understand that is electromagnetic field vectors that wave, not the photon. But how do they wave? What does causes them to change direction? It is important to remember that an electromagnetic wave is exactly what it says on the tin: an electro-magnetic wave, i.e. it contains both an oscillating electric and an oscillating magnetic field. When the amplitude of one of the fields decreases, it causes also a change in the other field, and vice versa. This is due to Maxwell's equations, which link the changes of electric and magnetic fields in time and space. A helpful picture to visualize what is going on in such a wave is the following:
{ "domain": "physics.stackexchange", "id": 46025, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves, electromagnetic-radiation, photons", "url": null }
supernova Title: Supernova in Hertzsprung–Russell diagram If you could put a supernova in the Hertzsprung–Russell diagram. Where would it be? Would it be near the white dwarfs or near the super giants? I know that a supernova isn't a star but rather the explosion of a star, but if you technically could. Where would it be located? Thanks! It would be located way off the diagram to the top and left i.e. moderately hot and very, very luminous. Of course it then changes with time as the supernova fades and cools. This paper by Faran et al. (2017) shows plots of luminosity and temperature versus time for type II supernovae. They start at 15,000K and luminosities of about a billion suns and then fade to about 5000K and by an order of magnitude in luminosity after 50 days.
{ "domain": "astronomy.stackexchange", "id": 2687, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "supernova", "url": null }
ros, ros-kinetic Originally posted by mgruhler with karma: 12390 on 2018-02-28 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by Nebula on 2018-02-28: what are the variables associated with header seq, secs, nsecs and frame_id? Comment by mgruhler on 2018-02-28: what do you mean with "what are the variables"? The header is a standard ROS msg (http://docs.ros.org/api/std_msgs/html/msg/Header.html).
{ "domain": "robotics.stackexchange", "id": 30163, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic", "url": null }
climate-change, co2, greenhouse-gases Title: How has the increase in global CO2 been attributed to an anthropogenic cause? How has the increase in global CO2 been attributed to an anthropogenic cause? It would seem to me that this could be definitively determined on the basis of placing gas spectrometers on the exhausts of a stratified random sample of exhaust pipes: (a) Motor vehicles, (b) Aircraft (c) smoke stacks of factories. et cetera. Has this been done or are we just guessing? There is a very great answer show below that essentially says from: (a) The known GHG emissions of the fossil fuels (b) The known fossil fuel consumption for last year (c) The known increase in atmospheric GHG last year we can use simple arithmetic to determine how much of this emission has an anthropogenic cause. Because the ocean is such a powerful GHG sink, I would expect that the above process might account for more than 100% of the increase of atmospheric GHG. I am still trying to find the data to quantify the above
{ "domain": "earthscience.stackexchange", "id": 2034, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "climate-change, co2, greenhouse-gases", "url": null }
ros, ros2, ament, messages This error repeats for all the new types. However, that structure does have the field in question. From build/rcl_interfaces/rosidl_generator_c/rcl_interfaces/msg/parameter_value__struct.h: /// Struct of message rcl_interfaces/ParameterValue typedef struct rcl_interfaces__msg__ParameterValue { uint8_t type; bool bool_value; int64_t integer_value; double double_value; rosidl_generator_c__String string_value; rosidl_generator_c__byte__Array byte_array_value; rosidl_generator_c__bool__Array bool_array_value; rosidl_generator_c__int64__Array integer_array_value; rosidl_generator_c__float64__Array double_array_value; rosidl_generator_c__String__Array string_array_value; } rcl_interfaces__msg__ParameterValue;
{ "domain": "robotics.stackexchange", "id": 29663, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros2, ament, messages", "url": null }
javascript, performance, circular-list Ring.prototype.relativeIndex = function (index) { return (this._start + index) % this.length; }; /* Should not be used when there is a set _blockLength */ Ring.prototype.push = function (element) { var start = this._start, newStart = start + 1; this._buffer[start] = element; this._start = 0; if (newStart <= this._maxIndex) { this._start = newStart; } }; Ring.prototype.get = function (index) { this.checkBounds(index, 'get'); return this._buffer[this.relativeIndex(index)]; }; Ring.prototype.set = function (index, value) { this.checkBounds(index, 'set'); this._buffer[this.relativeIndex(index)] = value; }; Ring.prototype.concat = function (arr) { var alen = arr.length, blen = this._blockLength, start; if (alen !== blen) { throw new ImproperBlockLength(blen, alen); }
{ "domain": "codereview.stackexchange", "id": 4089, "lm_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, performance, circular-list", "url": null }
ros, ros-melodic, turtlesim, keyboard-teleop #define ROS_DEBUG(...) ROS_LOG(::ros::console::levels::Debug, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__) ^~~~~~~ /home/alberto/tiago_dual_public_ws/src/continuos_input/src/key_reader.cpp:86:17: note: in expansion of macro ‘ROS_DEBUG’ ROS_DEBUG("value: 0x%02X\n", c); ^~~~~~~~~ make[2]: *** [CMakeFiles/key_reader.dir/src/key_reader.cpp.o] Error 1 make[1]: *** [CMakeFiles/key_reader.dir/all] Error 2 make: *** [all] Error 2 cd /home/alberto/tiago_dual_public_ws/build/continuos_input; catkin build --get-env continuos_input | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
{ "domain": "robotics.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": "ros, ros-melodic, turtlesim, keyboard-teleop", "url": null }
ros, gazebo, simulation, ros-melodic Its been a while since I've used melodic, so there may be other issues that I don't remember. But the above may offer a place to start looking. Originally posted by shonigmann with karma: 1567 on 2021-08-06 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by electrophod on 2021-08-06: Thanks a lot for the detailed answer! @shonigmann
{ "domain": "robotics.stackexchange", "id": 36776, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, gazebo, simulation, ros-melodic", "url": null }
beginner, vba Private Const Expenses As String = "Spesen" Private Const ExpensesName As String = "Reisekosten" Private Const WorkingTime As String = "Arbeitszeit" Private Const StaffEmailAdress = "StaffEmail@Company.org"
{ "domain": "codereview.stackexchange", "id": 36949, "lm_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, vba", "url": null }
neuroscience Are larger neurons more likely to be stained? Are specific cell types more susceptible than others? Golgi staining is used mostly for brain slices (I have never seen or heard its application for other tissues). Traditionally one of the biggest cells here are pyramid neurons (NA, ACh-ergic) and one of the smallest are interneurons (often GABA-ergic) -- both are amenable to Golgi staining (reference) and there is no seemingly clusterization of stained cells by their size or transmitter type. What is preventing us from using the advanced molecular biology techniques to understand the process? I can name several reasons for this:
{ "domain": "biology.stackexchange", "id": 183, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience", "url": null }
javascript, beginner, html, animation, d3.js Do not use for loops to append element. Use a data-binding approach instead, which is the idiomatic D3. So, the above code can be: d3.select("svg").selectAll(null) .data(d3.range(4)) .enter() .append('g') //etc... Better than that, name your selections: var groups = d3.select("svg").selectAll(null) .data(d3.range(4)) .enter() .append('g') //etc... For instance, instead of doing... d3.select("svg") ... all the time, you can do: var svg = d3.select("svg")
{ "domain": "codereview.stackexchange", "id": 29636, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, beginner, html, animation, d3.js", "url": null }
I don't know an easier way. Your example shows the failure of a greedy algorithm. Factor the desired number of factors, here as $3*2^3$. Starting from the largest factor, find the cheapest way to get that many. So start with $2^2$, which has $3$ factors. Now you need to double it. You can either multiply by a new prime, clearly $3$, or increase the exponent of $2$ to $5$. Since the first has a factor $3$ and the second $8$, we choose $2^2*3$ Now we want to double again, and our choices are $2^3, 3^2, \text{ or } 5$ and we take $5$, giving $2^2*3*5$ One more doubling comes from $7$, and we come up with $2^2*3*5*7=420$, not the best.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877667047451, "lm_q1q2_score": 0.8501157190318125, "lm_q2_score": 0.8757869916479466, "openwebmath_perplexity": 297.41830065468, "openwebmath_score": 0.8289042711257935, "tags": null, "url": "https://math.stackexchange.com/questions/496494/smallest-number-with-specific-number-of-divisors" }
of the test statistics that speaks about the relationship! Dependence of two sets of data values coefficient Significance Calculator between variables of based... Test statistics that speaks about the statistical relationship or the association between two variables a! Of covariance statistical test consists of assessing whether or not the correlation coefficient Calculator the … correlation Calculator. R ) is a measure of the association, or correlation, \ \rho\... Variables in a set of data values the measures the strength and direction the... A free online tool that displays the correlation coefficient is significantly different from zero more about Significance of linear. Association between variables of interest based on the method of covariance dependence of two variables in a set of.. Typical statistical test consists of assessing whether or not the correlation coefficient Calculator the population correlation as! Free alternative to Minitab and other paid statistics packages,
{ "domain": "calcigarro.cat", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534316905263, "lm_q1q2_score": 0.8135648360147236, "lm_q2_score": 0.8289388062084421, "openwebmath_perplexity": 840.1354149351382, "openwebmath_score": 0.6115067005157471, "tags": null, "url": "http://booking.calcigarro.cat/restaurants-in-decuvlq/1e8d7d-correlation-coefficient-calculator" }
not including a zero in the time array could cause problems, which was a main concern there. We work a couple of examples of solving differential equations involving Dirac Delta functions and unlike problems with Heaviside functions our only real option for this kind of differential equation is to use Laplace transforms. As is an even function, its Fourier transform is Alternatively, as the triangle function is the convolution of two square functions ( ), its Fourier transform can be more conveniently obtained according to the convolution theorem as:. Fourier,who in the early part of the 19th century proposed that an arbitrary repetitive function could be written as an infinite sum of sine and cosine functions [1]. Fourier transform 17 2. The convolution theorem states that the Fourier transform of the product of two functions is the convolution of their Fourier transforms (maybe with a factor of 2\pi or \sqrt{2\pi} depending on which notation for Fourier transforms you use). where
{ "domain": "lotoblu.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9859363741964573, "lm_q1q2_score": 0.8060764146939288, "lm_q2_score": 0.8175744761936437, "openwebmath_perplexity": 487.3528843491706, "openwebmath_score": 0.8950192332267761, "tags": null, "url": "http://lotoblu.it/satw/heaviside-function-fourier-transform.html" }
particle-physics, weak-interaction This states has been considered in literature. Take for instance paper:
{ "domain": "physics.stackexchange", "id": 10685, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, weak-interaction", "url": null }
python, python-3.x As an example in and out: # sample input: >>> g = Garden("GCRR\nVVRR", ["Alice","Bob"]) # sample output: >>> g.plants("Alice") ["Grass","Clover","Violets","Violets"] >>> g.plants("Bob") ["Radishes","Radishes","Radishes","Radishes"] It's not a bad solution, but it doesn't feel quite fluently expressed in Python. In particular, I feel like the conversions between lists and generators are unnatural. It would also help if you toned down the functional thinking in favour of list comprehensions. I'll start by mentioning that blank lines between method definitions would make your code more readable, as suggested in PEP 8. Also, constants should be named using ALL_CAPS. Let's start with the constructor:
{ "domain": "codereview.stackexchange", "id": 9941, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x", "url": null }
c#, parsing, rubberduck private IEnumerable<CommentNode> _comments; public IEnumerable<CommentNode> Comments { get { return _comments; } } } That object is returned by VBParser methods, that the rest of Rubberduck uses (via IRubberduckParser): public class VBParser : IRubberduckParser { public INode Parse(string projectName, string componentName, string code) { var result = Parse(code); var walker = new ParseTreeWalker(); var listener = new VBTreeListener(projectName, componentName); walker.Walk(listener, result); return listener.Root; } public IParseTree Parse(string code) { var input = new AntlrInputStream(code); var lexer = new VisualBasic6Lexer(input); var tokens = new CommonTokenStream(lexer); var parser = new VisualBasic6Parser(tokens); var result = parser.startRule(); return result; }
{ "domain": "codereview.stackexchange", "id": 11990, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, parsing, rubberduck", "url": null }
python, beginner, python-3.x, tkinter, unit-conversion Currency_Output1_Label.config(text="GBP") Currency_Output1.insert(0,round(UserInput*0.698050067,2)) Currency_Output2_Label.config(text="CNY") Currency_Output2.insert(0,round(UserInput*6.28594776,2)) elif box.get() == "GBP": Currency_Output_Label.config(text="EUR") Currency_Output.insert(0,round(UserInput*1.15790376,2)) Currency_Output1_Label.config(text="USD") Currency_Output1.insert(0,round(UserInput*1.432562,2)) Currency_Output2_Label.config(text="CNY") Currency_Output2.insert(0,round(UserInput*9.0008486,2))
{ "domain": "codereview.stackexchange", "id": 30223, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, tkinter, unit-conversion", "url": null }
java, graph, breadth-first-search, depth-first-search public static void main(String[] args) { Graph gDfs = createNewGraph(); GraphImplementation s = new GraphImplementation(); System.out.println("--------------DFS---------------"); s.dfs(gDfs.getNode()[0]); System.out.println(); System.out.println(); Graph gBfs = createNewGraph(); System.out.println("---------------BFS---------------"); s.bfs(gBfs.getNode()[0]); } } Graph.java: package graphs; public class Graph { public int count; // num of vertices private Node vertices[]; public Graph() { vertices = new Node[8]; count = 0; } public void addNode(Node n) { if(count < 10) { vertices[count] = n; count++; } else { System.out.println("graph full"); } } public Node[] getNode() { return vertices; } }
{ "domain": "codereview.stackexchange", "id": 7333, "lm_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, graph, breadth-first-search, depth-first-search", "url": null }
c++, array, matrix, iterator, c++20 reference is T&. const_reference is T const&. reference const is T& const… but all references are const, so that just boils down to T&. So const reference is just T&… not T const&. Incidentally, any function that returns const anything is probably wrong. Imagine a function that returns a const int: const int f() { return 42; } If you think that means the value returned can’t be changed… well… try this: auto i = f(); ++i; // !!! std::cout << i; // prints 43
{ "domain": "codereview.stackexchange", "id": 42493, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, array, matrix, iterator, c++20", "url": null }
6. .mau. Says: I agree that in many paradoxes it is utility, rather than probability, that is involved. Another family of not-quite-paradoxes is related to Bayesian probability, and it is especially important for doctors. A typical example run as follows: I am having a test to check for AIDS. If I am infected, the test always shows it; if I am not infected, there is one chance out of ten that the test is wrong. Only 1% of people in my nation is infected, and I did not do anything particular. If the test says I got AIDS, what is the probability of actually having it? I am not sure, however, if this is what you are searching for. 7. David Says: OK, I’ve heard about the two envelop probeme before and obviously the expectation value argument is wrong but how can one see that it is erroneous? What is the subtle reasoning? 8. Emmanuel Kowalski Says: The last part of my comment should read: “the “ranking” R which takes value 1 (say) if X> Y and 0 if X < Y, with same probability 1/2”.
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534349454033, "lm_q1q2_score": 0.8561683322292724, "lm_q2_score": 0.8723473796562744, "openwebmath_perplexity": 720.3603668181725, "openwebmath_score": 0.8131545782089233, "tags": null, "url": "https://gowers.wordpress.com/2008/02/01/a-paradox-in-probability/" }
binary-star, mass Title: Binary - when mass transfer starts How to estimate when the mass transfer will start? What is the characteristic of pre-mass transfer binaries? There are two ways in which mass transfer may occur. The first way is driven by stellar winds: stars constantly loose mass throught stellar wind, if there is a companion star sweeping around, it will capture some of the wind and increase its mass. This process is always active, but not always significant. For example, the Sun looses about $10^{-14} M_\odot \text{yr}^{-1}$; if it had a companion, the mass transfer would be too small to be relevant in any way. This kind of mass transfer becomes more important, the highest is the mass loss rate. So you will have to look for luminous red giants and AGB stars. More on this in Boffin 2014.
{ "domain": "astronomy.stackexchange", "id": 6513, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "binary-star, mass", "url": null }