text
stringlengths
1
1.11k
source
dict
java, algorithm, strings, interview-questions, hash-map } public static void main(String[] args) { String s1="abca"; String s2="zbxz"; System.out.println(areIsomorphic(s1, s2)); } } /* side note: can isomorphic strings be of different lengths? Then what algorithm do you suggest? */ I see that your coding style is improving. What comes to the concept of isomorphism, two strings of different length should never be considered isomorphic due to the definition of isomorphism: Two strings \$S_1 = c_1 c_2 \dots c_n\$ and \$S_2 = c'_1 c'_2 \dots c'_n\$ are isomorphic if and only if there exists a bijection \$f\$ such that \$c'_i = f(c_i)\$ for all \$i = 1, 2, \dots, n\$. What comes to your algorithm, you could rewrite it a little bit more succintly: public static boolean areIsomorphic(String s1, String s2) { if (s1.length() != s2.length()) { return false; } Map<Character, Integer> frequencyMap1 = new HashMap<>(); Map<Character, Integer> frequencyMap2 = new HashMap<>();
{ "domain": "codereview.stackexchange", "id": 20150, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, strings, interview-questions, hash-map", "url": null }
ros, rosnode, node, remote and this can be resolved on the remote machine both by /etc/hosts AND dns to fwn-nb4-16-202.phys.rug.nl Is there anything that I am forgetting? Regards, Sietse PS. If I do the same between PC one and another regular PC that is also on the phys.rug.nl net, everything works.... Edit: I notice something else. If I do not set a remote master, the environment gives me: ROS_MASTER_URI=http://localhost:11311 And roscore then says: ROS_MASTER_URI=http://fwn-nb4-48-148:11311/ Note that the domainname (which is fwn.rug.nl) is missing. This still could be ok. But I find is suspisious that when, on a remote PC, I do "rosnode info rosout" It says: ERROR: Communication with node[http://fwn-nb4-48-148:46685/] failed! And now the lack of the domainname is indeed an error. Is there an error here somewhere? Originally posted by Sietse on ROS Answers with karma: 168 on 2016-01-26 Post score: 0
{ "domain": "robotics.stackexchange", "id": 23559, "lm_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, rosnode, node, remote", "url": null }
Hint: $9 = 1 + 8$ Staff - 5 years, 7 months ago $(1+8)^{x} = 4a + 1 \;\;\; \Rightarrow \;\;\; (1+8)^{x} + 1 = 4a + 2 = 2(2a+1)$ for some natural $a$ - 5 years, 7 months ago Perfecto! Great job! In fact, it is $2 ( 1 + 4b )$. Staff - 5 years, 7 months ago
{ "domain": "brilliant.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936073551712, "lm_q1q2_score": 0.8068517840893339, "lm_q2_score": 0.8198933293122506, "openwebmath_perplexity": 2283.086871345608, "openwebmath_score": 0.9859610199928284, "tags": null, "url": "https://brilliant.org/discussions/thread/how-many-factors-2-the-number-3x-1-has-given-that/" }
Since the only one-digit number divisible by $$9$$ is $$9$$ itself, we can conclude that $$d^*(n)=9$$ if and only if $$n$$ is divisible by $$9$$. Since $$360$$ is divisible by $$9$$, its reduced digit sum is $$9$$; the same happenso for $$180$$ and so on. When you divide an even integer $$n$$ by $$2$$, the quotient is divisible by $$9$$ if and only if $$n$$ is divisible by $$9$$. What if the integer $$n$$ is odd? Well, the digits sum of $$10n$$ is the same as the digit sum of $$n$$. So what you are actually doing when arriving at $$45$$ is actually \begin{align} &45 \xrightarrow{\cdot10} 450 \xrightarrow{/2} 225 && d^*(225)=9 \\ &225 \xrightarrow{\cdot10} 2250 \xrightarrow{/2} 1225 && d^*(1225)=9 \end{align} and so on. Note that the first step can also be stated as $$45 \xrightarrow{\cdot5} 225$$ Under these operations divisibility by $$9$$ is preserved, because you divide by $$2$$ or multiply by $$5$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.984093606422157, "lm_q1q2_score": 0.8263768267082491, "lm_q2_score": 0.8397339656668286, "openwebmath_perplexity": 162.8357169436269, "openwebmath_score": 0.8912495970726013, "tags": null, "url": "https://math.stackexchange.com/questions/3064917/repeatedly-dividing-360-by-2-preserves-that-the-sum-of-the-digits-including" }
vba, excel strLines2(Loop2) = Replace(strLines2(Loop2), strDiagProcBeingFixed, dictICDProcs(strDiagProcBeingFixed)) End If 'Trigger warning if multiple replacement codes exist If InStr(1, strDiagProcBeingFixed, ",", vbTextCompare) > 0 Then strLines2(Loop2) = Replace(strLines2(Loop2), strDiagProcBeingFixed, "BADCODE") If boolCodeWarning = False Then MsgBox "ICD9 code with multiple ICD10 replacements found in " & strFileName & ", on line " & Loop2 + 1 & ". This claim should be provider corrected if at all possible. This file will have " & """" & "(Code Issues)" & """" & " appended to its file name and will have " & """" & "BADCODE" & """" & " written in the affected diagnosis. This warning will not appear again for this file."
{ "domain": "codereview.stackexchange", "id": 24551, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, excel", "url": null }
c, strings Final Product #include <string.h> // strlen(), memcmp() /** * @fn int strend(const char *s, const char *t) * @brief Searches the end of string s for string t * @param s the string to be searched * @param t the substring to locate at the end of string s * @return one if the string t occurs at the end of the string s, and zero otherwise */ int strend(const char *s, const char *t) { size_t ls = strlen(s); // find length of s size_t lt = strlen(t); // find length of t if (ls >= lt) // check if t can fit in s { // point s to where t should start and compare the strings from there return (0 == memcmp(t, s + (ls - lt), lt)); } return 0; // t was longer than s } Tests and Benchmarking Here are a few trial runs I did of the method, and their output. All seems well by the tests.
{ "domain": "codereview.stackexchange", "id": 8084, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, strings", "url": null }
3 Gelfand and Manin's "Methods of homological algebra" explains the subject quite nicely, though it takes them some pages to develop the theory (and there are many typos, at least in the first edition). Personally, I also use the first three chapters of Huybrecht's "Fourier-Mukai transforms in algebraic geometry", which is a bit more condensed but has a nice ... Only top voted, non community-wiki answers of a minimum length are eligible
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357585701874, "lm_q1q2_score": 0.8027048919184522, "lm_q2_score": 0.8198933337131077, "openwebmath_perplexity": 292.5301134314803, "openwebmath_score": 0.9596521258354187, "tags": null, "url": "http://math.stackexchange.com/tags/derived-functors/hot" }
electrochemistry Why do they gain electrons at only the electrodes to become neutral? Again, where else could they gain electrons? They are sitting in a solution contain themselves and their respective anions, which they have already reacted with, and will no longer be transferring electrons with.
{ "domain": "chemistry.stackexchange", "id": 690, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrochemistry", "url": null }
algorithms, sorting After iteration $i$, the first $i$ positions in the array are the first $i$ positions of the input, in sorted order Note that this doesn't mean that they need to be in their final positions for the sort to work at the end. I'd say that this is the defining thing for "insertion sort", but that's not really a formal statement. Insertion sort is not hard to turn into a recursive procedure. The main routine you want is a helper called insert-sorted such that consumes a sorted list and a number, and outputs a new sorted list (one longer) that includes the number. You can write it in a way that is pretty much paradigmatic for Scheme (note, code just typed in, not tried): (define (insert-sorted n l le) (if (null? l) (list n) (if (le n (car l)) (cons n l) (cons (car l) (insert-sorted n (cdr l) le)))))
{ "domain": "cs.stackexchange", "id": 4518, "lm_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, sorting", "url": null }
java, performance Title: Check address from Melissa server How can I improve this code? public String checkAddressFromMelissaServer(boolean isEditMode, boolean addressChecked, Address address) { boolean isAddress = false; boolean isError = true; String SystemResult = ""; boolean systemErrorFlag = false; StringBuffer requestAddress = new StringBuffer(); Address returnAddress = null; StringBuffer addressNew = new StringBuffer(); StringBuffer addressReturn = new StringBuffer();
{ "domain": "codereview.stackexchange", "id": 13928, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance", "url": null }
reinforcement-learning, policy-gradients al. (2000) or Sutton and Barto (2018), chapter 13). In particular, policy gradient methods optimize the value of the start state $s_0$ under the current policy, $v_\pi(s_0)$. Since this value is defined as an expectation over returns, then your conclusion is correct. Sutton, Richard S., and Andrew G. Barto. 2018. Reinforcement Learning - an Introduction. Adaptive Computation and Machine Learning. MIT Press. http://www.worldcat.org/oclc/37293240. Sutton, Richard S, David A McAllester, Satinder P Singh, and Yishay Mansour. 2000. “Policy Gradient Methods for Reinforcement Learning with Function Approximation.” In Advances in Neural Information Processing Systems, 1057–63.
{ "domain": "ai.stackexchange", "id": 1738, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reinforcement-learning, policy-gradients", "url": null }
sampling, aliasing, resampling Title: Multiple choice on sampling and aliasing I found some multiple choices in a well known book . The problem is that I don't get the answers in some and I want to do so. Question 1: The signal x(t) with Fourier transform $X(j\omega) = u(\omega)- u(\omega -\omega_0 )$ can undergo impulse-train sampling without aliasing, provided that the sampling period $T <\frac{2\pi}{\omega_0}$. Answer: True Okay here's what I think: $x(t)$ should be sampled with at least: \begin{align} ωs &> 2B \\ &> 2(B_1-B_2)\\ &>2(\omega_0 - 0) \\ &> 2\omega_0 \\ \frac{2\pi}{T_s} &> 2\omega_0 \\ T_s&<\frac{\pi}{\omega_0} \end{align} What do I miss? Question 2: $50\pi$ For $x(t)$, $\omega_{\text{max}} = 50π + 50π = 100π$ and so $ω_s > 2\omega_{\text{max}} = 200π$.
{ "domain": "dsp.stackexchange", "id": 9650, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sampling, aliasing, resampling", "url": null }
electromagnetism, classical-electrodynamics, boundary-conditions Title: Changes in boundaries with the application of Faraday's law Reviewing Faraday's law of an induced electric field due to a changing magnetic field $$ \nabla \times E = -\frac{\partial B}{\partial t}$$ In integral form via application of Stokes theorem: $$ \oint_\Gamma E \cdot ds = \int_s(\nabla\times E) da = -\int \frac{\partial B}{\partial t} da$$ and $\Gamma$ is the closed curve, with $S$ being the surface bounded by it. My issue is considering changes of those boundaries. I'll use a simple example to showcase my issue: A rectangular loop is placed in a magnetic field produced by a magnet After sometime $dt$, the magnet was moved generating a change in $\Phi$: How would I define $\Gamma$ and $S$ w.r.t to the change? In addition, I can increase the complexity of the problem, as the magnet moves away the rectangular loop would deform to a smaller area leading to a $\Delta A$ would $\Gamma$ and $S$'s application have to change with it?
{ "domain": "physics.stackexchange", "id": 56523, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, classical-electrodynamics, boundary-conditions", "url": null }
java, random } } Sub Class (Brains of the game) @SuppressWarnings("serial") public class RussianRouletteGame extends JFrame { int lives = 5; JTextField livesDisplay; JButton gunButton; ImageIcon gunCold; ImageIcon gunActive; JOptionPane endPane = new JOptionPane(); int endProgram; int clicked = 0; JTextField display; public RussianRouletteGame() throws IOException, FontFormatException { super("Russian Roulette"); Font westernOGFont = Font.createFont(Font.TRUETYPE_FONT, RussianRouletteGame.class.getClassLoader().getResourceAsStream("resources/WEST____.TTF")); Font westernNewFont = westernOGFont.deriveFont(westernOGFont.getSize() * 20F); gunCold = new ImageIcon(getClass().getClassLoader().getResource("resources/guncold.gif")); gunActive = new ImageIcon(getClass().getClassLoader().getResource("resources/gunactive.gif")); JPanel buttonPanel = new JPanel(); JPanel livesPanel = new JPanel(); JPanel displayPanel = new JPanel();
{ "domain": "codereview.stackexchange", "id": 14870, "lm_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, random", "url": null }
python, interview-questions, circular-list int_arr = [1,2,3,4,6,4,7] cmp_arr = [6,4,7,1,2,3,4] print(is_rotated(int_arr, cmp_arr)) Naming Your 2 arrays are used the same way, it is a bit weird to have 2 different names for them. Maybe int_arr1 and int_arr2 would be better names. Also the fact that they contain integers may be irrelevant for the naming: arr1 and arr2 would do the trick (or lst1 and lst2 because the corresponding Python primitive data structure is list). Problem with the check for length equal to 0 Checking for identical lengths as the beginning of the function is a nice touch. However, the or len(lst1) == 0 condition makes me uneasy. It only makes a different when the first part of the check was false and the second part is true which means: len(lst1) == len(lst2) == 0 which really means: lst1 == lst2 == [].
{ "domain": "codereview.stackexchange", "id": 29370, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, interview-questions, circular-list", "url": null }
php, mvc, rest public $TestObject; private $status = 200; private static $row = NULL; public function __construct($test = []){ $this->TestObject = $test; parent::__construct(); } public function query($stmt,$row = []){ try{ $stmt->execute(); $row != NULL ? self::$row = call_user_func(array($this,'fetchAll'), $stmt) : self::$row = NULL; }catch(\PDOException $e){ $error = new SqlError($e->getCode()); $this->status = $error->determiner(); } return [$this->status,self::$row]; } //Fetch All private function fetchAll($stmt){ return $stmt->fetchAll(\PDO::FETCH_OBJ); } } DbHandler.php namespace MVCtest\core\database; use MVCtest\core\database\DbConn as DbConn; abstract class DbHandler { //Database Connection protected static $dbConn = null;
{ "domain": "codereview.stackexchange", "id": 25897, "lm_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, mvc, rest", "url": null }
algorithm, c, strings Consider uppercase characters Traditionally, pangrams ignore the case of characters. You should be able to modify the program so that uppercase characters count towards seen. Possibly the simplest way to do this is to count both upper and lower versions of each character (toupper() and tolower() just return their inputs for the non-alphabetic characters). Then remove the islower(i) test from the second loop. Modified program Here's my take on this problem, with the changes I've proposed: #include <ctype.h> #include <limits.h> #include <stdio.h> /* return true if it's a pangram */ int test_pangram(const char *input) { char seen[UCHAR_MAX+1] = { 0 }; for (const char *p = input; *p; ++p) { unsigned char c = (unsigned char)*p; seen[toupper(c)] = 1; seen[tolower(c)] = 1; }
{ "domain": "codereview.stackexchange", "id": 29531, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm, c, strings", "url": null }
fluid-dynamics, newtonian-gravity, atmospheric-science, aerodynamics, flow Title: Is there a Coandă effect outside the atmosphere? For example, when air is blown through a spoon in the atmosphere, the air flow bends toward the spoon. People say it's the Coandă effect. So, outside the atmosphere, when we let air blow through the spoon, does the air flow also bend towards the spoon? I don't think it will, because atmospheric pressure bends the air toward the spoon. You should not expect a Coandă effect without an atmosphere. The Coandă effect comes from entrainment, which requires a pressurized fluid surrounding the jet to be entrained. This creates a low pressure zone around the jet, which then generates a net force towards any nearby surfaces (if there are any, if not the jet just generates entrainment without the Coandă effect). This means that there must be some sort of pressurized environment for this effect, or else you could not generate the low pressure zone (because you can't go lower than "none").
{ "domain": "physics.stackexchange", "id": 60390, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, newtonian-gravity, atmospheric-science, aerodynamics, flow", "url": null }
fluid-dynamics, pressure, flow, bernoulli-equation So start with (1). We first have to ask the question: how much fluid volume is passing every second through an imaginary surface located at 1? The answer is $Av$ where $A$ is the cross-sectional area at position 1 and $v$ is the (average) velocity across this area. How do we know this? Imagine you time a stopwatch at $t=0$, you wait for $\Delta t$ seconds and then you time the stopwatch again. Which part of the fluid has passed through the surface? The answer is all the fluid which is within $v\Delta t$ to the left of our surface (see picture). The fluid has moved $v\Delta t$ to the right, so everything which is less than that distance from the surface has had a chance to pass through.
{ "domain": "physics.stackexchange", "id": 93313, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, pressure, flow, bernoulli-equation", "url": null }
neural-network, deep-learning, rnn, self-study, stacked-lstm First image is given in this question and second image is given in this article. So far what I learned about stacking LSTM layers was based on the second image. When you build layers of LSTM where output of one layer (which is $h^{1}_{l}, l=..., t-1, t, t+1...$) becomes input of others, it is called stacking. In stacked LSTMs, each LSTM layer outputs a sequence of vectors which will be used as an input to a subsequent LSTM layer. However, in the first image, the input variables are fed again into second layer. Can someone tell me whether there is something wrong about stacking LSTM layers like given in the first image? You are correct that "stacking LSTMs" means to put layers on top of one-another as in your second image. The first picture is a "bi-directional LSTM" (BiLSTM), whereby we can analyse a point in a series (e.g. a word in a sentence) from both sides. We care about the context of that point.
{ "domain": "datascience.stackexchange", "id": 3975, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neural-network, deep-learning, rnn, self-study, stacked-lstm", "url": null }
Why does $\cos(x) + \cos(y) - \cos(x + y) = 0$ look like an ellipse? The solution set of $\cos(x) + \cos(y) - \cos(x + y) = 0$ looks like an ellipse. Is it actually an ellipse, and if so, is there a way of writing down its equation (without any trig functions)? What motivates this is the following example. The solution set of $\cos(x) - \cos(3x + 2y) = 0$ looks like two straight lines, and indeed we can determine the equations of those lines. \begin{align} \cos(x) &= \cos(3x + 2y) \\ \implies x &= \pm (3x + 2y) \\ \implies x + y &= 0 \text{ or } 2x + y = 0 \end{align} Can we do a similar thing for the first equation?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137918802722, "lm_q1q2_score": 0.800569539315877, "lm_q2_score": 0.8152324803738429, "openwebmath_perplexity": 709.4771312766482, "openwebmath_score": 0.9093301296234131, "tags": null, "url": "https://math.stackexchange.com/questions/1336698/why-does-cosx-cosy-cosx-y-0-look-like-an-ellipse" }
photography, image-processing, post-processing Title: Streaks on a stacked star field Stacking by Sequator 100 dng photos of night sky taken with a smartphone resulted in a (beautiful, I would say) populated star field where undesired arc streaks are seen all over the field. It is like as the program treated the vast majority of stars as wanted, while (perhaps the less brighter) others are just rendered as they moved along the 100 frames period. Align stars was chosen then accumulation. Question: Is this a common problem using Sequator, or at least happened to some of you? Is there any trivial setting or way to redo the stacking? Thanks. Attached is a compressed copy of the final photo.
{ "domain": "astronomy.stackexchange", "id": 5485, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "photography, image-processing, post-processing", "url": null }
ros-kinetic Title: qt_gui_cpp failed Rapsberry PI 4 I would like to install ROS Kinetic on my Raspberry PI4 using Raspbian Buster: PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" But following the instruction here => https://wiki.ros.org/ROSberryPi/Installing%20ROS%20Kinetic%20on%20the%20Raspberry%20Pi When I type this line => sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic I got this output:
{ "domain": "robotics.stackexchange", "id": 34223, "lm_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", "url": null }
java, beginner, linked-list crntNode: just add the extra characters, its not that much longer: currentNode. Assign value when declaring variables Instead of Node<T> crntNode; Node<T> newNode = new Node<T>(data); crntNode = getNode(index); do this: Node<T> crntNode = getNode(index); Node<T> newNode = new Node<T>(data); You do the same thing in get. Performance To increase performance, save the previous result of expensive method calls in local variables. For example, getNode is expensive, and you call it twice in add as well as remove. index You should get rid of index (not the parameter, but the node field). In a linked list, nodes don't have an index, they only have a next node (and maybe previous if its doubly linked). Maintaining the index adds a lot of complexity and reduces performance, which can be avoided. so just remove index, you are not using it anywhere anyways.
{ "domain": "codereview.stackexchange", "id": 10128, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, linked-list", "url": null }
javascript, jquery, html </table> That's already quite simple, IMO. I think adding jQuery to the mix would make things unnecessarily more complicated, not less. I refactored it out, but I don't think it's good idea to use reduce when the accumulator is going to be the same object every time. See: Is reduce bad? by Google devs. If it's always going to be the same object, it'll be a bit easier to read if that object is declared as a standalone variable in the outer scope. The HTML is a bit weird. A <th> is a table header. It makes sense for the headers to be <th>s, but the table data should probably be <td>s instead.
{ "domain": "codereview.stackexchange", "id": 38314, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, html", "url": null }
python, performance, python-2.x, iterator, iteration #Print out required classes to bottom right corner in red requirements = schedule[section]["requirements"] count = 1 for requirement in requirements: control = str(schedule[section]["requirements"][requirement]["control"]) values = [] for x in range(0, str(schedule[section]["requirements"][requirement]).count("value")): values.append(str(schedule[section]["requirements"][requirement]["value" + str(x + 1)])) if values: msg = control + ": " + str(values) else: msg = control width, height = d.textsize(msg) y2 = y2 -5 d.text([(x2)*2 - width-10, (y2 -(height-5)*count)*2], msg, font=fnt2, fill=(200,0,0,255))
{ "domain": "codereview.stackexchange", "id": 26995, "lm_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, python-2.x, iterator, iteration", "url": null }
value theorem itself or also called first mean value theorem is a special case the. Think about it of Solutions of Simultaneous Linear Equations ( II ) in Two Unknowns 50 per. Terms of the night ( approx one Direction New Single Youtube ; California Licence... Discuss this mean value theorem ' in English- > Finnish dictionary over and under mph... Every time i refer to it r berkeley edu 1 results in real.... The night ( approx ) ≡ X prove 1 be modified by moving the black.. Theorem ; Primary 26A06 ; 26A24, so here ’ s theorem, called Rolle ’ s the formal of. Each of these intervals and adding, we easily prove 1 ; right adequate ;..., called Rolle ’ s start with a special case of the fine print f X! Mean we understand the average of the mean value theorem 安格裡亞魯斯金大學 安格里亚鲁斯金大学 first watch of the most important tools. Can more than one point satisfy the derivative and values of the mean value theorem 2, but reciprocals. Keywords: full cover language mean value theorem right adequate cover
{ "domain": "apartments-rijeka.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846703886661, "lm_q1q2_score": 0.8066409121958934, "lm_q2_score": 0.8244619285331332, "openwebmath_perplexity": 986.4324138427406, "openwebmath_score": 0.7569544315338135, "tags": null, "url": "http://www.apartments-rijeka.com/uranium-hexafluoride-wjwp/language-mean-value-theorem-3b6183" }
javascript, performance, animation element.style[prop] = currentProp; } } }, this); } } // Extracts unit from a string representing a value (i.e.: "10px" -> "px"); ScrollingAnimation.prototype.extractUnit = function (str) { // Is the value a string? (user can write unitless non-string 0, which is a valid position value in CSS // or even write a unitless non-string number expecting the default unit "px" to be applied) if (typeof str.substr !== 'undefined') { // What is the length of the part of the string that represent the value? var numberLength = parseFloat(str).toString().length; // Extract the unit part of the string return str.substr(numberLength); } else { return ""; } } // Checks if the ABP and AES objects have the same keys (and nothing else) ScrollingAnimation.prototype.validateAnimStates = function (obj1, obj2) { var keys1 = Object.keys(obj1); var keys2 = Object.keys(obj2);
{ "domain": "codereview.stackexchange", "id": 29662, "lm_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, animation", "url": null }
newtonian-mechanics, forces Title: two spiring balances My 9th grade textbook says when we set a apparatus by the following procedure "tie the free end of two spring balances X and Y together and name this intersection A and then fix the rigid end of spring balance X to a wall and name this point B and name the rigid end of spring balance Y as C" , and then pull C towards ourselves , we will be exerting a force f on X at point A and the same force will be exerted at the same point by Y on A. so the readings on both the spring balances , would individually equal the force that we originally applied
{ "domain": "physics.stackexchange", "id": 27981, "lm_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", "url": null }
python, beginner, object-oriented, unit-testing def _spare_bonus(self, frame_index): return self._rolls[frame_index + 2] def _strike_bonus(self, frame_index): return self._rolls[frame_index + 1] + self._rolls[frame_index + 2] def _is_spare(self, frame_index): return self._rolls[frame_index] + self._rolls[frame_index + 1] == 10 def _is_strike(self, frame_index): return self._rolls[frame_index] == 10 bowling_game_test.py #!/usr/bin/env python import unittest from bowling_game import Game class BowlingGameTest(unittest.TestCase): def setUp(self): self.g = Game() def roll_many(self, rolls, pins): for roll in range(0, rolls): self.g.roll(pins) def roll_spare(self): self.g.roll(5) self.g.roll(5) def roll_strike(self): self.g.roll(10) def test_gutter_game(self): rolls = 20 pins = 0 self.roll_many(rolls, pins) self.assertEquals(self.g.score(),0)
{ "domain": "codereview.stackexchange", "id": 19210, "lm_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, object-oriented, unit-testing", "url": null }
### Show Tags 05 Apr 2019, 13:06 fskilnik wrote: GMATH practice exercise (Quant Class 17) Company ABC has decided to distribute to its clients several shares of stocks, 1000 stocks per share. Mr. Alicante (its minor client) received 1 share, Mrs. Jung (its second minor client) received 3 shares, Mrs. Thompson (its third minor client) received 5 shares, Mr. Kumbaktoob (its fourth minor client) received 7 shares, and so on. If exactly 1,089,000 stocks were distributed by Company ABC to its clients, how many clients received those shares of stocks? (A) 32 (B) 33 (C) 37 (D) 38 (E) 39 $$n^2 = 1089 = 3^2 * 11^2 <=> n= 3*11 = 33$$ Intern Joined: 01 Oct 2018 Posts: 40 Re: Company ABC has decided to distribute to its clients several shares of  [#permalink] ### Show Tags
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9895109081214212, "lm_q1q2_score": 0.8224251182731598, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 13518.702687814317, "openwebmath_score": 0.4840933084487915, "tags": null, "url": "https://gmatclub.com/forum/company-abc-has-decided-to-distribute-to-its-clients-several-shares-of-291957.html?sort_by_oldest=true" }
python, python-2.x, api def fetch_words(url): """ Retrieving a json result set from the API module An API object is instantiated and a json result set is returned by calling the instance specific API.object.getr() function Args: url (str): URL string to instantiate the API object Returns: dict: JSON data as python dictionary """ api = API.API(url, False, '') return api.getr() def find_max_len(text): """ A linear search of the maximum length of a particular string Every string in the array is looked up by its length and consequently compared The string with the biggest length is then returned Args: text (arr[str]): array of strings that are compared Returns: str: Word with the biggest length """ max_length = '' for i in text: if len(i) > len(max_length): max_length = i return max_length
{ "domain": "codereview.stackexchange", "id": 28934, "lm_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, api", "url": null }
ros, ros-melodic, dwa-local-planner observation_sources: laser_scan_sensor point_cloud_sensor laser_scan_sensor: {sensor_frame: base_range_sensor_link, data_type: LaserScan, topic: /hsrb/base_scan, marking: true, clearing: true} point_cloud_sensor: {sensor_frame: head_rgbd_sensor_rgb_frame, data_type: PointCloud2, topic: /hsrb/head_rgbd_sensor/depth_registered/rectified_points, marking: true, clearing: true} Please change the sensor frame, topic, and dataType fields accordingly Global Parameters global_costmap: global_frame: "map" rolling_window: true transform_tolerance: 2.0 robot_base_frame: "base_link" plugins: - {name: static_layer, type: "costmap_2d::StaticLayer"} - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"} - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
{ "domain": "robotics.stackexchange", "id": 34634, "lm_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, dwa-local-planner", "url": null }
gazebo, ros-electric [rosmake-0] Finished <<< rostest ROS_NOBUILD in package rostest No Makefile in package rostest [rosmake-0] Starting >>> message_filters [ make ] [rosmake-0] Finished <<< message_filters ROS_NOBUILD in package message_filters No Makefile in package message_filters [rosmake-0] Starting >>> angles [ make ] [rosmake-0] Finished <<< angles ROS_NOBUILD in package angles No Makefile in package angles [rosmake-0] Starting >>> tf [ make ] [rosmake-0] Finished <<< tf ROS_NOBUILD in package tf No Makefile in package tf [rosmake-0] Starting >>> diagnostic_msgs [ make ] [rosmake-0] Finished <<< diagnostic_msgs ROS_NOBUILD in package diagnostic_msgs No Makefile in package diagnostic_msgs [rosmake-0] Starting >>> topic_tools [ make ]
{ "domain": "robotics.stackexchange", "id": 12786, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, ros-electric", "url": null }
Unknown and its derivatives linear in the unknown and its derivatives non-homogeneous the... Handbook is intended TO assist graduate students with qualifying examination preparation Differential equations Igor Yanovsky 2005... A term that does not depend on the dependent variable multiplicative scaling behavior i.e equation, which an! 2 Disclaimer: This handbook is intended TO assist graduate students with qualifying examination preparation linear di... Thewave equation, which is an example of an elliptic PDE ) = 0 function! Qualifying examination preparation the ODE d dx u ( x ) ) = 0 linear if contains! Is typical for the whole class an INTRODUCTION TO PDE ’ S 1.4 example ( 4 ) is non-homogeneous the! Will study thewave equation, which is an example of a hyperbolic PDE it is linear in the above examples! It contains a term that does not depend on the dependent variable example of an elliptic.! Graduate students with qualifying examination preparation = 0 is called linear if contains.
{ "domain": "conscienceinquiry.uk", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850837598122, "lm_q1q2_score": 0.801442908904623, "lm_q2_score": 0.8152324983301567, "openwebmath_perplexity": 836.6501808679724, "openwebmath_score": 0.7331438064575195, "tags": null, "url": "http://www.conscienceinquiry.uk/2c96sh/homogeneous-pde-examples-b8f568" }
c#, multithreading, hash-map, dependency-injection, azure public TopicClient GetTopicClient(string topic) { _validationService.StringIsNullOrEmpty(topic, "topic"); if(_topicClients.ContainsKey(topic) && !_topicClients[topic].IsClosed) { return _topicClients[topic]; } else { var newTopicClient = TopicClient.CreateFromConnectionString(this._defaultConnectionString, topic); _topicClients.AddOrUpdate(topic, newTopicClient, (ik, existingV) => newTopicClient); } } public SubscriptionClient GetSubsriptionClient(string topic, string name) { _validationService.StringIsNullOrEmpty(topic, "topic"); _validationService.StringIsNullOrEmpty(name, "name");
{ "domain": "codereview.stackexchange", "id": 14273, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, multithreading, hash-map, dependency-injection, azure", "url": null }
homework-and-exercises, thermodynamics, statistical-mechanics, probability where $v^2e^{-mv^2/2kT}$ is the $\textbf{speed distribution}$ of the gas molecules. The first method evaluate to $kT/2$, while the second method evaluate to the expected result of $3kT/2$. What is wrong with the first method? Which one should I use in this case? Thank you. Velocity is a vector with three components. To integrate over the velocity, you need to do a triple integral in three-dimensional velocity space. If you use the first equation, you are only integrating over a single component of the velocity, so you get one third of the expected result. The second equation is the correct one, and the factor of $v^2$ comes from the surface area of a sphere in velocity space. (It's really a $4 \pi v^2$, but the $4\pi$ cancels with the same factor in the partition function.) In the second equation, we have already integrated over all possible directions of the velocity vector, so we are left with an integral over the magnitude of the velocity (the speed).
{ "domain": "physics.stackexchange", "id": 93667, "lm_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, thermodynamics, statistical-mechanics, probability", "url": null }
ros, robot-state-publisher, ros-hydro, tf-prefix Originally posted by tfoote with karma: 58457 on 2013-10-04 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by Stefan Kohlbrecher on 2013-10-04: I guess so :) So you are suggesting changing robot_state_publisher code (or opening a ticket against it), correct? Asking because I don't see a way to do that using the ROS API. Comment by tfoote on 2013-10-05: Yes, it will require a code change to robot_state_publisher to make this happen. This was really the only case successfully covered by tf_prefix before. All the others required implementers to be tf_prefix aware.
{ "domain": "robotics.stackexchange", "id": 15753, "lm_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, robot-state-publisher, ros-hydro, tf-prefix", "url": null }
quantum-mechanics, heisenberg-uncertainty-principle, fourier-transform Well, the crucial step is missing I think. I understand the wave-mechanical explanation well, and I appreciate that different observables are associated with different eigenstates. Can someone fill in these two points or suggest a reference for: In what sense can a position eigenstate be represented as a sum of momentum eigenstates? Maybe a homely example would do here... How does the math of a position eigenstate represented by multiple momentum eigenstates translate into the product of variances?
{ "domain": "physics.stackexchange", "id": 39617, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, heisenberg-uncertainty-principle, fourier-transform", "url": null }
java, floating-point, interval A lot (most) of the methods from the interface are currently throwing an UnsupportedOperationException, either because the operation doesn't make sense (adding to the range), or because I couldn't figure out how to properly implement it. Any suggestions on how to implement one of the methods would be appreciated. Originally, I allowed for deletions by maintaining a Set of deleted elements. While iterating, the iterator would just skip over any elements in the set. This worked until I realized that get doesn't take it into consideration. I'd like suggestions how how get could be written to allow for a Set of deleted elements. Any general comments on how to improve anything. Range.java: import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.NoSuchElementException; public class Range implements List<Double>, Iterable<Double> {
{ "domain": "codereview.stackexchange", "id": 14637, "lm_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, floating-point, interval", "url": null }
machine-learning, neural-network, overfitting, convolutional-neural-network Normally, I'd pick the model with the best validation MAE (the trends are the same for the testing MAE, for what it's worth). However, the architecture with the best validation MAE also has the largest difference between training and validation MAE. Why is what I'd normally think of as overfitting giving better results? Would you also go with 5 convolutional layers here, or are there concerns with a large difference in training and validation/testing performance?
{ "domain": "datascience.stackexchange", "id": 7601, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, neural-network, overfitting, convolutional-neural-network", "url": null }
inorganic-chemistry, acid-base, redox (1) A very generalized Usanovich theory of acids and basis does consider redox reactions as a special case of acid-base reactions. But this theory is not much known nor applied within chemistry community.
{ "domain": "chemistry.stackexchange", "id": 16012, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, acid-base, redox", "url": null }
ros, navigation, odometry, rviz, ros-kinetic Title: Sending waypoints to navigation stack Hello, I would like to know how to send mutliple goals to a robot that doesn't have LaseScan to create a map. Using the diff_drive package , I managed to visualize the movement of the real robot on rviz (diff_drive_odometry) and to make it achieve one goal after another (diff_drive_go_to_goal). the connection (rosserial_python) isn't perfect but the robot can achieve the goal. Now, I am want to make my robot follow a path. I saw we could use waypoints but I am not really sure about how to do this. Currently, I am subscribing to move_base_simple/goal to send a goal and when the robot achieves its goal, the client can send another goal but in most of the examples I saw, move_base is used, what are the differences between these two ? Thanks in advance, Shanika
{ "domain": "robotics.stackexchange", "id": 33493, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, navigation, odometry, rviz, ros-kinetic", "url": null }
html, css display: block; } @keyframes fade { 0% { opacity: 0; } 11.11% { opacity: 1; } 33.33% { opacity: 1; } 44.44% { opacity: 0; } 100% { opacity: 0; } } /* MENU COL */ .menu { position: relative; z-index: 0; height: 2.9em; margin-bottom: -0.4em; margin-top: 0em; z-index:1000; background-color:#33383b; } /* slideshow header */ .slideshow { position: relative; z-index: ; width: 100%; top: 0em; box-sizing: border-box; height: 250px; max-width: 100%; bottom: 20px; } .slideshow img{ margin:0 auto; width: 100%; max-height: 100%; }
{ "domain": "codereview.stackexchange", "id": 23127, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "html, css", "url": null }
javascript, python, php, html, tic-tac-toe dat['Board']['WinningCombo'] = board.lastwincombo; dat['Board']['DBoard'] = board.squares print(json.dumps(dat)) sys.exit() dat['Board']['Logic'] = board.logic dat['Board']['DBoard'] = board.squares dat['Board']['Complete'] = False dat['Board']['NextMove'] = computer_move print(json.dumps(dat)) As JosephtheDreamer has left the Python to someone else, I'll take up the challenge. It's a small thing, but the styling for the definition of winning_combos doesn't seem right to me. We can see the start of the definition and what is inside, but the close parenthesis is hidden at the end of one of the lines. I prefer to put it on its own line: winning_combos = ( [0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6], )
{ "domain": "codereview.stackexchange", "id": 19081, "lm_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, python, php, html, tic-tac-toe", "url": null }
can help in them... S. LODGE, in Body tensor Fields in Continuum Mechanics, 1974 ( 11 Problem. Help in analyzing them S. LODGE, in the second line of your equation S L Publication Date: Aug... The context obtained from the original tensor in distinctive parts can help in analyzing them conditions for (!: Publication Date: Sun Aug 01 00:00:00 EDT 1965 Research Org notes on vector and tensor Algebra and IlyaL. Tensor Fields in Continuum Mechanics, 1974 ( 11 ) Problem of ijk: ijk klm = δ decomposition of antisymmetric tensor... 319, 343 ] that every tensor product representation is reducible ) the..., but in 4 dimensions, an antisymmetric tensor product, an antisymmetric tensor: Collection: Publisher: Heritage. Original tensor, the vector space of finite games is decomposed into a symmetric and! Be easily obtained from the context for N > 2, they are not, however parts the of! Vector valued function defined on the set of all vectors using the of! Be easily obtained from the context, i.e,
{ "domain": "gridserver.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9869795075882267, "lm_q1q2_score": 0.8915328784058757, "lm_q2_score": 0.9032942138630786, "openwebmath_perplexity": 1231.6727965524285, "openwebmath_score": 0.9046940803527832, "tags": null, "url": "https://s7097.gridserver.com/7k6tqu/3a6bd0-decomposition-of-antisymmetric-tensor" }
for something true and a blue background for somethingfalse. By adding a second proposition and including all the possible scenarios of the two propositions together, we create a truth table, a table showing the truth value for logic combinations. It’s a way of organizing information to list out all possible scenarios from the provided premises. The truth table for the implication p⇒qp \Rightarrow qp⇒q of two simple statements ppp and q:q:q: That is, p⇒qp \Rightarrow qp⇒q is false   ⟺  \iff⟺(if and only if) p=Truep =\text{True}p=True and q=False.q =\text{False}.q=False. We can have both statements true; we can have the first statement true and the second false; we can have the first st… Note that if Alfred is the oldest (b)(b)(b), he is older than all his four siblings including Brenda, so b→gb \rightarrow gb→g. A truth table is a way of organizing information to list out all possible scenarios. In this lesson, we will learn the basic rules needed to
{ "domain": "thebearing.net", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9850429129677614, "lm_q1q2_score": 0.8799480981223229, "lm_q2_score": 0.8933094046341532, "openwebmath_perplexity": 1157.4913499542563, "openwebmath_score": 0.8060331344604492, "tags": null, "url": "https://thebearing.net/dybqf/archive.php?a86677=truth-tables-explained" }
algorithms, complexity-theory, functional-programming Title: Lower complexity bounds without mutation Lower complexity bounds tend to be a very hard problem in general. Despite this, I was wondering if there are any theoretical results that relate lower complexity bounds for some class of problems in the case where mutation is allowed and in the case it's not allowed? In particular, what type of problems would be inherently harder to solve in a purely functional language on a RAM machine?
{ "domain": "cs.stackexchange", "id": 2972, "lm_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, functional-programming", "url": null }
control, motion-planning, algorithm Now I'm wondering how to bypass this obstacle most efficiently. The robot is only aware of the height and width of the obstacle, but has no clue about the depth (only the front of the obstacle is scanned). Feeding the occupancy grid with this new obstacle and running again the A* algorithm is not effective, because of the missing depth. One possible strategy I could imagine is estimating a depth of the length of the grid cell, re-plan and continue the navigation. If the robot faces the same obstacle again, the depth is increased by the size of one additional grid cell length. But I think this is extremely ineffective. The requirement is to only use the Google Project Tango and no additional sensors, such as ultrasonic to sense the sides. Update 1
{ "domain": "robotics.stackexchange", "id": 1123, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "control, motion-planning, algorithm", "url": null }
The number of digits of a number $n$ in base $b$ is given by $$\lfloor\log_b (n)\rfloor + 1$$ Now we have \begin{align*} \lfloor \log_b(\sqrt{n}) \rfloor + 1 &= \left\lfloor\frac{1}{2} \log_b(n) \right\rfloor + 1 \\ &= \begin{cases} \frac{1}{2}\lfloor\log_b(n)\rfloor +1 & \text{if } \lfloor\log_b(n)\rfloor \text{ is even} \\ \frac{1}{2}\lfloor\log_b(n)\rfloor + \frac{1}{2} & \text{if } \lfloor\log_b(n)\rfloor \text{ is odd} \end{cases} \\ &= \left\lceil \frac{1}{2} \left(\lfloor \log_b(n) \rfloor + 1 \right)\right\rceil. \end{align*} Claim: For a positive integer $a$, suppose $a$ has $m$ digits and $a^2$ has $n$ digits. Then $m = \left\lceil \frac{n}{2} \right\rceil$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9893474910447999, "lm_q1q2_score": 0.8244475935025831, "lm_q2_score": 0.8333245911726381, "openwebmath_perplexity": 405.0736206909001, "openwebmath_score": 0.9999397993087769, "tags": null, "url": "https://math.stackexchange.com/questions/1884992/number-of-digits-in-the-square-root-of-a-perfect-square" }
sampling, finite-impulse-response The operations are described below where each row represents the input sampling rate, $d_0, d_1, d_2, \ldots$ repesents the input data , and $w_0, w_1, w_2, w_3$ represent filter coefficients. Here for each four input sample events given as $\phi_1, \phi_2, \phi_3, \phi_4$, the output samples are computed $y_0, y_1, y_2, y_3$ then after the next four input sample events, the next four output samples are computed, all in parallel. Using the graphic from the paper linked at the bottom of this post, in parallel form the transposed FIR filter (assuming 4 taps as I had done above) becomes: Further references detailing this: https://vhdlwhiz.com/part-2-finite-impulse-response-fir-filters/ https://www.atlantis-press.com/article/23421.pdf
{ "domain": "dsp.stackexchange", "id": 11985, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sampling, finite-impulse-response", "url": null }
linear-algebra, reinforcement-learning $$ Where $v$ is the value function, $R^\pi$ is the immediate reward under policy $\pi$, $\gamma$ is the discount factor, and $P^\pi_{s, s'}$ is the transition matrix. I can write out the system of equations as below. For the sake of convenience, I omit the $\pi$ and the $\{s, s'\}$ subscripts. $$ \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix} = \begin{bmatrix} R_1 \\ R_2 \\ \vdots \\ R_n \end{bmatrix} + \gamma \begin{bmatrix} p_{11} & p_{12} & \cdots & p_{1n} \\ p_{21} & p_{22} & \cdots & p_{2n} \\ \vdots \\ p_{n1} & \cdots & \cdots & p_{nn} \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix} $$ I can solve the matrix equation with some simple linear algebra: $$ \begin{align*} v &= R + \gamma P v \\ v - \gamma P v &= R \\ (I - \gamma P)v &= R \\ v &= (I - \gamma P)^{-1}R \end{align*} $$
{ "domain": "cs.stackexchange", "id": 18715, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "linear-algebra, reinforcement-learning", "url": null }
electromagnetism, experimental-physics, history Title: First experiment which was used to prove existence of Electromagnetic waves When I was in high school I heard from my physics teacher in the last year of high school when he was starting the chapter of electromagnetic waves that the first person who proved existence of Electromagnetic waves (perhaps Faraday, Hertz, Maxwell, ..., I don't remember who) made a transmitter and a receiver and put one on a mount and the other on the other mount. Then he sent waves, and at the other side received light (or something like this). I can't remember who, either. Please excuse me, my field of study is not physics and I didn't do anything on it after high school except calculating some equations which my friends needed in physics. My question has two parts:
{ "domain": "physics.stackexchange", "id": 5961, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, experimental-physics, history", "url": null }
javascript, jquery })( //keep your model separate from your controller {}, //pdf configuration, it can be here because it has nothing to do with your application logic { filename: 'test' extension: '.pdf' }, //you can keep your error configuration separate as well { 'not defined': 'Error 0xE001BADF' }, //static data here, or you could put this directly into the html and toggle classes between visible/hidden in your view logic. { '#idA': 'item 1 box content: ...', '#idB': 'item 2 box content...', '#idC': 'item 3 box content...' '#idD': 'etc...' },
{ "domain": "codereview.stackexchange", "id": 17244, "lm_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", "url": null }
general-relativity, differential-geometry, metric-tensor, coordinate-systems, covariance The metric $g$ is defined as a bilinear function from $V \times V \to \mathbb{R}$. But the presence of a metric also defines a correspondence between $V$ and $V^*$, as follows: for any element $v \in V$, define the corresponding element $v^* \in V^*$ as the map $v^*(w) \equiv g(v,w)$. It is not too hard to see that $v^* \in V^*$; since $g$ is bilinear, it is a linear map from $V \to \mathbb{R}$. What's more, this correspondence map is in fact a linear isomorphism between $V$ and $V^*$:
{ "domain": "physics.stackexchange", "id": 87529, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, differential-geometry, metric-tensor, coordinate-systems, covariance", "url": null }
c++, algorithm, minecraft // results are stored in those vectors vector<float> positions, normals, texcoords; vector<unsigned int> elements; This is the algorithm: int n = 0; for(int X = 0; X < SIZE; ++X) for(int Y = 0; Y < SIZE; ++Y) for(int Z = 0; Z < SIZE; ++Z) { if(data[X][Y][Z]) { uint8_t tile = clamp((int)data[X][Y][Z], 0, TILES_U * TILES_V - 1); for(int dim = 0; dim < 3; ++dim) { int dir = -1; do { ivec3 neigh = Shift(dim, ivec3(dir, 0, 0)) + ivec3(X, Y, Z); if(Inside(neigh, ivec3(0), ivec3(SIZE) - 1)) if(data[neigh.x][neigh.y][neigh.z]) goto skip; { for(float i = 0; i <= 1; ++i) for(float j = 0; j <= 1; ++j) { vec3 vertex = vec3(X, Y, Z) + vec3(Shift(dim, ivec3((dir+1)/2, i, j))); positions.push_back(vertex.x); positions.push_back(vertex.y); positions.push_back(vertex.z); }
{ "domain": "codereview.stackexchange", "id": 3812, "lm_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, minecraft", "url": null }
newtonian-mechanics, forces, acceleration The position of the object as a function of time during this acceleration is the usual $$x = \frac{1}{2} a t^2 \, .$$ Your arm has only a certain length $L$ so you can only apply this force and get the object to experience that acceleration over a distance $L$. Therefore, the maximum time over which you can push the object is $$t = \sqrt{2L / a} \, .$$ The final momentum of the bowling ball is therefore $$p = F_\text{max} t = F_\text{max} \sqrt{\frac{2L}{a}} = \sqrt{2 L F_\text{max} m} \, . $$ So you see, the amount of momentum you can impart to an object goes proportional with the square root of that object's mass, the force you can exert, and the length of your arm. Newton's action-reaction law says that the force exerted by you on the ball is equal to the force exerted by the ball on you. Note, of course, that these forces are exerted over equal amounts of time, so the thing that's really equal in the end is the momentum imparted onto you and the ball (in opposite directions).
{ "domain": "physics.stackexchange", "id": 93557, "lm_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, acceleration", "url": null }
electricity, everyday-life, lightning Title: Lightning strikes the Ocean I'm swimming in - what happens? I'm swimming in the ocean and there's a thunderstorm. Lightning bolts hit ships around me. Should I get out of the water? In fresh water what makes lightening so dangerous to a swimmer is that most of the current travels on the surface of the water, so rather then getting a $1/r^2$ falloff in current density, you see a $1/r$ falloff. Obviously eventually it will be conducted down into the mass of the water, but this takes a many meters. In salt water, this should happen much quicker. I'm not sure how the conductivity of the inside of your body compares to seawater. Even if it is less, some current would still flow through you.
{ "domain": "physics.stackexchange", "id": 7886, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, everyday-life, lightning", "url": null }
ros, ros2, colcon Original comments Comment by Dirk Thomas on 2020-03-15: The option --pytest-with-coverage only affects Python packages (see colcon test --help and in which group the option is described). Comment by Dirk Thomas on 2020-03-15: How are you invoking the test in CMake? If you e.g. use ament_add_pytest_test that function doesn't have an option to enable coverage atm. It should be fairly easy to add such an option though. Comment by christophebedard on 2020-03-15: oh right, I totally overlooked "Arguments for 'python' packages." Comment by christophebedard on 2020-03-15: I'll look into adding it then. Comment by christophebedard on 2020-03-15: I am indeed using ament_add_pytest_test As noted in the comments above, it wasn't possible.
{ "domain": "robotics.stackexchange", "id": 34590, "lm_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, colcon", "url": null }
ros, boost, build-from-source, libboost Title: Compiling ROS with boost >1.41 Hello everybody. I have Ubuntu 64 bits 10.04 with kernel 2.6.32-38-generic and gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3. The problem I have is that I need to compile ROS (Electric or Fuerte) with boost 1.47, but it looks like it only works for boost 1.41 or lower. Is there any workaround? Following this tutorial , I've successfully compiled ROS Fuerte with boost 1.41. But when I try to compile ROS Fuerte with boost 1.42 (or higher, I've also tried with boost 1.44 and 1.47 and they give even more errors), and this is the output I get: ~/ros-underlay/build$ make -j [Everything goes ok up to the following point]
{ "domain": "robotics.stackexchange", "id": 9813, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, boost, build-from-source, libboost", "url": null }
bash, shell define a variable for a log file then use tee -a next next to each command, so that you get output to console and to a file at the same time. But this is tedious and not flexible. Call your script like this: /path/to/your/script.sh > backup.log (use >> to append) or: /path/to/your/script.sh | tee backup.log or better yet /path/to/your/script.sh 2>&1 | tee backup.log to capture the output of stderr. Last but not least, your script could return an exit code. This is useful if your script is going to be handled by another script or even set up as a service. Suggestions: Have the script send you the log file by E-mail after execution. Or archive the log file somewhere for later review if desired. Add error handling to make your script more reliable and more robust. If something wrong happens, or at least a fatal error, the script should stop and alert you. Here is an intro: Bash Error Handling
{ "domain": "codereview.stackexchange", "id": 38382, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bash, shell", "url": null }
classical-mechanics, potential-energy The second question is I don't know how to interpret the potential energy $U(\vec{r_2} - \vec{r_1})$ as function of $\vec{r_2} - \vec{r_1}$. For single particle's potential energy, $U(\vec{r})$ is defined to be the negation of the work from a reference point $r_0$, that is $U(\vec{r}) = -\oint_{r_0}^r \vec{F} \cdot d\vec{r}$. How to interpret the two particle potential energy in the same way? Where is the reference point? How is the integral defined? Or do we just say that work integral definition is not available in a two particle system, so that the potential energy is defined to be the function such that $\nabla_{r_1}U(\vec{r_2} - \vec{r_1}) = F_{12}$? Finally I would like some clarity on the $\nabla$ operator with subscript. In the book it is defined to be $$ \nabla_{r_1} = \frac{\partial}{\partial x_1} \hat{\vec{x}} + \frac{\partial}{\partial y_1} \hat{\vec{y}} + \frac{\partial}{\partial z_1} \hat{\vec{z}} $$
{ "domain": "physics.stackexchange", "id": 59227, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, potential-energy", "url": null }
By linearity of the determinant, we can write this as $$\det(M_n) = \det\begin{bmatrix} 2 & 3 & 4 & 5 & 6 & 7 & 7 \\ 3 & 4 & 5 & 6 & 7 & 7 & 6 \\ 4 & 5 & 6 & 7 & 7 & 6 & 5 \\ 5 & 6 & 7 & 7 & 6 & 5 & 4 \\ 6 & 7 & 7 & 6 & 5 & 4 & 3 \\ 7 & 7 & 6 & 5 & 4 & 3 & 2 \\ a_1 & a_2 & a_3 & 0 & -a_3 & -a_2 & -a_1 \end{bmatrix} + x \det\begin{bmatrix} 2 & 3 & 4 & 5 & 6 & 7 & 7 \\ 3 & 4 & 5 & 6 & 7 & 7 & 6 \\ 4 & 5 & 6 & 7 & 7 & 6 & 5 \\ 5 & 6 & 7 & 7 & 6 & 5 & 4 \\ 6 & 7 & 7 & 6 & 5 & 4 & 3 \\ 7 & 7 & 6 & 5 & 4 & 3 & 2 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 \end{bmatrix}.$$ The first determinant is $$0$$ by cofactor expansion along the last row. The cofactors of $$a_i$$ and $$-a_i$$ are equal for each $$i$$, since one submatrix can be obtained from the other by reversing the rows, then reversing the columns, so they cancel after multiplying one by $$a_i$$ and the other by $$-a_i$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9942697541641922, "lm_q1q2_score": 0.8939691813352008, "lm_q2_score": 0.899121367808974, "openwebmath_perplexity": 218.9267928013688, "openwebmath_score": 0.8820245265960693, "tags": null, "url": "https://math.stackexchange.com/questions/3180877/determinant-of-antidiagonally-constructed-matrix" }
c++, c++14, template-meta-programming , because that case (an Elements list of length 1) will be handled perfectly fine by the recursive case. Next, a style/safety note: For metaprogramming, you don't need to provide full definitions (i.e. class bodies) for your types; a declaration is usually all you need. Furthermore, providing just the declarations will prevent the user from accidentally trying to define variables of those types. So, for example, you should write template <typename T, typename U> struct list_append_impl; instead of template <typename T, typename U> struct list_append_impl {}; and so on throughout. This also means that if someone accidentally tries to refer to list_append_impl<int, int>::type, they'll get a hard compiler error implicit instantiation of undefined template 'list_append_impl<int, int>' instead of a SFINAE-friendly error no type named 'type' in 'list_append_impl<int, int>'.
{ "domain": "codereview.stackexchange", "id": 17708, "lm_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, template-meta-programming", "url": null }
mechanical-engineering, structural-engineering, metal-folding To attach the mounting brackets you will need an electric spot welder. Finally, you will need either an electrostatic spray booth to paint them or a powder coating rig.
{ "domain": "engineering.stackexchange", "id": 2921, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering, structural-engineering, metal-folding", "url": null }
ros, timestamp Title: Synchronization of 2 kinds of timestamp A node of mine publishes some messages in which their timestamps are according to a dataset read from a file (See Timestamp A below). In the node, there is another subscription of a topic from another node, which uses ROS timestamp (ros::Time::now())(See Timestamp B below). Timestamp A ----------- 678 680 683 685 Timestamp B from ROS ----------- Output 1 of ros::Time::now() Output 2 of ros::Time::now() Output 3 of ros::Time::now()
{ "domain": "robotics.stackexchange", "id": 7810, "lm_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, timestamp", "url": null }
pandas, dataframe What I want to get is the number of consecutive values in col1 and length of these consecutive values and the difference between the last element's start and first element's start: output: type length diff 0 C>T 2 1000 1 A>G 3 14000 2 C>T 3 2000 Break col1 into sub-groups of consecutive strings. Extract first and last entry per sub-group. Something like this: df = pd.DataFrame({'col1':['A>G','C>T','C>T','G>T','C>T', 'A>G','A>G','A>G'],'col2':['TCT','ACA','TCA','TCA','GCT', 'ACT','CTG','ATG'], 'start':[1000,2000,3000,4000,5000,6000,10000,20000]}) df['subgroup'] = (df['col1'] != df['col1'].shift(1)).cumsum() col1 col2 start subgroup 0 A>G TCT 1000 1 1 C>T ACA 2000 2 2 C>T TCA 3000 2 3 G>T TCA 4000 3 4 C>T GCT 5000 4 5 A>G ACT 6000 5 6 A>G CTG 10000 5 7 A>G ATG 20000 5
{ "domain": "datascience.stackexchange", "id": 4132, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pandas, dataframe", "url": null }
java, game, simulation, physics m.a = a; m.b = b; // Vector from A to B final Vec2D n = b.center.minus(a.center()); // Closest point on A to center of B Vec2D closest = n; // Calculate half extents along each axis final float x_extent = a.width() / 2; final float y_extent = a.height() / 2; // Clamp point to edges of the AABB closest = new Vec2D(clamp(closest.x, -x_extent, x_extent), clamp(closest.y, -y_extent, y_extent)); boolean inside = false;
{ "domain": "codereview.stackexchange", "id": 14778, "lm_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, game, simulation, physics", "url": null }
I agree with the answer of Mark Saving. An alternate (valid) approach would be a proof by contradiction. $$x + \frac{1}{x} < 2 ~: ~x \in \Bbb{R^+}. \tag1$$ $$(x - 1)^2 < 0. \tag2$$ Yes, you are assuming what needs to proven as you wrote "Suppose that $$x + \frac{1}{x} \geq 2$$". As an alternative proof to Mark Saving's answer, you can use AM-GM: $$\frac{\displaystyle x + \frac{1}{x}}{2} \geq \sqrt{x \cdot \frac{1}{x}} \\ \frac{x + \frac{1}{x}}{2} \geq 1 \\ \displaystyle x + \frac{1}{x} \geq 2.$$ This inequality holds for all $$x > 0$$. Therefore, $$x + \frac{1}{x} \geq 2$$ for $$x>0$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812336438724, "lm_q1q2_score": 0.8172121747749298, "lm_q2_score": 0.8438950966654772, "openwebmath_perplexity": 234.6863173192971, "openwebmath_score": 0.7910693287849426, "tags": null, "url": "https://math.stackexchange.com/questions/4367132/how-to-know-when-ive-proved-a-claim-with-example" }
c#, .net, floating-point } public BigDecimal(float num) { BigDecimal temp = new BigDecimal((decimal)num); number = temp.number; precision = temp.precision; } public BigDecimal(long num) { number = num; } public BigDecimal(ulong num) { number = num; } public BigDecimal(uint num) { number = num; } BigDecimal(byte[] num) { number = new BigInteger(num); } #endregion #region Operators //Implicit operators for simple casting from limited numeric types public static implicit operator BigDecimal(int v) { return new BigDecimal(v); } public static implicit operator BigDecimal(double v) { return new BigDecimal(v); } public static implicit operator BigDecimal(decimal v) {
{ "domain": "codereview.stackexchange", "id": 22059, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, floating-point", "url": null }
electricity, charge, speed So you see, you need to know the diameter of the cylindrical conductor. However the electrons don't move in a conductor in an orderly manner. They are constantly colliding with each other and typically have speed components along the conductor about some millimeters per second.
{ "domain": "physics.stackexchange", "id": 581, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, charge, speed", "url": null }
javascript, asynchronous, promise, async-await } You can use a getter to return the length. get length() { return this.stack.length; } Then you can then get it like this stack.length instead of this stack.length(). To me it would make more sense to use waiting_minions like a queue, so the one that has been waiting the longest gets a value first. const signal = this.waiting_minions.shift(); The return value of the executor (the function passed to a promise) is ignored. You only need to resolve (or reject) it. resolve(this.stack.pop());
{ "domain": "codereview.stackexchange", "id": 29676, "lm_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, asynchronous, promise, async-await", "url": null }
graph-algorithms, graph-colouring, scheduling, bipartite-graphs I tried to use the Hungarian algorithm $k$ times to find $k$ perfect matchings. Lets say i want to save as many blue colored edges as possible, so i give those edges in $G_2$ a high weight, i find a perfect matching to color it with blue and then i proceed to the next color. The problem with this solution is that the order of the colors that we choose may affect the outcome. I thought that maybe one can state the problem as an instance of LP (linear programming).
{ "domain": "cstheory.stackexchange", "id": 4477, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graph-algorithms, graph-colouring, scheduling, bipartite-graphs", "url": null }
quantum-mechanics, wavefunction, integration $$| \psi \rangle = \int_{-\infty}^\infty dx \ \psi(x) |x \rangle = \lim_{\Delta x \rightarrow 0} \sum_i \Delta x \psi(x_i) |x_i \rangle,$$ to draw an analogy with the discrete basis expansion $\sum_i C_i |e_i \rangle$, you need to realize that the analogy goes as $C_i \leftrightarrow \Delta x \psi(x_i)$, not $C_i \leftrightarrow \psi(x_i)$. For a better intuition, think of it this way, the continuous basis has infinitely many more basis vectors than a discrete basis, meaning that the component of any state $|\psi \rangle$ along any of these basis vectors $|x\rangle$ has to be infinitesimal for the expansion to make sense. So $\psi(x) =\langle x | \psi \rangle$ is more of a component density (for lack of a better term). This is similar to any other part of physics where densities are involved. For example, the total mass of a system of discrete point masses is: $$M = \sum_i m_i,$$ whereas for a continuous mass distribution it's
{ "domain": "physics.stackexchange", "id": 63255, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, integration", "url": null }
every finite undirected graph number of vertices with odd degree is always even. The number of expected vertices depend on the number of nodes and the edge probability as in E = p(n(n-1)/2). Homework Equations "Theorem 1 In any graph, the sum of the degrees of all vertices is equal to twice the number of edges." brightness_4 Print Binary Tree levels in sorted order | Set 3 (Tree given as array) ... given as array) 08, Mar 19. Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube. Find total number of edges in its complement graph G’. Number of edges in mirror image of Complete binary tree. $\endgroup$ – Jon Noel Jun 25 '17 at 16:53. But we could use induction on the number of edges of a graph (or number of vertices, or any other notion of size). A vertex is a corner. Maximum and minimum isolated vertices in a graph in C++, Maximum number of edges in Bipartite graph in C++, Construct a graph from given degrees of
{ "domain": "beerlak.hu", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9621075733703927, "lm_q1q2_score": 0.8252651917556326, "lm_q2_score": 0.8577681068080748, "openwebmath_perplexity": 432.9119990276175, "openwebmath_score": 0.4630250632762909, "tags": null, "url": "http://beerlak.hu/daddy-community-wxxm/how-to-find-number-of-edges-in-a-graph-fdde7d" }
mars, nasa Title: Use MOXIE on Earth I recently read about a machine called MOXIE that synthesised oxygen from carbon dioxide on Mars. I haven't been able to get the exact idea of how the thing works(though I've noticed analogies to trees). So my question is, why can't we use this machine on Earth? We know the crisis global warming is causing, and such a machine might be just what we need to tackle climate change. But I strangely see that NASA has plans to use it for astronauts only. Why? By thermodynamics, to produce O2 and C from CO2 it will require more energy than what was delivered from producing the same quantity of CO2 by burning O2 and C1. It produces oxygen at a rate that is insignificant at planetary scales.
{ "domain": "astronomy.stackexchange", "id": 5526, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mars, nasa", "url": null }
c#, linq, file-system, wpf, xaml private List<string> LoadXML(string filePath, string descendant, string element) { return XDocument.Load(filePath) .Root .Descendants(descendant) .Where(c => c.Element("type").Value == "TV") .Select(c => c.Element(element).Value) .OrderBy(v => v) .Select(DeAccentTitles) .ToList(); } private string DeAccentTitles(string title) { char[] chars = title.Normalize(NormalizationForm.FormD) .Where(c => CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark) .ToArray(); return new string(chars).Normalize(NormalizationForm.FormC); } #endregion } } ScanResults.xaml.cs using System.Collections.Generic; using System.Windows;
{ "domain": "codereview.stackexchange", "id": 18059, "lm_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, file-system, wpf, xaml", "url": null }
physical-chemistry, conductivity, carbon-allotropes, electrical-properties Changing it now... Edited to add: this of course raises the question of why it should be this way around. A somewhat hand-wavy answer is that, just like in benzene, the $p_z$ orbitals overlap within each graphene sheet so that the electron contributed by each carbon is delocalised in this plane (the other three are bound up in the three $\sigma$ bonds). So in a sense this is conjugation, but over a whole 2D plane rather than around a ring or along a single chain of atoms. On the other hand, the graphene sheets are rather further apart from one another than the covalently bonded atoms within a sheet (as you might expect since the sheets are only weakly bound through van der Waals interactions), and so the overlap is greatly reduced and conduction is much more difficult. A more complete answer would rely on a study of graphite's electronic band structure, which is an active research area and beyond the scope of this response!
{ "domain": "chemistry.stackexchange", "id": 122, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, conductivity, carbon-allotropes, electrical-properties", "url": null }
Av = λBv, where A and B are n-by-n matrices, v is a column vector of length n, and λ is a scalar. Thus, all the eigenvalues are. If you have an n×k matrix, A, and a k×m matrix, B, then you can matrix multiply them together to form an n×m matrix denoted AB. 1 The Real Case We will now prove Theorem 9. Here the columns of V are eigenvectors for Aand form an orthonormal basis for Rn; the diagonal entries of Dare the eigenvalues of A. If $$A$$ is symmetric, we know that eigenvectors from different eigenspaces will be orthogonal to each other. 1) Every skew-symmetric 2x2 matrix can be written in the form a*[0 1, -1 0] for some a (in other words this proves that the vector space of skew symmetric 2x2 matrices is generated by [0 1, -1 0]). We pick n2N[f0gsuch that char(K) = p n. Properties of real symmetric matrices I Recall that a matrix A 2Rn n is symmetric if AT = A. P =[v1v2:::vn]. The basic idea of symmetry analysis is that any basis of orbitals, displacements, rotations, etc. The matrix
{ "domain": "ionoale.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9896718477853187, "lm_q1q2_score": 0.8181733803731045, "lm_q2_score": 0.8267117855317474, "openwebmath_perplexity": 383.32462228033, "openwebmath_score": 0.8360525369644165, "tags": null, "url": "http://xtij.ionoale.it/basis-of-symmetric-matrix.html" }
programming, q# If you're looking to prepare a specific state, you might want to clarify this in the question. To address the updated question:
{ "domain": "quantumcomputing.stackexchange", "id": 1704, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "programming, q#", "url": null }
When executed you are prompted for n, then the sequence up to and including n is output to column A: It can be run up to and including n = 202 before it gives an overflow error. # [Not Competing] Pyth (14 - 4 - 4 = 6 bytes) K1u/^tG2~KGQ36 Used the first recurrence from OEIS, that after 0,1,36 you can find An = (An-1-1)2/An-2. A Not competing because this solution starts at 36, if you go lower you divide by zero (so input of 0 gives 36). Also had to hardcode 36. Try it here • This is OK as input will be nonzero. Mar 31 '21 at 20:17 # Java, 53 - 4 = 49 bytes It's another simple recursion, but I don't often get to post Java with a <50 score, so... long g(int n){return n<2?n<1?1:0:34*g(n-1)-g(n-2)+2;} Now, for something non-recursive, it gets quite a bit longer. This one is both longer (112-4=108) -and- slower, so I'm not sure why I'm posting it except to have something iterative:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639677785087, "lm_q1q2_score": 0.8053670694467869, "lm_q2_score": 0.8289387998695209, "openwebmath_perplexity": 3566.4252355304875, "openwebmath_score": 0.27517256140708923, "tags": null, "url": "https://codegolf.stackexchange.com/questions/52175/triangular-square-numbers/211664#211664" }
classical-mechanics, lagrangian-formalism, hamiltonian-formalism, variational-principle, variational-calculus It seems the get the derivatives by dividing with $\delta (p(t)), \delta (q(t))$ while ignoring the integral. How is this justified? How was the integral by parts calculated? what I get is $(p\delta q)|_{q_1,\delta q_1}^{q_2,\delta q_2}-\intop_{t_1}^{t_2}\dot{p}\delta qdt$ which is not $\dot{p}$, unless I can ignore the integral again. Latter on they say that if theres a new lagrangian $$L=L+qF(t)\tag{1.13a}$$ then $$\frac{d}{dF}I=\intop_{t_1}^{t_2}dt\frac{\partial L'}{\partial F}=\intop_{t_1}^{t_2}dtq=Q(t),$$ where $Q(t)$ is the real trajectory, cf. eq. (1.14). How is it possible that by integrating $q$ over time we get $Q(t)$? how can the answer even depend on time? shoulnd the anser be the total distance traveled? You should read up on functional derivatives.
{ "domain": "physics.stackexchange", "id": 42922, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, lagrangian-formalism, hamiltonian-formalism, variational-principle, variational-calculus", "url": null }
c, linked-list StHexNode *get(StHexNode *headNode, unsigned int index) { StHexNode *prevNode; StHexNode *currNode; uintptr_t tmp; //cur=1, prev=0 currNode = (struct StNode *) ((headNode->both) ^ 0); prevNode = headNode; for(int i=2; i<=index; i++) { tmp = (uintptr_t)prevNode; prevNode = currNode; currNode = (struct StNode *) (currNode->both ^ tmp); } return currNode; }
{ "domain": "codereview.stackexchange", "id": 39876, "lm_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, linked-list", "url": null }
c#, performance, linq, set With that in mind, I would change your implementation like so: public static IEnumerable<TSource> IntersectAll<TSource>( this IEnumerable<IEnumerable<TSource>> source) { using (var enumerator = source.GetEnumerator()) { if (!enumerator.MoveNext()) yield break; var set = new HashSet<TSource>(enumerator.Current); while (enumerator.MoveNext()) set.IntersectWith(enumerator.Current); foreach (var item in set) yield return item; } }
{ "domain": "codereview.stackexchange", "id": 9344, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, linq, set", "url": null }
electromagnetism, maxwell-equations, displacement-current $$\Phi_E= \int_S \mathbf E \cdot \hat{\mathbf n}\,\mathrm da= \int_C \frac{\sigma}{\epsilon_0} \mathrm da$$
{ "domain": "physics.stackexchange", "id": 29106, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, maxwell-equations, displacement-current", "url": null }
simons-algorithm Title: How is the factorization of the XOR operator done? I am trying to understand Simon's Algorithm now, but I am confused as to how the factorization of the XOR operator in $$\begin{aligned} \alpha_y &= \frac 1{\sqrt 2}(-1)^{r\cdot y} + (-1)^{(r \oplus s)\cdot y}\\ &=\frac 1{\sqrt 2}(-1)^{r\cdot y}(1+ (-1)^{s\cdot y})\end{aligned}$$ works. After the factorization, ${r\cdot y}$ and ${s\cdot y}$ seem to just be products of one another. $(-1)^1 = (-1)^3$, so the operation in your question is in the sense of modulo 2, hence $r\cdot y+s\cdot y=(r\oplus s)\cdot y$. Examples to show things I've said just now. $r = (1,0,1),s=(0,0,1),y=(1,1,1),$ then $r\cdot y=(1,0,1),s\cdot y=(0,0,1),(r\cdot y+s\cdot y)\text{mod2 }=(1,0,0)$ and $r\oplus s=(1,0,0),(r\oplus s)\cdot y=(1,0,0)$, easy to see $r\cdot y+s\cdot y=(r\oplus s)\cdot y$.
{ "domain": "quantumcomputing.stackexchange", "id": 2867, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "simons-algorithm", "url": null }
slices is essentially what integral calculus does. A torus has the shape of a doughnut. If the radius of its circular cross section is r, and the radius of the circle traced by the center of the cross sections is R, then the volume of the torus is V=2pi^2r^2R. A torus is a surface of revolution generated by revolving a circle in three-dimensional space about an axis coplanar with the circle.If the axis of revolution does not touch the circle, the surface has a ring shape and is called a ring torus or simply torus if the ring shape is implicit. Find its volu… Try Our College Algebra Course. 1 view The torus position is fixed, with center in the origin and the axis as axis of symmetry (or axis of revolution). INSTRUCTIONS: Choose units and enter the following: (a) - Inner radius of the torus (b) - Outer radius of the torus; Volume of a Torus (V): The calculator returns the volume (V) in cubic meters. Calculates the volume and surface area of a torus given the inner and outer radii. With
{ "domain": "phileasguides.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9539660962919971, "lm_q1q2_score": 0.8030731283598909, "lm_q2_score": 0.8418256492357358, "openwebmath_perplexity": 1056.1334699122776, "openwebmath_score": 0.861656904220581, "tags": null, "url": "http://www.phileasguides.com/woodruff-herb-ynscwvj/1e5095-volume-of-a-torus" }
quantum-mechanics, operators, potential-energy, time, hamiltonian My thoughts: In general, since wavefunctions can be dependent of time, so can $\hat{p}$ by its very definition and hence $\hat{H}$ can be time-dependent. However, I wonder if $\hat{V}$ being time-independent already yields the restriction that wavefunctions do not depend on time and hence $\hat{p}$ also doesn't. This seems like a sort of circular reasoning and I'm not sure how to continue here. Perhaps it would be helpful to take a more abstract view for a moment. A linear operator $\hat A$ on a Hilbert space $\mathcal H$ is a linear map from $\mathcal H\rightarrow \mathcal H$. If $\mathcal H=L^2(\mathbb R)$, then elements of the Hilbert space essentially consist of square-integrable functions of one real variable, which we usually interpret as the position of a particle on a line. Examples of such operators might include $\hat X$ or $\hat P$, which act on suitable vectors $f\in L^2(\mathbb R)$ to produce other vectors $$\big(\hat Xf\big)(x) = x f(x)$$
{ "domain": "physics.stackexchange", "id": 80255, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, operators, potential-energy, time, hamiltonian", "url": null }
quantum-mechanics, homework-and-exercises, hilbert-space, harmonic-oscillator Then the expression to be evaluated is $$ \langle 0|\hat q(T)\hat q(0)|0 \rangle = \langle 0|\hat q^2|0 \rangle\cos\omega T + \langle 0 | \hat p\hat q | 0\rangle \frac{\sin\omega T}{\omega}$$ The matrix elements on the RHS can be easily evaluated using expansions in terms of creation and annihilation operators (use commutation relations to obtain the second term's evaluation): $$ \langle 0 | \hat q ^2 | 0 \rangle = \frac{\hbar}{2\omega}, \quad \langle 0 | \hat p\hat q | 0\rangle = -\frac{i\hbar}{2}$$ Therefore the final expression is (setting $\hbar = 1$): $$ \langle 0|\hat q(T)\hat q(0)|0 \rangle = \frac{1}{2\omega}e^{-i\omega T}$$
{ "domain": "physics.stackexchange", "id": 49642, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, homework-and-exercises, hilbert-space, harmonic-oscillator", "url": null }
navigation, robot-localization 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0,
{ "domain": "robotics.stackexchange", "id": 23837, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, robot-localization", "url": null }
python, pandas, dataframe Title: How to change a Pandas dataframe into feature vector? I have a Pandas dataframe with 10 columns, 9 of which are features to be used to predict the 10th column. How is it ossible to convert this Pandas dataframe into X and y vectors to use in a linear regression problem? If you have your dataframe loaded as the variable df, you can simply use this X = df[['A','B','C']] y = df['Z'] where A, B and C are your independent variables and Z is your dependent variable.
{ "domain": "datascience.stackexchange", "id": 7021, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, pandas, dataframe", "url": null }
performance, c, hash-map, c99 | | 64 | switch (rem) { | | ^~~~~~ | | | | | (16) following ‘default:’ branch... |...... | 80 | hash ^= hash << 3; | | ~~~~~~~~~ | | | | | (17) ...to here | <------+ | ‘__CGL_hashtable_get_key_size_and_table_index’: event 18 | | 130 | uint32_t hash = table->hash_function(key, *key_size); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | |
{ "domain": "codereview.stackexchange", "id": 43880, "lm_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, c, hash-map, c99", "url": null }
ros, roslaunch, remote-launch, ssh, ros-indigo 'xim', 'WINDOWID': '56623108', 'GPG_AGENT_INFO': '/run/user/1000/keyring-S68IVz/gpg:0:1', 'MODULESHOME': '/usr/share/modules', 'GDMSESSION': 'ubuntu', 'SHELL': '/bin/bash', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'ROS_PACKAGE_PATH': '/home/ngcneuro/ca_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks', 'TURTLEBOT_BASE': 'kobuki', '_': '/opt/ros/indigo/bin/roslaunch', 'MODULEPATH': '/etc/environment-modules/modules:/usr/share/modules/versions:/usr/Modules/$MODULE_VERSION/modulefiles:/usr/share/modules/modulefiles', 'GTK_IM_MODULE': 'ibus', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'TURTLEBOT_BATTERY': '/sys/class/power_supply/BAT0', 'TURTLEBOT_GAZEBO_MAP_FILE': '/opt/ros/indigo/share/turtlebot_gazebo/maps/playground.yaml', 'ROS_MASTER_URI': 'http://192.168.1.103:11311', 'COLORTERM': 'gnome-terminal', '_LMFILES_': '/usr/share/modules/modulefiles/zds/zds-1.1.0.60', 'CARLSIM_CUOPTLEVEL': '3', 'MODULE_VERSION': '3.2.10',
{ "domain": "robotics.stackexchange", "id": 28114, "lm_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, roslaunch, remote-launch, ssh, ros-indigo", "url": null }
inorganic-chemistry, coordination-compounds, notation GR-7.3 Salts drawn in unspecified form In addition to the styles discussed above, an alternative style depicts the ions in structural form, but without any implied association between the ions. This is the preferred form for mixed salts where there is more than one positively charged atom or more than one negatively charged atom, and where the author wishes to treat them separately. In this style, the largest ion(s) should be enclosed in brackets, to emphasize that there is no structural association between it (them) and the other ion(s). The selection of ions to bracket is performed solely based on size, and so the bracketed ion(s) may be positively or negatively charged. The bracketed ions are placed on the left, and the other ions are placed on the right.
{ "domain": "chemistry.stackexchange", "id": 12757, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, coordination-compounds, notation", "url": null }
quantum-mechanics, special-relativity, quantum-entanglement, causality, non-locality On the other hand, quantum mechanics can display "nonlocal effects" of a different nature. Namely, there can be correlations between distant observers that cannot be explained via any kind of "shared classical correlation" (what we refer to as hidden variable theories in this context). They are "nonlocal" because measurements on a system can instantaneously affect entangled systems regardless of their spatial (or temporal, for that matter) distance. However, crucially, these nonlocal correlations are not at the level of measurement outcomes. There is no way to measure a system $B$ and be able to infer anything at all about what happened to another system $A$ outside of its light cone. There is no way to observe any effect on $B$ "caused" by anything outside of its light cone. This is also sometimes referred to as the no-communication theorem. See also Does Bell's theorem imply a causal connection between the measurement outcomes?.
{ "domain": "physics.stackexchange", "id": 91377, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, special-relativity, quantum-entanglement, causality, non-locality", "url": null }
the-sun, spectra The origins of those accelerations are usually thought to be strong magnetic interactions on the solar surface plasma, creating the famous sunspots and coronal loops. In those loops, electrons and protons are being shot into space, following the loop, and then return back onto the solar 'surface'. Upon return they release Bremsstrahlung, as the interactions between loop-particles and surface plasma create strong braking accelerations. Spectrae for such processes are derived in every standard textbook about theoretical astrophysics and are given by roughly $\frac{dP}{dt} \sim exp(-\frac{h \nu}{k_BT})$, which should fit the UV-part in the spectrum you gave pretty well. This now also explains the variability of this part of the solar spectrum: As the number of loops and sunspots correlates with solar activity, it is clear that the UV-bremsstrahlung-production should too.
{ "domain": "astronomy.stackexchange", "id": 4989, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "the-sun, spectra", "url": null }
javascript, mysql, node.js, express.js var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var exphbs = require('express-handlebars'); var expressValidator = require('express-validator'); var flash = require('connect-flash'); var session = require('express-session'); var passport = require('passport'); var LocalStrategy = require('passport-local'),Strategy; var mongo = require('mongodb'); async = require('async'); SchemaObject = require('node-schema-object'); var app = express();
{ "domain": "codereview.stackexchange", "id": 18586, "lm_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, mysql, node.js, express.js", "url": null }
• In both cases $\lim_{t\to 0} \frac{dy}{dx}=0$ yet $\frac{dy}{dx}\Big |_{t=0}$ is undefined. The question is whether in such a situation a horizontal tangent line exists. The textbook says it does, yet my professor claims that for a horizontal tangent line to exist the derivative must EXIST and be equal to zero, that is we must have $\frac{dy}{dx}\Big |_{t=0}=0$. – user239753 Apr 25 '16 at 6:53 • please read my comment again. I'm talking about the value of the derivative which does NOT exist. There is a difference between the limit (which indeed can be found with L'Hospital) and the actual value. – user239753 Apr 25 '16 at 7:28 • Note that you should not stop hunting for the L'Hospital limit if the first order evaluation fails. Do not conclude that it is undefined. At the cusp we are dealing with second orders and so limit of $f''(t)/g^{''}(t)$ should be next evaluated. – Narasimham Apr 25 '16 at 7:31
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9799765575409524, "lm_q1q2_score": 0.861543233657836, "lm_q2_score": 0.8791467785920306, "openwebmath_perplexity": 237.691814541783, "openwebmath_score": 0.8502720594406128, "tags": null, "url": "https://math.stackexchange.com/questions/1756921/horizontal-tangent-line-of-a-parametric-curve" }
To prove $\frac{g(b) - g(a)}{b-a} \leq \frac{g(c) - g(b)}{c - b}$, let $L$ be the function whose graph is a line segment connecting $(a,g(a))$ and $(c,g(c))$. Note that $\frac{L(b) - g(a)}{b-a} = \frac{g(c) - L(b)}{c - b} = \text{slope of line segment}$. Now $g(b) \leq L(b)$ gives us the desired inequality. (The left side gets smaller and the right side gets larger.) –  littleO Jun 25 '13 at 23:15
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126438601955, "lm_q1q2_score": 0.8001704836735307, "lm_q2_score": 0.8175744828610095, "openwebmath_perplexity": 84.12056270882512, "openwebmath_score": 0.9599056839942932, "tags": null, "url": "http://math.stackexchange.com/questions/427438/euclidean-metric-and-convexity/429458" }
verilog, fpga, system-verilog logic msr_clk [CLK_NUM - 1: 0]; logic [MSR_CLK_VAL_WIDTH - 1 : 0 ] msr_clk_val [CLK_NUM - 1: 0]; genvar i; generate always_comb begin msr_clk[0] = msr_clk_0; msr_clk_val_0 = msr_clk_val[0]; end if (CLK_NUM > 1) begin always_comb begin msr_clk[1] = msr_clk_1; msr_clk_val_1 = msr_clk_val[1]; end end if (CLK_NUM > 2) begin always_comb begin msr_clk[2] = msr_clk_2; msr_clk_val_2 = msr_clk_val[2]; end end if (CLK_NUM > 3) begin always_comb begin msr_clk[3] = msr_clk_3; msr_clk_val_3 = msr_clk_val[3]; end end if (CLK_NUM > 4) begin always_comb begin msr_clk[4] = msr_clk_4; msr_clk_val_4 = msr_clk_val[4]; end end
{ "domain": "codereview.stackexchange", "id": 44950, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "verilog, fpga, system-verilog", "url": null }