text
stringlengths
1
1.11k
source
dict
hash, python Title: Compute hash value according to multiplication method In "Introduction to Algorithms" by C. E. Leiserson, R. L. Rivest and C. Stein (ISBN: 978-0262033848), p. 264 they state this: I get everything but the last part stating $h(k) = 67$ >>> r = 17612864 >>> bin(r) # r's binary representation '0b1000011001100000001000000' >>> int(bin(r)[: 14 + 2], 2) # extract 14 most significant bits and convert to int 8600 You haven't extracted the 14 most significant bits. First, you have to write $r$ as a $w$-bit number: $$ 00000001000011001100000001000000 $$ Now you extract the 14 most significant bits: $$ 00000001000011 $$ Converting to decimal, this is 67.
{ "domain": "cs.stackexchange", "id": 13664, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "hash, python", "url": null }
c++, beginner, performance, algorithm, heap T old = vec[index]; vec[index] = element; swim(index); return old; } template <typename T> void DHeap<T>::maxheapify(unsigned index) { unsigned first = 0; while ((first = firstChild(index)) < vec.size()) { unsigned largest = first++; while (first <= D*(index + 1) && first < vec.size()) largest = max(largest, first++); if (cmpI(largest,index) <= 0) break; std::swap(vec[largest], vec[index]); index = largest; } } template<typename T> unsigned DHeap<T>::max(unsigned a, unsigned b) const { return cmpI(a, b) < 0 ? b : a; } template<typename T> int DHeap<T>::cmp(const T & a, const T& b) const { return Comparators::compare(a, b); } template<typename T> int DHeap<T>::cmpI(unsigned i, unsigned j) const { return cmp(vec[i], vec[j]); }
{ "domain": "codereview.stackexchange", "id": 14726, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, performance, algorithm, heap", "url": null }
ros, ros-kinetic, sound-play, debian, jessie Comment by allen on 2018-04-04: Thanks a lot! I built it from source by following your link,and I could run sound_play in Debian Jessie now. Comment by gvdhoorn on 2018-04-04: Please also report the issue with installation on Jessie on the issue tracker, as this is something that should be resolved. Probably a rosdep rule needs to be updated. Comment by allen on 2018-04-04: I have solved this problem by following gvdhoorn'link,thanks! Comment by gvdhoorn on 2018-04-04: I've re-opened your question and converted your answer into a comment as building from source is at best a work-around, not a solution. The pkg has been released into Kinetic for Jessie, so should install properly. Unavailable dependencies should have been caught earlier, or the pkg should .. Comment by gvdhoorn on 2018-04-04: .. be blacklisted for arm64 jessie. I see you've posted an issue on the audio_common tracker: ros-drivers/audio_common#106. Until that is resolved, this question should probably remain unanswered.
{ "domain": "robotics.stackexchange", "id": 30528, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, sound-play, debian, jessie", "url": null }
biochemistry, ecosystem Title: How can sodium and potassium from burned organic matter (ashes) reenter the ecosystem? If you thoroughly burn something you end up with bunch of oxides and hydroxides, as far as I know. Sodium and potassium hydroxides are plentiful in ashes, which is why lye was created by soaking ashes in water. Lye is not exactly nice to organisms. So the question is, how can caustic lye ever reenter the ecosystem as potassium. If it cannot, does that mean that nature cannot renew it's potassium content? Wood ash is commonly used as a fertilizer. It acts this way in natural burning ecosystems also, where the ash from burned plants fertilizes the growth of new plants and those that survive the wildfires. The primary constituents of wood ash are calcium and potassium salts. Lye is extracted from these salts by extracting them in water; the hydroxide salts are more soluble so the other salts are left in lower concentration than the original ash.
{ "domain": "biology.stackexchange", "id": 9511, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry, ecosystem", "url": null }
representation-theory, lie-algebra, calculus, poincare-symmetry, matrix-elements \end{gather}$$ ($(Eq .1)\ \Leftrightarrow\ \mathbf{\Lambda}= \mathbf{Id}_4 + \omega^{\mu}{}_{\nu}\, \mathbf{E}_{\mu}{}^{\nu} = \mathbf{Id}_4 + \omega^{\mu\nu}\, \eta_{\nu\rho} \mathbf{E}_{\mu}{}^{\rho} = \mathbf{Id}_4 + \frac{1}{2}\omega^{\mu\nu}\, \mathbf{J}_{\mu\nu}$ $\ \Rightarrow\ \mathbf{J}_{\mu\nu} = \eta_{\nu\rho} \mathbf{E}_{\mu}{}^{\rho} - \eta_{\mu\rho} \mathbf{E}_{\nu}{}^{\rho} $ with $\mathbf{E}_{\alpha}{}^{\beta}$ the $4\times 4$ matrix with $1$ on line $\alpha$, column $\beta$ and $0$ elsewhere.) I also double checked these relations because they depend on conventions (Calculate using the inclusion $\mathcal{P}\subset GL_5(\mathbb{R})$)! These are associated to the following parametrization $$\mathbf{R}_{z}(\epsilon) = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & \cos \epsilon & - \sin \epsilon & 0\\ 0 & \sin \epsilon & \cos \epsilon & 0\\ 0 & 0 & 0 & 1 \end{pmatrix}$$ $$ \mathbf{\Lambda}_x \Big(\epsilon =\beta = \frac{v}{c}\Big) = \begin{pmatrix}
{ "domain": "physics.stackexchange", "id": 40549, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "representation-theory, lie-algebra, calculus, poincare-symmetry, matrix-elements", "url": null }
statistical-mechanics, lattice-model, algebraic-topology $$ \Psi(x_1, \ldots, x_N) = \sum_{\mathcal{S}}\theta(x_{i_1} \leq x_{i_2} \leq x_{i_3} \leq \ldots \leq x_{i_N}) F_S(x_1, \ldots, x_N) $$ and $S$ runs over the $N!$ permutations of the particles. Here, the $\theta$ function is a short-hand for multiplication of successive $\theta$ functions ensuring that in this sector $x_{i_j} \leq x_{i_{j+1}}$ for the specific permutation. The Schrödinger equation now tells us how different sectors are related to each other. When we exchange the place of two particles, that is going from a sector where $x_3 \leq x_4$ to the sector where $x_4 \leq x_3$, the particles interact (this is the case when the interaction is short-ranged between pairs of particles). So we can relate $F_S$ to $F_{S'}$ if they differ by exchanging of two particles, by solving the Schrödinger equation.
{ "domain": "physics.stackexchange", "id": 66790, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, lattice-model, algebraic-topology", "url": null }
quantum-state, entanglement, nielsen-and-chuang, teleportation, superdense-coding However, if you want to identify which bits Alice and Bob each have, we often use a notation like $$ (|0\rangle_A|0\rangle_B+|1\rangle_A|1\rangle_B)/\sqrt{2} $$ which helps to emphasise which ket corresponds to the qubits being held by each party.
{ "domain": "quantumcomputing.stackexchange", "id": 1420, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-state, entanglement, nielsen-and-chuang, teleportation, superdense-coding", "url": null }
gazebo Originally posted by DimitriProsser with karma: 11163 on 2012-02-27 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by jfetsch on 2012-02-27: Thank you, that's what I was afraid of. At least I know what the problem is though Comment by hsu on 2012-02-27: I wonder if this is related, can some one test it out by disabling sync to vblank? thanks. http://www.preshweb.co.uk/2011/05/ubuntu-11-04-x-freezing-after-screensaver-active-laptop-lid-closed/
{ "domain": "robotics.stackexchange", "id": 8292, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo", "url": null }
homework-and-exercises, thermodynamics Title: How this equation is attained of change of cross sectional area as thermal expansion occurs? I've may been asking the very easy question. The conductor of cylinder shape exists with the following parameters. $\alpha:=$linear coefficient of thermal expansion of the conductor. $l_i:=$length of the conductor as $i$ th state. $S_i:=$cross sectional area of the conductor as $i$ th state. $t_i:=$temperature as $i$ th state. $i\in \{1,2\}$ Assumed that $1$st state is pre and $2$nd state is post. $l_2=l_1\{1+\alpha(t_2-t_1)\}$ The problem is below equation. $S_2=S_1*\{1+\alpha(t_2-t_1)\}^{2}$ I've googled to find out the formula of it but I've been unable to find it. How this equation is attained? Can anyone tell me some hint(s) or the website which describes it? so that I can deduce it in my own. The cylinder has the same coefficient of expansion in all directions, so if the length increases by a factor of $1+\alpha(t_2-t_1)$, the area will increase by that factor squared.
{ "domain": "physics.stackexchange", "id": 76988, "lm_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", "url": null }
python, python-3.x, game from pathlib import Path from random import randint import os import time # this code is divided into the following parts: # helpful functions # the actual parts of the program (classes, functions) # the starting part ### helpful functions def saveIntInput(string): try: number = int(input(string)) return number except ValueError: print("Please enter a number.") return 0 ### parts of the program
{ "domain": "codereview.stackexchange", "id": 28807, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, game", "url": null }
machine-learning, deep-learning Does this mean that the Time per inference step is the average time it takes the model to make predictions for each batch of 32 samples as opposed to just one sample? Thanks in advance! Yes, your interpretation is correct, it's also stressed out in the documentation: "Time per inference step is the average of 30 batches and 10 repetitions.". Be aware that the relation between batch size and inference time is not linear, so you can't halve of double the time reported on that table to estimate inference time for different batch size. And it's also very specific to the GPU used, so variations with different hardware must be expected. Also, the table in keras documentation refers to the first definition of inference time you linked, which is more precise but less useful for real use cases. So if timing is crucial for you be sure to time also every preprocessing and post processing step that you're applying to your images and predictions.
{ "domain": "ai.stackexchange", "id": 3519, "lm_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, deep-learning", "url": null }
javascript, random // Declare game engine variables let interval, imageNumber; let isSameNumber = 10; ... // Loop with time intervals interval = setInterval(function () { // Genarate image number imageNumber = Math.trunc(Math.random() * 10); if (imageNumber !== isSameNumber) { // Show image with the generated number animalEl.src = `animal-${imageNumber}.jpg`; isSameNumber = imageNumber; } else { imageNumber = Math.trunc(Math.random() * 10); animalEl.src = `animal-${imageNumber}.jpg`; isSameNumber = imageNumber; } }, 500); Here's my complete JS code. If anyone's interested in checking it and telling me which parts I can clean-up and optimize, I'd really appreciate it. Thanks in advance: "use strict";
{ "domain": "codereview.stackexchange", "id": 40957, "lm_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, random", "url": null }
python, file, classes file = open(self.varFileLocation, "rt") self.varFileText = file.read() file.close() self.SplitLines() def writeVarFile(self, file_location=''): file = None if(file_location != ''):# if file_location parameter was provided file = open(file_location, "wt") else:# if file_location parameter was NOT provided file = open(self.varFileLocation, "wt") file.read(self.varFileText) file.close() def getVarFileText(self):# also regenerates 'varFileText' from the list 'varFileLines' self.varFileText = '' for var_line in self.varFileLines: self.varFileText += var_line + '\n' return self.varFileText def getVarParts(self, var_line_text): if('=' not in var_line_text and ':' not in var_line_text and '\t' not in var_line_text): #check variable line if may not be properly formated
{ "domain": "codereview.stackexchange", "id": 43826, "lm_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, file, classes", "url": null }
a polynomial means to rewrite the polynomial has been factored. Polynomial as a template to create and solve your own problems these as cube. Gcf ) between monomials, take each monomial and multiply those common factors together we need to our! Can factorize each of the following situations the GCF of difficult numbers factors together 3x 2 + -. Formula, we can factor by grouping are used to find the GCF of difficult numbers 19 x 8 partners..., click the blue arrow, and thus can not factor ) ( x+1 ) it is equal zero. Of terms from the expression see if it fits one of them out... Other methods are used to find the Greatest common factor, difference squares... - 36 2x 2 - 28x + 98 factor a difference of squares before factoring a difference of and. Same by factoring -1 from one of them 4 8 x 3 + x. A demonstration equation, first write it as a product of its factors use a special formula ) 6x!, factorization or factoring is the breaking apart of a polynomial means rewrite... Factor an
{ "domain": "marbellaphysio.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9585377296574668, "lm_q1q2_score": 0.8222030971575834, "lm_q2_score": 0.8577681104440172, "openwebmath_perplexity": 703.8171294881439, "openwebmath_score": 0.5673994421958923, "tags": null, "url": "http://marbellaphysio.com/danielle-svetcov-rebb/ee0fsjj.php?id=factor-each-of-the-following-cubic-expressions-completely-8d0ba4" }
gazebo, simulation, urdf, simulator-gazebo, base-controller <!-- --> <!-- base and caster for wheel --> <!-- --> <xacro:macro name="wheel_base" params="prefix suffix reflect_x reflect_y *rev_joint"> <link name="${prefix}_${suffix}_wheel_base1"> <visual> <geometry> <box size="${wheel_base1_length} ${wheel_base1_width} ${wheel_base1_height}"/> </geometry> <material name="Blue"/> <origin xyz="0 0 ${-wheel_base1_height/2}" rpy="0 0 0"/> </visual> <collision> <geometry> <box size="${wheel_base1_length} ${wheel_base1_width} ${wheel_base1_height}"/> </geometry> <material name="Blue"/> <origin xyz="0 0 ${-wheel_base1_height/2}" rpy="0 0 0"/> </collision> <xacro:default_inertial mass="1"/> </link>
{ "domain": "robotics.stackexchange", "id": 7646, "lm_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, simulation, urdf, simulator-gazebo, base-controller", "url": null }
c#, wpf, active-directory principal.GetHomePhone(), [DirectReportInitials] = () => result.DirectReportInitials = principal.GetInitials(), [DirectReportIsAccountLockedOut] = () => result.DirectReportIsAccountLockedOut = principal.IsAccountLockedOut(), [DirectReportIsActive] = () => result.DirectReportIsActive = principal.IsActive(), [DirectReportLastBadPasswordAttempt] = () => result.DirectReportLastBadPasswordAttempt = principal.LastBadPasswordAttempt, [DirectReportLastLogon] = () => result.DirectReportLastLogon = principal.LastLogon, [DirectReportLastPasswordSet] = () => result.DirectReportLastPasswordSet = principal.LastPasswordSet,
{ "domain": "codereview.stackexchange", "id": 20538, "lm_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#, wpf, active-directory", "url": null }
ros, arduino, rviz, ros-melodic, qt Specifications: ROS Melodic Ubuntu 18.04 Jetson Xavier AGX Arduino Due Issue When I boot up the robot computer, every node except for rviz working as I intended. Note that I already tested the roslaunch before implementing the robot_upstart and the rviz node CAN work with the lidar. It can display live update from lidar reading. I used multiple steps and tutorial to implement robot_upstart in the robot computer. First, I follow the step from this tutorial https://roboticsbackend.com/make-ros-launch-start-on-boot-with-robot_upstart/ . I used this command to install my roslaunch to become: rosrun robot_upstart install agv_slam/launch/agv_main.launch --job agv_uia --symlink
{ "domain": "robotics.stackexchange", "id": 37776, "lm_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, arduino, rviz, ros-melodic, qt", "url": null }
histology Wikipedia contributors, "Mesothelium," Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/w/index.php?title=Mesothelium&oldid=598055771 (accessed June 26, 2014). Wikipedia contributors, "Gastrointestinal wall," Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/w/index.php?title=Gastrointestinal_wall&oldid=598338180 (accessed June 26, 2014). Wikipedia contributors, "Trachea," Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/w/index.php?title=Trachea&oldid=613017631 (accessed June 26, 2014).
{ "domain": "biology.stackexchange", "id": 2112, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "histology", "url": null }
reliability functions, including the reliability function, the failure rate function… The PDF for the exponential has the familiar shape shown below. Definitions Probability density function. [/math] duration, having already successfully accumulated [math]T\,\! Basic Example 1. Functions. The Exponential distribution "shape" The Exponential CDF The mean time to failure (MTTF = θ, for this case) … The exponential distribution is often used to model the reliability of electronic systems, which do not typically experience wearout type failures. If the above formula holds true for all x greater than or equal to zero, then x is an exponential distribution. ( θ ) = 1/λ for a mission of [ math ] t\, \ having already accumulated. Start of this new mission, then X is an exponential distribution only, as is... T\, \ Definitions Probability density function is calculated by multiplying the exponential CDF the failure.! Exp ( λ ) ( θ ) = 1/λ, and, for repairable equipment MTBF. For t > 0, where λ
{ "domain": "eceaus.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806523850542, "lm_q1q2_score": 0.8411108062036201, "lm_q2_score": 0.8577681031721325, "openwebmath_perplexity": 1009.4663862837542, "openwebmath_score": 0.748268187046051, "tags": null, "url": "https://eceaus.org/wddch/w8s2p.php?3a379d=exponential-reliability-function" }
ros-kinetic Originally posted by gvdhoorn with karma: 86574 on 2018-02-10 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by Mehdi. on 2021-05-11: "The extension does not require additional configuration" is the biggest lie ever! Comment by gvdhoorn on 2021-05-11: Thanks for the feedback. It would be more valuable if you could give your feedback to Microsoft, on their issue tracker. Your comment here will most likely not be read by many people. Comment by Mehdi. on 2021-05-11: As Samarth mentioned in his answer, this blog post really helps getting it setup correctly.
{ "domain": "robotics.stackexchange", "id": 38832, "lm_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 }
ubuntu-precise, ubuntu, ros-electric Title: Electric running under Ubuntu 12.04 (Precise Pangolin) LTS Hello everyone, it is possible to run ROS-Electric on a Machine installed with Ubuntu Precise 12.04 LTS. Trying to install Electric on Ubuntu 12.04 (Precise): sudo apt-get install ros-electric-desktop-full Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package ros-electric-desktop-full Update: Electric Emys (Aug 2011): Ubuntu Lucid Ubuntu Maverick Ubuntu Natty Ubuntu Oneiric C++03 Boost 1.40 Lisp SBCL 1.0.x Python 2.6 So I any case, it will not be reliable to run Electric on a Machine wit Ubuntu Precise (12.04)**.
{ "domain": "robotics.stackexchange", "id": 10053, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ubuntu-precise, ubuntu, ros-electric", "url": null }
c. We examine the number of trees in the root list $t(H)$ and the number of marked nodes $m(H)$ of the resulting Fibonacci heap $H'$ to upper-bound its potential. The number of trees $t(H)$ increases by the number of children $x$ had ($=x.degree$), due to line 7 of $\text{PISANO-DELETE}(H, x)$. The number of marked nodes in $H'$ is calculated as follows. The first $c - 1$ recursive calls out of the $c$ calls to $\text{CASCADING-CUT}$ unmarks a marked node (line 4 of $\text{CUT}$ invoked by line 5 of $\text{CASCADING-CUT}$). The final $c$th call to $\text{CASCADING-CUT}$ marks an unmarked node (line 4 of $\text{CASCADING-CUT}$), and therefore, the total change in marked nodes is $-(c - 1) + 1 = -c + 2$. Therefore, the potential of H' is $$\Phi(H') \le t(H) + x.degree + 2(m(H) - c + 2).$$ d. The asymptotic time is $$\Theta(x.degree) = \Theta(\lg(n)),$$ which is the same asyptotic time that was required for the original deletion method.
{ "domain": "walkccc.me", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808695883037, "lm_q1q2_score": 0.8168921629995515, "lm_q2_score": 0.8333245994514084, "openwebmath_perplexity": 366.37224372023377, "openwebmath_score": 0.5988635420799255, "tags": null, "url": "https://walkccc.me/CLRS/Chap19/Problems/19-1/" }
javascript secondly, you could make it more generic, by adding the property you want to check to the arguments of the function. Something like: function areDifferentByProperty(a, b, prop) { var idsA = a.map( function(x){ return x[prop]; } ).unique(); var idsB = b.map( function(x){ return x[prop]; } ).unique(); var idsAB = a.concat(b).unique(); return idsAB.length!==idsA.length } thirdly, I would much rather name it areEqualBy___. Seems more intuitive to me, but that's just me.
{ "domain": "codereview.stackexchange", "id": 14041, "lm_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", "url": null }
c#, linq, xml ////Creates new file using last game played. XDeclaration _obj = new XDeclaration("1.0", "utf-8", ""); XNamespace gameSaves = "gameSaves"; XElement fileNew = new XElement("Root", new XElement("Player", new XElement("playerName", playerName), new XElement("Stats", new XElement("playerWin", (int)winTemp + playerWin), new XElement("playerLoss", (int)lossTemp + playerLoss), new XElement("playerTie", (int)tieTemp + playerTie)))); file.Save(path); }
{ "domain": "codereview.stackexchange", "id": 11226, "lm_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, xml", "url": null }
c++, parsing, interpreter Each file has the .qz extension, and is basically like a text file. The over-view of how my interpreter works is: It first opens a .qz, and then checks if the file was opened successfully. After ensuring that the files has been opened properly, the file contents is then read into a string. The string is then feed to a lexer that checks for the tokens. The lexer use a for-loop to iterate over the string, and adds any tokens it finds to a vector. The lexer then returns the vector to be read by the parser. The parser uses a while loop to iterate over the vector, and calls the correct code if a keyword/keywords is found. main.cpp #include<iostream> using std::cout; using std::cerr; using std::endl; #include<fstream> using std::ifstream; using std::fstream; #include<string> using std::string; using std::getline; #include<vector> using std::vector;
{ "domain": "codereview.stackexchange", "id": 21450, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, parsing, interpreter", "url": null }
navigation, move-base Title: move_base crashes Hey all, I am running: Ubuntu 12.10 64 Bit with ROS Hydra installed using apt. I was following the navigation tutorial to get move_base running. But after publishing the first topics to it it crashes. I checked all topics in rviz and everything looks ok. My map is really small: Resizing costmap to 544 X 608 at 0.050000 m/pix But I also tried higher and lower resolution maps. GDB gives me the following error: [ WARN] [1386781814.297755287]: Trajectory Rollout planner initialized with param meter_scoring not set. Set it to true to make your settins robust against changes of costmap resolution. Program received signal SIGILL, Illegal instruction. 0x00007ffff2ad3d3f in std::vector<double, std::allocator<double> >::_M_insert_aux(__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double const&) () from /usr/lib/libpcl_common.so.1.7
{ "domain": "robotics.stackexchange", "id": 16420, "lm_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, move-base", "url": null }
quantum-mechanics, atoms, spectroscopy, atomic-physics, molecules Title: Difference between photo electron spectrum and photoelectron angular distribution I am trying to learn the Photoelectron velocity map imaging. While I was going through the article "Chem. Soc. Rev., 2009,38,2169-2177", it is said that the "photoelectron spectrum reflects the energy eigenvalues of the parent atomic or molecular system, while the phtoelectron angular distributions reveal the characteristics of the corresponding wave functions" (in the page 2170 of the said reference). I didn't understand what it is mean by the statement "photoelectron angular distributions reveal the characteristics of the corresponding wave function"!. Can anybody please explain me this? You know how the shape of atomic orbitals (s, p, d) depends on the angular momentum of the electron. This momentum can be preserved in photoelectrons, and from the shape of the electronic cloud hitting the detector you can determine not only the energy, but also the angular momentum of the electron.
{ "domain": "physics.stackexchange", "id": 8983, "lm_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, atoms, spectroscopy, atomic-physics, molecules", "url": null }
quantum-mechanics, particle-physics, operators, charge-conjugation I am struggling to relate this to the statement in bold. Operating twice with the charge conjugation operator, $\cal C$, on a physical state must bring you back to the original state, i.e. ${\cal C}^2 = I$. This means that the eigenvalues of $\cal C$ are $\pm 1$, and so ${\cal C} | p \rangle = \pm | p \rangle$. As a consequence the particle state $| p \rangle$ and ${\cal C} | p \rangle$ can differ by at most a sign. The only candidates for such states are particles which are their own antiparticles, and as your statement says, most particles in nature are not of this type. Probably the most common example is the photon, and there are other examples like charge-neutral mesons like the $\pi^0$. But everyday particles like electrons, protons, and neutrons are not eigenstates of $\cal C$.
{ "domain": "physics.stackexchange", "id": 64650, "lm_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, particle-physics, operators, charge-conjugation", "url": null }
evolution, life, death there is often not a "reason" for why certain things are the way they are. Evolution is not a conscious "designer" that produces things with a specific goal in mind...it simply "picks" the best random alteration and enhances it. If there is no "best mutation", then there is no selection pressure to drive change overtime.
{ "domain": "biology.stackexchange", "id": 12206, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, life, death", "url": null }
javascript, jquery, html, dom And the original HTML is: /* ORIGINAL HTML */ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div id='test'> <p>text</p> <p>&nbsp;</p> <p>text</p> <p><span>text</span></p> <p><span></span></p> <p>text</p> <p><strong>text</strong></p> <p></p> <p>&nbsp;</p> <p>text</p> <p><span><strong>&nbsp;</strong></span></p> <p><span><strong>text</strong></span></p> <p>&nbsp;</p> <p><span>text</span></p> <p></p> <p><span></span></p> <p><span>&nbsp;</span></p> <p><span><strong></strong></span></p> <p>text</p> </div>
{ "domain": "codereview.stackexchange", "id": 33120, "lm_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, dom", "url": null }
comparative-review, swift, ios, cocoa As you can see there is quite a bit of duplicating code. And I can't extract away the UIContextualAction declaration part because of it's completion handler. Selecting the object to be deleted happens in there. I also can't define UISwipeActionsConfiguration as a local variable and reduce its duplicating due to that class must be initialized with UIContextualAction instances. Note: You have to pass an empty actions array to UISwipeActionsConfiguration in order to not show the swipe actions in cell. Returning nil doesn't do it. So all this has produced an ugly piece of code. I'm wondering if there's a better way to refactor this. Alternative Approach Instead of checking for segment first and then adding multiple delete actions, I put the checking for segment part inside one completion handler like this. func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { var actions = [UIContextualAction]()
{ "domain": "codereview.stackexchange", "id": 35476, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "comparative-review, swift, ios, cocoa", "url": null }
multithreading, clojure if io bound: (map #(future (%)) tasks). Clojure futures implement exactly the functionality that you describe. if cpu bound: (pmap #(%) tasks) Have a look at the Claypoole library for some inspiration. Nice work!
{ "domain": "codereview.stackexchange", "id": 19358, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "multithreading, clojure", "url": null }
python pass #Reconstruct the array to use sets for items in set_of_pk_values: for key in set(items.keys()) - x_keys_2: getterSet_2 = itemgetter(key) if(not isinstance(items[key], set) and str(key).count('.') != 2): items[key] = set([items[key]]) #This part we combine stages that has the same predecessors (RCXT MAXC and RCXT MAXCL) for idx, val in enumerate(set_of_pk_values): if(idx not in skipList): for idx_2, val_2 in enumerate(set_of_pk_values): if(idx != idx_2 and idx_2 not in skipList): if (getter(val) == getter(val_2) and (getter(val) != set([]) or getter(val_2) != set([]))): for key in set(val_2.keys()) - x_keys: getter_3 = itemgetter(key) if(key != "setid" and key != "setid_hash"): val[key] = getter_3(val_2)
{ "domain": "codereview.stackexchange", "id": 12644, "lm_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", "url": null }
intermolecular-forces, atomic-radius Because diatomic and polyatomic molecules are polarizable, the bonded fluorine atoms will likely be slightly polarized when packed in the crystal in order to stabilize (lower the energy) the overall system. This polarization will cause non-bonded fluorines to draw a bit closer to each other then they would if there were no polarization. A crystal of a noble gas (let's say neon) will just be a collection of monatomic neon atoms, no bonds, no polarization. Therefor there is no "attractive" force to draw adjacent neon atoms closer together like there was in the case of fluorine. So even before we make our measurements we might expect the van der Waals radius for neon to be larger than that for fluorine, which turns out to be the case.
{ "domain": "chemistry.stackexchange", "id": 1514, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "intermolecular-forces, atomic-radius", "url": null }
organic-chemistry, stereochemistry When we add from the si face, we get an (R) center, and if we add from the re face, it's the other way around (as it should be!) and we have (S) configuration. Now, what if we reduce "normal" acetaldehyde? We then have to decide which of the proton substituents gets the higher priority when trying to assign pro-R or pro-S. If you decide that the added proton has higher priority (as you did in your question) then you get an equivalent of a pairwise exchange of the substituents (in comparison to the structures that I drew), and the stereocenter is exactly the opposite of what I drew in the figure above. From a synthetic point of view it is much cheaper to use hydrogen gas for the reduction and have the isotope label already reside on the starting material.
{ "domain": "chemistry.stackexchange", "id": 2085, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, stereochemistry", "url": null }
soft-question Now, (4) is essentially unheard of these days, so you can more or less forget that. Of the rest, what is feasible will depend on a number of factors, but the impact of your research is going to play a big role in your success in applying for either (2) or (3). I presume, since you are only looking at what to apply for now, that you haven't finished the PhD yet, and have something on the order of six months to a year left (do correct me if I'm wrong). With this in mind, it seems quite possible that you'll have more than one publication by the end of the PhD. If this is possible, you should put in the effort to write up results. If you get 3 or 4 papers (preprints definitely count, so make sure you are using the arxiv and including them on your CV), this will substantially alter your odds of getting a postdoc from someone you haven't previously worked with.
{ "domain": "physics.stackexchange", "id": 3347, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "soft-question", "url": null }
fl.formal-languages, regular-language, context-free Q1. I understand it also to be undecidable whether an arbitrary CFG is ambiguous, in the sense of point 3 above. Or is it rather that it's undecidable whether a context-free language is ambiguous, in the sense of point 4? Or are both undecidable? Q2. Which of points 1-4 become false when we replace "context-free" with "regular"? Are regular grammars and languages always unambiguous? About Q1: Both the ambiguity problem (given a CFG, whether it is ambiguous) and the inherent ambiguity problem (given a CFG, whether its language is inherently ambiguous, i.e. whether any equivalent CFG is ambiguous) are undecidable. Here are the original references: The undecidability of ambiguity was proved by Cantor (1962), Floyd (1962), and Chomsky and Schützenberger (1963). The proofs in textbooks typically reduce from the Post Correspondence Problem. The undecidability of inherent ambiguity was proved by Ginsburg and Ullian (1966).
{ "domain": "cstheory.stackexchange", "id": 2316, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fl.formal-languages, regular-language, context-free", "url": null }
ros, ros-melodic, catkin, build If packages are being built "in isolation" I would expect the same thing to happen each time I run catkin build since the build order should be irrelevant? Clearly I am mistaken in this understanding so my question is: What does packages being built "in isolation" mean? How is catkin build different to catkin_make ? Is there some way to build my packages that is determinstic/repeatable? So that I can have confidence that if it builds on one machine, it'll build on another? even if I run catkin build --force-cmake && catkin clean I get inconsistent results.
{ "domain": "robotics.stackexchange", "id": 36427, "lm_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, catkin, build", "url": null }
cosmology, big-bang, distance Title: How exactly is conformal time, $\eta$, calculated? As I understand it, Conformal Time is basically the comoving distance divided by the speed of light. $$\eta=\int_0^t\frac {dt'}{a(t')}$$ I can make the connection between the scale factor and redshift:$$\frac {1}{a}=(z+1)$$but this is where I'm stuck. I want to perform the actual integration and get a concrete value for the conformal time as a function of cosmological time (e.g. $f(t) = \eta$), but I can't find a formula relating t to the scale factor or redshift. Could someone show me step by step the derivation of the formula? I am not sure this is what you want but I want to give it a try, $$\eta=\int \frac {dt} {a}=\int\frac {da} {a\dot{a}}=\int\frac {da} {a^2H}$$ and we can write $$H(z)=H_0E(z)$$ $$E(z)=\sqrt{\Omega_{\Lambda}+\Omega_m(1+z)^3+\Omega_r(1+z)^4+\Omega_{\kappa}(1+z)^2}$$ so we have, $$\eta=\int\frac {da} {a^2H_0E(z)}$$ and $dz=-da/a^2$ so we can write, $$\eta=-H_0^{-1}\int\frac {dz} {E(z)}$$
{ "domain": "physics.stackexchange", "id": 55080, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, big-bang, distance", "url": null }
energy, mass, mass-energy, earth, geophysics Here's the contents of Möller's table. region distance mean T density matter heat (km) °C $g/cm^3$ (J) crust 0-30* 350 3.5 rocks $2×10^{22}$ outer mantle 30-300 2000 4 rocks $5.6×10^{28}$ inner mantle 300-2890 3000 5 rocks $2.2×10^{30}$ outer core 2890-5150 5000 8 Fe-Ni $1.5×10^{31}$ inner core 5150-6371 6000 8.5 Fe $3.6×10^{30}$ Continental crust, oceanic crust is 5-10 km depth. It's surprisingly difficult to find this geothermal energy data. Wikipedia gives a figure of $10^{31}$ J for the internal heat content of the Earth, linking to a report which quotes a figure of $12.6×10^{24}$ MJ from What is Geothermal Energy by Dickson & Fanelli (2004), but that article gives no details for the calculation.
{ "domain": "physics.stackexchange", "id": 80859, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "energy, mass, mass-energy, earth, geophysics", "url": null }
algorithms, algorithm-analysis, sorting $A[k] \geq x$ for all $k \geq j$, and $A[k] \leq x$ for all $k \leq i$. If the loop ever terminates, then the two ranges "$k \geq j$" and "$k \leq i$" cover the entire array, and in particular, $A[k] \leq x$ for all $k \leq j$, and $A[k] \geq x$ for all $k \geq i \geq j$. In particular, if $k \leq j$ and $\ell > j$ then $A[k] \leq A[\ell]$. This is what PARTITION promises: If PARTITION$(A,p,r)$ returns $q$, then $x \leq y$ for all $x \in A[p],\ldots,A[q]$ and $y \in A[q+1],\ldots,A[r]$.
{ "domain": "cs.stackexchange", "id": 14492, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, algorithm-analysis, sorting", "url": null }
electromagnetic-radiation, maxwell-equations Title: Does $E$ cause $B$ or does $B$ cause $E$ in Maxwell's equations? From the Maxwell's equations we get $$\frac{\partial E}{\partial x} = -\frac{\partial B}{\partial t}$$ and $$\frac{\partial B}{\partial x} = -\mu_0\epsilon_0\frac{\partial E}{\partial t}$$ My question is: A change in the electric field causes a change in the magnetic field, while a change in magnetic field is causing a change in electric field. Is this situation not similar to sitting inside a bucket and lifting yourself up? That's right, electric fields can cause magnetic fields and vice-versa. This is what allows electromagnetic waves (light, radio, etc.) to travel through empty space. Shine a laser pointer into the sky, and the light from it can travel through space for a billion years. The electric field of the light will be a source for the magnetic field, and the magnetic field of the light will be a source for the electric field -- on and on it goes through the vacuum of space.
{ "domain": "physics.stackexchange", "id": 8971, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-radiation, maxwell-equations", "url": null }
electrostatics Your second diagram is incorrect. No electric field originates in the box to influence your charge. According to Gauss' law the net outward flux across a closed surface equals the total charge enclosed by the surface divided by the electrical permittivity of the space. Your figure shows no charge enclosed in the second box. All field lines entering the second box exit it as well so that there is no net outward flux across the surfaces of the box. You may be learning more about Gauss' law later. One more thing about electric field lines. They are a useful drawing tool to provide information about both the direction of the electric field in space and the relative strength of the field. The arrows indicate the direction. The relative density of the lines in a particular region of space is an indicator of the relative strength of the field. In actuality the electric field exists everywhere in the space between the lines shown in the diagram. Hope this helps.
{ "domain": "physics.stackexchange", "id": 59238, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics", "url": null }
fl.formal-languages, finite Any concatenation gives a new string. For a lower bound, I can suggest the following unary language: $ U = \{a,aa,aaa,\ldots,a^k \mid k \geq 1 \} $. Then, $ U^i = \{ a^i,a^{i+1},\ldots,a^{ki} \} $ and so $ |U^i| = i|U|-i+1 $. Emil's (Jerabek) comment appeared during writing my answer and so before posting my answer.
{ "domain": "cstheory.stackexchange", "id": 2861, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fl.formal-languages, finite", "url": null }
visualized of the functions are the sine! Exponential function and its absolute value, Logarithmic, and trigonometric functions, exponential such... Of a number x $, continued 5 youmay have seen that there are two notations popularly used for logarithms., is often simplified by applying properties of these functions, visit the exponential with base is..., relations with trigonometric and hyperbolic functions, visit exponential logarithmic and trigonometric functions exponential with base, often. Also be visualized by looking at the real and imaginary part of the exponential functions, bacterial... Exponent of 2 in the number e raised to the power z function are two special functions ’ implies ‘! – the exponent of 2 in the inverse function ) 9×3 x is... Their names suggest both exponential function and its absolute value other combinations of the one found in HMC Mathematics tutorial... To the power z of$ \sin x \$, continued 5 your body at any given moment your!, exponential functions,
{ "domain": "vetozonetraining.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969670030071, "lm_q1q2_score": 0.8340585076986734, "lm_q2_score": 0.8479677506936878, "openwebmath_perplexity": 726.0275418185996, "openwebmath_score": 0.7371492981910706, "tags": null, "url": "http://vetozonetraining.com/movies-like-dwhbcb/exponential-logarithmic-and-trigonometric-functions-3da661" }
quantum-mechanics, wavefunction, potential, schroedinger-equation, fourier-transform $$ \Psi_0 \propto \psi_{3,1}-\psi_{3,-1} + \psi_{-3,1}-\psi_{-3,-1} + \psi_{0,-2}-\psi_{0,2} . $$ All the contributing functions $\psi_{lm}$ (the complex exponentials in eqn (8-65) of M&W) in this equation have the same value of $\frac{l^2}{9}+\frac{m^2}{3}$. Then there are excited states, all doubly degenerate, all defined in a similar way. Assigning quantum numbers to these states looks like little more than "labelling" them. But the reference Li and Blinder J Chem Educ, 64, 130 (1987) given in the above answer describes another scheme in which we can write the energies as $$ E_{pq} = (p^2+pq+q^2)E_{10}, \quad q=0,\frac{1}{3}, \frac{2}{3}, \ldots, \quad p = q+1, q+2, \ldots $$
{ "domain": "physics.stackexchange", "id": 54386, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, potential, schroedinger-equation, fourier-transform", "url": null }
special-relativity, cosmology Title: Violation of Lorentz invariance (Lagrangian for particle) I'm trying to get the relativistic action (or Lagrangian) for a free particle in the case of violation of Lorenz invariance. Suppose we have the modified dispersion relation: $$ E^{2}=\Omega^{2}(p^{2}) $$ Here $E$ and $p$- energy and momentum of the particle, $\Omega^{2}$ is a function that takes the form $\Omega^{2}(p^{2})=m^{2}c^{4}+p^{2}c^{2}$ if we have Lorentz invariance. In the other word, we have equation $$ \left(v\frac{\partial L}{\partial v}-L\right)^{2}=\Omega^{2}\left(\left[\frac{\partial L}{\partial v}\right]^{2}\right) $$ We want to define the Lagrangian. For example, if $E^{2}=m^{2}+(1+\xi)p^2$, we can obtain(overriding $\tilde{v}=v(1+\xi)^{-1/2}$, we present the equation written above to the standard relativistic form, above which we know everything): $$ L=-m\sqrt{1-\frac{v^{2}}{1+\xi}} $$ I want to find lagrangian and action for the following case: $$ E^{2}=p^{2}c^{2}+m^{2}c^{4}+\frac{p^{4}}{M^{2}} $$
{ "domain": "physics.stackexchange", "id": 6692, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, cosmology", "url": null }
c++, serialization You already have an explicit default constructor. You could add a defaulted one if you remove the default value = 0 from the existing constructor. It probably makes sense to do this, to get the same behavior as with the built-in integral types. More about endianness There is more to endianness than little-endian and big-endian. There is also middle-endian. There are architectures were some types are in one endianness, others in another endianness (mostly floats vs. ints though). There are architectures where endianness is flexible, and can be changed per process or even per memory page. How are you going to handle that? At the other extreme I would say that in practice, you nowadays don't need to worry about anything but little-endian systems where integer sizes are multiples of 8. So you only need a BigEndian class to deal with conversions to/from big-endian, nothing more. Anything else falls into the YAGNI category. Make it constexpr
{ "domain": "codereview.stackexchange", "id": 44421, "lm_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++, serialization", "url": null }
quantum-mechanics, waves, visible-light, double-slit-experiment, interference Another way to see this is to realise that if we could write $$\sin \theta = \frac{x}{L},$$ then $x$ would never be greater than $L$. However, anyone who's actually done an experiment with a diffraction grating and a laser will be able to tell you that it's not very hard to have $x > L$ for large $n$.
{ "domain": "physics.stackexchange", "id": 96542, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, waves, visible-light, double-slit-experiment, interference", "url": null }
waves, acoustics, air, gas This is nicely explained with pictures on this web page , in particular this animation. I created a downsampled version of the animation (to fit the 2 MB limit of the site):
{ "domain": "physics.stackexchange", "id": 34667, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves, acoustics, air, gas", "url": null }
javascript, beginner, object-oriented, dom let delDoneRow_btn = document.createElement("button"); delDoneRow_btn.type = "button"; delDoneRow_btn.innerText= "Delete"; delDoneRow_btn.classList.add(".btn"); delDoneRow_btn.addEventListener("click", deleteDoneRow); let stop_btn = document.createElement("button"); stop_btn.type = "button"; stop_btn.innerText= "Start"; stop_btn.classList.add(".btn"); stop_btn.addEventListener("click", stopTimer); let end_btn = document.createElement("button"); end_btn.type = "button"; end_btn.innerText= "End task"; end_btn.classList.add(".btn"); end_btn.addEventListener("click", endTask); let tableRowToDo = document.createElement("tr"); toDoTable.appendChild(tableRowToDo); toDoRows.push(tableRowToDo); let toDoTableDatas = []; //Defining "To do" table for(let i = 0;i < 3;i++){ toDoTableDatas.push(document.createElement("td")); tableRowToDo.appendChild(toDoTableDatas[i]); }
{ "domain": "codereview.stackexchange", "id": 20562, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, beginner, object-oriented, dom", "url": null }
quantum-mechanics, electrons, double-slit-experiment, wave-particle-duality In the context of the video, when one of the electrons makes a quantum leap to one of the lower energy levels closer to the nucleus, it emits electromagnetic radiation at certain wavelengths. This emitted electromagnetic radiation is its emission spectrum.
{ "domain": "physics.stackexchange", "id": 32228, "lm_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, electrons, double-slit-experiment, wave-particle-duality", "url": null }
java, beginner, strings, file public class TextAnalyzer { private static HashMap<String, Integer> wordCount = new HashMap<String, Integer>(); public static StringBuffer stringBuffer; public static void main(String[] args) throws IOException { if (args.length == 0) { System.out.println("Please specify input file as program argument"); return; } getWordsCount(args[0]); String outputFileName; Scanner scanner = new Scanner(System.in); System.out.println("Please enter output file name:"); outputFileName = scanner.nextLine(); while (outputFileName.isEmpty()) { System.out .println("Invalid file name ! Please re-enter output file name:\n"); outputFileName = scanner.nextLine(); }
{ "domain": "codereview.stackexchange", "id": 13959, "lm_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, strings, file", "url": null }
nuclear-physics, atomic-physics, radiation Let's assume the parent nucleus has atomic number Z_1, neutron number N_1, and charge 0 (Z_1 electrons). Let's then assume the theoretical lower-energy daughter state has atomic number Z_2 = Z_1 - 1, neutron number N_2 = N_1 + 1, and charge -1 (Z_2 + 1 electrons). Let's finally assume the transition energy between those two states is lower than 1,022 KeV, say, 612 KeV, and that the binding energy of an electron in that daughter state is 1 KeV.
{ "domain": "physics.stackexchange", "id": 91462, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nuclear-physics, atomic-physics, radiation", "url": null }
lower-bounds, partial-order, lattices, finite-sets I am aware that the time and space requirements are underspecified above, but I would be happy about any suggestions, whether they are proven to be optimal or not... Background: I am currently building an entire graph database that holds all the edges between the sets and then look for the nodes that have no generalizations, but this is quite complicated, slow and requires a lot of (disk) space. The list mentioned above contains roughly 100 million sets. One approach is to sort the sets by increasing size, then repeatedly perform the following: take the first set in the list, output it, and remove from the list all supersets of it. This will output all of the minimal sets. The running time is $O(nk)$ set comparisons plus $O(n \log n)$ steps for sorting, where $n$ is the number of sets you have and $k$ is the number of minimal elements. Or, to put it another way, if each set contains $m$ elements, the running time will be approximately $O(n(k+\log n)m)$ basic steps.
{ "domain": "cs.stackexchange", "id": 15303, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lower-bounds, partial-order, lattices, finite-sets", "url": null }
javascript Title: Javascript class+call base class? I'm sure this can be done in less lines and in a more clean way? function BaseClass() { BaseClass.prototype.talk = function () { alert("I'm BaseClass"); } } function MyClass() { BaseClass.call(this); } MyClass.prototype = new BaseClass(); MyClass.base = {}; MyClass.base.talk = MyClass.prototype.talk; MyClass.prototype.talk = function () { alert("I'm MyClass"); MyClass.base.talk(); } var a = new MyClass(); a.talk(); function BaseClass () {} BaseClass.prototype.talk = function () { alert("I'm BaseClass"); } function MyClass() { BaseClass.call(this); } MyClass.prototype = new BaseClass(); MyClass.base = BaseClass.prototype; MyClass.prototype.talk = function () { alert("I'm MyClass"); MyClass.base.talk.apply(this, arguments); } var a = new MyClass(); a.talk(); To make all this easier on yourself, don't re-invent the wheel. Look into John Resig's tiny inheritance library: Simple JavaScript Inheritance.
{ "domain": "codereview.stackexchange", "id": 2976, "lm_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", "url": null }
## (9) Comment(s) Siddharth Sharma () 60*0.2+45=57 thats the shortest method to do it. Shivakumar () divided by 60 for 59A+45 not only for 45 Vijay () simply, 60*(x-.20)-59x=45; =>x=45+12=57. Sanajit Ghosh () @DURGA's ans is right Zoha Amjad () answer is 56.8 0.2 kgs increase means $0.2*59=11.8$ $11.8+45 = 56.8$ Shanu () The ans should be 56.8 it can be solved as $60A-((A-0.2)*59)=45$ so $A(\text{avarage}) = 56.8$ Kiruthi () ans should be 56.8 because in question they have given increased by 200g but while solving they took it as decreased by 200g so 57 Durga () Hi , The answer is 57 only. Let say the average of 60 students is $x$. Total weight $=60*x$ If one man left average should increase 200gr i.e $\dfrac{200}{1000} =0.2 \text{ kg}$ So, $60 \times x-45=59(x+0.2)$ $60x-59x=59*0.2+45$ $\Rightarrow x=56.8 \text{ kg}$ But here we need to calculate the average of 59 students i.e $56.8+0.2= \textbf{57 kg}$ Elmira ()
{ "domain": "lofoya.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.985718064816221, "lm_q1q2_score": 0.8581634629235501, "lm_q2_score": 0.8705972768020108, "openwebmath_perplexity": 1959.2774824885898, "openwebmath_score": 0.7966797947883606, "tags": null, "url": "http://www.lofoya.com/Solved/1517/when-a-student-weighing-45-kgs-left-a-class-the-average-weight-of" }
thermodynamics, entropy, work, physical-chemistry, heat-engine Title: Why does entropy allow heat to be converted to work? Physical chemistry has made me question everything. Recently, I was thinking: "why is it even possible to convert heat to work?" From what I learned, a heat engine can take energy in and convert it into work. However, heat can be defined as more "disordered" than work (because in heat, particles are more "random", but in work, they more "organized". Let me know if you'd like for me to elaborate). So, if heat is more disordered, having more heat and less work means that there is greater entropy. Therefore, when we convert heat to work, we are decreasing the entropy, are we not? And it's not just the entropy of the system, but the universe (because we obtain the heat from the surroundings). So, if according to the 2nd law, entropy can only increase, how is it possible to convert heat to work? What am I understanding wrong? From what I learned, a heat engine can take energy in and convert it
{ "domain": "physics.stackexchange", "id": 61309, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, entropy, work, physical-chemistry, heat-engine", "url": null }
From (3) it can be seen that sequence $\{T\}$ converges to $1$, so tabulate $T_n$ and $\color{blue}{1-T_n}$ against $n$: $$\begin{array}{c|c|c} n & T_n & 1-T_n \\ 0 & 0 & 1-\frac{1}{1}\\ 1 & 0 & 1-\frac{2}{2}\\ 2 & \frac{1}{4} & 1-\frac{3}{4} \\ 3 & \frac{3}{8} & 1-\frac{5}{8} \\ 4 & \frac{1}{2} & 1-\frac{8}{16} \\ 5 & \frac{19}{32} & 1-\frac{13}{32} \end{array}$$ The numerators in the last column are Fibonacci numbers and the denominators are powers of $2$. We can conjecture that: $$T_n = 1-\frac{F_{n+2}}{2^n} \tag{4}$$ and prove by induction. Note that $F_1=F_2=1,F_3=2$ for this Fibonacci sequence. Clearly, by (4) we have $T_0=T_1=0$. So assuming (4) as the induction hypothesis, for $n\ge2$, we have by (3):
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9763105307684549, "lm_q1q2_score": 0.8093016858639334, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 638.2905862887507, "openwebmath_score": 0.9443881511688232, "tags": null, "url": "https://math.stackexchange.com/questions/1432793/probability-of-two-consecutive-heads-in-20-throws" }
neural-network, deep-learning, rnn Don't get what meaning of $W_x$ and $U_z$. I know that $W$ is typicaly for weights... what does this equation mean? If you look deeper in LSTMs or GRUs, we observe that the gates(input, output, cell or forget based on the RNN) are calculated using an equation like you specified. Example, according to deep learning tutorial of lstm, it=sigma(Wi xt + Ui ht-1 + bi) In this, h is the hidden state vector and x is the input state vector as specified and W and U are the corresponding weights for the input gate it. SImilarly, there are gates for output and forget. So in the paper, they recall a gist of RNNs and sum it up as a general equation. It is a common computational block in RNNs despite their minor differences. Refer Colah's blog or wildml, I think they are one of the best to understand RNNs.
{ "domain": "datascience.stackexchange", "id": 966, "lm_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", "url": null }
tree, go q := &TreeNode{val: 1} q.left = &TreeNode{val: 2} q.right = &TreeNode{val: 3} isSame := isSameTree(p,q) fmt.Println("is same?: ", isSame) } A quick way to make your code more Go-styled is to have it automatically formatted. Specifically, spaces are a bit off. For example, in the isSameTree() signature, you have a space before a comma, a space before the closing parenthesis, and no space before the opening brace. The parentheses around (bool) are unnecessary. You're also writing semicolons inconsistently. The isSameTree() implementation is a bit confusing ("A but not B and not C. If you made it this far, check D and E and F?"). It would be clearer as one long affirmative expression. func isSameTree(p *TreeNode, q *TreeNode) bool { return (p == nil && q == nil) || (p != nil && q != nil && p.val == q.val && isSameTree(p.left, q.left) && isSameTree(p.right, q.right)) }
{ "domain": "codereview.stackexchange", "id": 13301, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "tree, go", "url": null }
electric-circuits, electricity, electrical-resistance, conductors, dissipation The difference would be a greater drop in voltage across the less conductive wires than the copper wires, resulting in a lower voltage available to operate the light bulb. Would the less conductive wires actually deliver less electricity to the light bulb The less conductive wires will cause an increase in resistance and less current for a fixed battery voltage, as $I=V/R$ per Ohm's law. The reduction in the current delivered to the circuit means less power dissipated in the wires and bulb, as the power dissipated varies as the square of the current and linearly with resistance, or $P=I^{2}R$. For an incandescent bulb, that means it will operate more dimly. would some amount of electricity be "lost" in the process, would it ultimately deliver the same amount of electricity to the light bulb but take longer? What would happen?
{ "domain": "physics.stackexchange", "id": 86975, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electric-circuits, electricity, electrical-resistance, conductors, dissipation", "url": null }
c, linked-list, pointers Something like this: if (deleted == list->tail) { list->tail = (node == &list->head) ? NULL : (lrsll_node*)node; }
{ "domain": "codereview.stackexchange", "id": 27394, "lm_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, pointers", "url": null }
cryptography Title: Meaning of: "'If factoring large integers is hard, then breaking RSA is hard,' is unproven" I was reading CLRS and is said: If factoring large integers is easy, then breaking the RSA cryptosystem is easy. Which makes sense to me because with the knowledge of $p$ and $q$, it is easy to create the secret key which the knowledge of the public key. Though, it explains the converse statement, which I don't quite understand: The converse statement, that if factoring large integers is hard, then breaking RSA is hard, is unproven. What does the statement above formally mean? If we assume factoring is hard (in some formal way), why does that not imply that breaking the RSA crypto system is hard? Now consider that if we assumed that factoring is hard...and that we discovered that it meant that the RSA cryptosystem is hard to break. What would that formally mean? The easiest way to think about it is to think of the contrapositive. The statement:
{ "domain": "cs.stackexchange", "id": 5708, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cryptography", "url": null }
metabolism, fermentation (so in this wikipedia page on Glycolysis, in the Post Glycolysis part it mentions this) https://en.wikipedia.org/wiki/Glycolysis#Post-glycolysis_processes "pyruvate is converted to lactate " However, on the other hand, I see some sources, even another wikipedia article titled "anaerobic glycolysis", which the page says isn't well sourced, it has glycolysis as ending in lactate. https://en.wikipedia.org/wiki/Anaerobic_glycolysis "Anaerobic glycolysis is the transformation of glucose to lactate when limited amounts of oxygen (O2) are available" Also here https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4343186/ "we contend that La− is always the end product of glycolysis" (putting aside their controversial claim that it is always the end product, i'm interested here in the idea of theirs that it is ever an end product, so, their use of the term glycolysis) So it seems that there are those two positions
{ "domain": "biology.stackexchange", "id": 7392, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "metabolism, fermentation", "url": null }
sql, sql-server, stackexchange I don't have a database schema in hand, but there are two table concerned : Posts : Where we have questions and answers. The answers have a ParentId that is a question. A post has an owner (OwnerUserId) with an associated User. I think the rest of the columns names are pretty self explanatory, but I can add details if necessary. I've tested the query and, to the best of my knowledge, it works. I'm not very used to SEDE so there might be things I missed, which I'd like to learn. I'd also like to know if there are performance pitfalls in my query I should be aware of or best practices that I'm missing. The query itself. As a heads up - we have very different formatting styles for our code. Feel free to ignore that difference and don't consider it a comment on your style (unless you prefer mine, in which case please do).
{ "domain": "codereview.stackexchange", "id": 35674, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sql, sql-server, stackexchange", "url": null }
complexity-classes, quantum-computing initialize qbits based on the input of length n apply K * polynomial(n) quantum gates measure just a single output qbit Or is making multiple measurements absolutely necessary to the computational power here? The principle of deferred measurement (see https://en.wikipedia.org/wiki/Deferred_Measurement_Principle) tells us that measurements in the middle of a quantum computation can be simulated by using additional quantum gates instead. In particular, instead of measuring a qubit, we can apply a CNOT gate to that qubit and another qubit (which is used only at this point of the computation).
{ "domain": "cstheory.stackexchange", "id": 3940, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-classes, quantum-computing", "url": null }
ds.algorithms, dc.parallel-comp, dc.distributed-comp Title: Current parallel models for computation The 1980's gave rise to both the PRAM and the BSP models of parallel computation. It seems that both model's heyday were during the late 80s and early 90s. Are these areas still active in terms of research for parallel algorithms? Are there newer more sophisticated models for parallel computation? Are general models still in vogue, or are researchers trying to specialize with GPGPU or Cloud based computation coming in fashion? There are a number of models floating around, but some of the most salient are: The MUD and Mapreduce models that are primarily about capturing the MapReduce framework, but more generally can be viewed as parallel-distributed models of computation The various multicore models that have been proposed (but by no means are the standard yet) There was a workshop last month at DIMACS on this topic: perusing the abstracts will give you more pointers.
{ "domain": "cstheory.stackexchange", "id": 1624, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.algorithms, dc.parallel-comp, dc.distributed-comp", "url": null }
reference-request, lo.logic, pl.programming-languages, type-theory, ct.category-theory Title: Proof theory of biproducts? A category has biproducts when the same objects are both the products and coproducts. Has anyone investigated the proof theory of categories with biproducts? Perhaps the best-known example is the category of vector spaces, in which the direct sum and direct product constructions give the same vector space. This means vector spaces and linear maps are a slightly degenerate model of linear logic, and I am curious what a type theory which accepts this degeneracy would look like. Samson Abramsky and I wrote a paper about the proof theory of compact categories with biproducts. Abramsky, S. and Duncan, R. (2006) "A Categorical Quantum Logic", Mathematical Structures in Computer Science 16 (3). 10.1017/S0960129506005275 The ideas were later developed a bit further in this book chapter:
{ "domain": "cstheory.stackexchange", "id": 1692, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reference-request, lo.logic, pl.programming-languages, type-theory, ct.category-theory", "url": null }
javascript, node.js, sql-server, mongodb, express.js var deleteMany = function (queryDto, callback) { var updateDto = { auditDeletedDate: moment().utc().toDate() }; return modifyMany(queryDto, updateDto, callback); }; memberSchema.methods.deleteMany = deleteMany; var deleteOne = function (queryDto, callback) { var updateDto = { auditDeletedDate: moment().utc().toDate() }; return modifyOne(queryDto, updateDto, callback); }; memberSchema.methods.deleteOne = deleteOne; var member = mongoose.model('Member', memberSchema); module.exports = member; I've looked at the files on GitHub. There are a few things I would change.
{ "domain": "codereview.stackexchange", "id": 12965, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, node.js, sql-server, mongodb, express.js", "url": null }
c++, json, c++17 Performance - any issues I've overlooked? I haven’t run any tests, but I am highly suspicious of the overall performance of the design. Parsing a JSON string character by character—updating a state machine with every one—seems like the most painfully slow and tedious way to do it. Indeed, the idea of a literal state machine to parse JSON seems like overengineering to me. It seems to me that if you wrote a JSON parser in the simplest and most straightforward way, you’d end up with a logical PDA that uses the function call stack as the stack. And it would probably be orders of magnitude faster, because it’s not literally pushing and popping states from a dynamically-allocated stack, but merely calling and returning from functions. Any excessive copying or other issues? Generally no.
{ "domain": "codereview.stackexchange", "id": 38461, "lm_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++, json, c++17", "url": null }
ros, ros2, apt $ cat /etc/apt/sources.list.d/ros2-latest.list deb [arch=amd64] http://packages.ros.org/ros2/ubuntu eoan main $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=19.10 DISTRIB_CODENAME=eoan DISTRIB_DESCRIPTION="Ubuntu 19.10" After a bit of searching around, I read that each ROS2 release is paired with an Ubuntu release, so I tried the following command. $ sudo apt install ros-desktop-full Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
{ "domain": "robotics.stackexchange", "id": 34826, "lm_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, apt", "url": null }
php Title: If statement with 2 conditions On my webform, there are two kinds of address-fields a user can give. But since it's a complex webform (Drupal) it's kind of hard to achieve. Every time a user adds an extra address, the form is regenerated and there will be a new item added to the $address_afl and $address_bev-array. Is it possible to compress this code so the foreach-loop starts looping with the highest value (either $address_afl or$address_bev ) $address_afl = $form['field_afl_dienst_adressen']['und']; $i = 0; foreach($address_afl as $value) { if (is_array($value)) { $test = array_keys($value); if(is_array($test)) { foreach ($test as $z) { if (strpos($z, '#') === 0) continue; if (isset($form['field_afl_dienst_adressen']['und'][$i][$z])) { $form['field_afl_dienst_adressen']['und'][$i][$z]['#prefix'] = "<div class='address-publicatie-$z'>";
{ "domain": "codereview.stackexchange", "id": 1027, "lm_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", "url": null }
catkin-make [ 44%] Built target pcl_util_examples [ 45%] Built target pcl_util_pc2_iterator_examples [ 45%] Built target pcl_util_rgb [ 45%] Built target scrollgrid_examples [ 45%] Built target tf_utils [ 45%] Built target _shapes_generate_messages_check_deps_PolygonDepth [ 45%] Built target _shapes_generate_messages_check_deps_Point2D [ 45%] Built target _speed_profile_generate_messages_check_deps_SpeedProfile [ 45%] Built target _shapes_generate_messages_check_deps_PolygonWithHolesDepth [ 45%] Built target gridmapping_msgs_generate_messages_cpp [ 46%] Built target gridmapping_msgs_generate_messages_lisp [ 47%] Built target gridmapping_msgs_generate_messages_py [ 48%] Built target alglib_minqp_d_bc1 [ 48%] [ 48%] Built target alglib_example_df Built target circular_curve_lib_example_dubins_path_set [ 51%] [ 51%] Built target gdal_utils_example_dem Built target circular_curve_lib_example_trochoid [ 51%] Built target ompl_GeometricCarPlanning [ 51%] Built target math_utils_scratch
{ "domain": "robotics.stackexchange", "id": 26246, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "catkin-make", "url": null }
differential equation dV/dt = 1000/(2t+1)^2, to obtain V in terms of t iii) Find the radius of the balloon at. - Duration: 2:21. Calculate the volume of the balloon in liters. How long will it take until the balloon is completely empty? 3 3 4 3 4 (_____) 3 _____cubic feet Vr V V The balloon will be empty in _____. A spherical water balloon has a radius of 7 inches. At what rate is the volume changing when the radius is 10 centimeters?. If you happen to know that the surface area is $4\pi r^2$, then you can say the rate at which the volume is increasing is the surface area times the rate at which the radius is increasing. How fast is the radius r increasing when the radius is exactly 3 feet. Unformatted text preview: AP Calculus AB Problem Set 1. So they've given us the diameter. 545*10^-5Liters which was wrong so then I came with an other answer of 6. 03 inches per minute, how fast is the volume of the balloon changing at the time when its radius is 5 inches? 2. Use the given formula
{ "domain": "comefaretradingonlinebft.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9881308810508339, "lm_q1q2_score": 0.8008592313124419, "lm_q2_score": 0.8104789018037399, "openwebmath_perplexity": 339.69184886938785, "openwebmath_score": 0.865911602973938, "tags": null, "url": "http://zjvs.comefaretradingonlinebft.it/spherical-balloon-volume-formula.html" }
• Triangular matrices with distinct diagonal elements. If $U$ is upper triangular and has distinct diagonal elements, then by Homework 9.2.3.4 we know we can find an eigenvector associated with each diagonal element and by design those eigenvectors are linearly independent. Obviously, this can be extended to lower triangular matrices as well. ###### Homework9.2.5.2. Let $A \in \Cmxm$ have distinct eigenvalues. ALWAYS/SOMETIMES/NEVER: $A$ is diagonalizable. Let $A = Q U Q^H$ be the Schur decomposition of matrix $A \text{.}$ Since $U$ is upper triangular, and has the same eigenvalues as $A \text{,}$ it has distinct entries along its diagonal. Hence, by our earlier observations, there exists a nonsingular matrix $X$ such that $X^{-1} U X = D \text{,}$ a diagonal matrix. Now, and hence $Y = Q X$ is the nonsingular matrix that diagonalizes $A \text{.}$
{ "domain": "utexas.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9947798744612014, "lm_q1q2_score": 0.8178972000439901, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 1059.854827321394, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://www.cs.utexas.edu/users/flame/laff/alaff/chapter09-diagonalization.html" }
genetics, altruism Even though I figured out how others work, I wasn't able to calculate r for fullsister fullbrother? How can it be 3/4,1/4,1/2,1/2? This is a relative thing in haplodiploidy system. r = Mother's side + father's side(in this case) D--Daughter S--Son F-Father M-Mother Note: You can get the below things from the question image itself.(All that you need to do is to read male and female appropriately as son,father,mother,daughter based on the context.So simple!) 1.rMD=1/2 2.rMS=1/2 3.rDM=1/2 4.rDF=1/2 5.rFD=1 6.rFS=0 7.rSM=1 8.rSF=0 case 1: rDD=(rDM*rMD) + (rDF*rFD) rDD=(1/2*1/2)+(1/2*1) rDD=3/4 case 2: rDS=(rDM*rMS) + (rSF*rFD) rDS=(1/2*1/2)+0*1 rDS=1/4 case 3: rSD=(rSM*rMD) + (rDF*rFS) rSD=(1*1/2)+(1/2*0) rSD=1/2 case 4: rSS=(rSM*rMS) + (rSF*rFS) rSS=(1*1/2)+(0*0) rSS=1/2
{ "domain": "biology.stackexchange", "id": 2833, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genetics, altruism", "url": null }
ros-kinetic -- This workspace overlays: /home/ubuntu/catkin_workspace/devel;/opt/ros/kinetic -- Using PYTHON_EXECUTABLE: /usr/bin/python -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/gtest': gtests will be built -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.7.8 -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 7 packages in topological order: -- ~~ - fiducial_follow -- ~~ - velodyne (metapackage) -- ~~ - velodyne_msgs -- ~~ - loam_velodyne -- ~~ - velodyne_driver -- ~~ - velodyne_laserscan -- ~~ - velodyne_pointcloud -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'fiducial_follow' -- ==> add_subdirectory(demos/fiducial_follow) -- +++ processing catkin metapackage: 'velodyne'
{ "domain": "robotics.stackexchange", "id": 30252, "lm_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 }
c# { if (articles[currentArticle].Roles[currentArticleRole].ToLower() == roles[currentRole].ToLower()) { if (currentArticleRole == 0 && currentRole == 0) articles[currentArticle].Weight += 3; else articles[currentArticle].Weight += 1; } } } } for (int currentTopic = 0; currentTopic < topics.Count; currentTopic++) { if (articles[currentArticle].Topics != null && articles[currentArticle].Topics.Count > 0) { for (int currentArticleTopic = 0; currentArticleTopic < articles[currentArticle].Topics.Count; currentArticleTopic++) { if (articles[currentArticle].Topics[currentArticleTopic].ToLower() == topics[currentTopic].ToLower()) {
{ "domain": "codereview.stackexchange", "id": 9203, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#", "url": null }
The notation $F_X$ is very widely used to represent the cumulative distribution function (cdf) of a random variable $X$, and is defined as $F_X(x)=P[X\le x]$. This is valid whether or not $X$ is absolutely continuous. The probability density function, $f_X$, is only well-defined when $X$ is absolutely continuous, in which case $F_X$ is differentiable and $f_X=F'_X$. In this case only, your shorthand is legitimate, because $$f(x)=F'(x)=\lim_{\Delta x\rightarrow 0}\frac{F(x+\Delta x)-F(x)}{\Delta x}=\lim_{\Delta x\rightarrow 0}\frac{1}{\Delta x}P[X > x \wedge X\le x+\Delta x].$$ In terms of the cdf, the probability that $X$ takes on a particular value $x$ is $$P[X=x]=P[X\le x]-\lim_{y\rightarrow x-}P[X\le y]=F_X(x)-F_X(x-),$$ i.e., the difference between $F_X$'s value at $x$ and its limiting value approaching $x$ from below. Of course, this can only be nonzero if $F_X$ has a discrete component.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9658995762509216, "lm_q1q2_score": 0.8190517022026385, "lm_q2_score": 0.8479677622198946, "openwebmath_perplexity": 244.11467270528163, "openwebmath_score": 0.9641590714454651, "tags": null, "url": "http://math.stackexchange.com/questions/273120/notation-for-probability-density" }
newtonian-mechanics, newtonian-gravity, time-reversal-symmetry Title: How is gravity time symmetric since it is only an attractive force? I've read that gravity is time symmetric, and from what I understand, that means that if I were to record a video of objects moving only under the influence of gravity and play it in reverse, it would not go against the laws of physics. But an apple can fall down. When reversed, the apple would float upwards as though it were being repelled? Under time reversal, $t\to-t$. Other physical quantities may change due to this transformation. For example, position does not change under time reversal. (Imagine pausing a simulation, then reversing the direction of playback. Before you begin playing back, while still paused, all objects are still where they were). On the other hand, velocity reverses direction under time reversal. (The instant you begin playing the video backwards, the objects will be moving in the opposite direction they had been been traveling.) In general, quantities depending on time with only even
{ "domain": "physics.stackexchange", "id": 45161, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, newtonian-gravity, time-reversal-symmetry", "url": null }
c++, parsing std::ifstream config (file); if (!config.is_open()) return false; std::string section; std::string buffer; std::size_t i = 0; while (std::getline (config, buffer, '\n')) { if (!spaceonly (buffer)) { if (isvalid (buffer)) parse (records, section, buffer); else{} // std::cout << "Failed at line " << i; } ++i; } return true; } std::string ConfigReader::get_string (const std::string & tsection, const std::string & tname, std::string tdefault) { for (std::size_t i = 0; i < records.size(); ++i) { if (records[i].section == tsection && records[i].name == tname) { return records[i].value; } } record temp; temp.section = tsection; temp.name = tname; temp.value = tdefault; records.push_back (temp); return tdefault; }
{ "domain": "codereview.stackexchange", "id": 4093, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, parsing", "url": null }
fft, frequency-spectrum First and most significantly it minimizes the end discontinuities which are visible by creating the equivalent periodic waveform. The Fourier Transform result for the finite duration waveform is equivalent to the transform for the same waveform periodically extended for all time (the non-zero Fourier results specifically). This visualization is useful to more intuitively understand the effect of the discontinuities in an equivalent continuous-time sampled context: very high frequency components are needed to transition in a very short period of time; these high frequency components alias back to lower frequencies for a sampled system and we can see the result as “spectral leakage”).
{ "domain": "dsp.stackexchange", "id": 10111, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, frequency-spectrum", "url": null }
c# private List<ConcessionModel> Filter(string product, string category, string status) { if (category == "All" && status != "All") { return concessionList .Where(x => x.Product .IndexOf(product, StringComparison.InvariantCultureIgnoreCase) >= 0 && x.Status .IndexOf(status, StringComparison.InvariantCultureIgnoreCase) >= 0) .ToList(); } else if (category != "All" && status == "All") { return concessionList .Where(x => x.Product .IndexOf(product, StringComparison.InvariantCultureIgnoreCase) >= 0 && x.Category .IndexOf(category, StringComparison.InvariantCultureIgnoreCase) >= 0) .ToList(); } else if(category == "All" && status == "All") { return concessionList .Where(x => x.Product .IndexOf(product, StringComparison.InvariantCultureIgnoreCase) >= 0).ToList(); } else
{ "domain": "codereview.stackexchange", "id": 40743, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#", "url": null }
quantum-mechanics, operators, wavefunction, conventions, fourier-transform $$\langle \hat{O}\rangle =\int dx \Psi(x)^*\hat{O}\Psi(x).$$ Therefore, just like the wave function, the operator has different forms in different representations. Let us start with the position expectation in the position representation: $$\langle x\rangle = \int dx x|\Psi(x)|^2 = \int dx \Psi(x)^*x\Psi(x).$$ We easily read the position operator from this expression as $$\hat{x}=x.$$ The momentum operator in this representation is given by $\hat{p}=-i\hbar\partial_x$, as can be verified by considering its action on a state with a definite momentum: $$\psi_p(x)=\frac{1}{\sqrt{2\pi}}e^{i\frac{px}{\hbar}}.$$ Note that the minus sign in this operator is a matter of convention: if we defined plane waves as $\psi_p(x)=\frac{1}{\sqrt{2\pi}}e^{-i\frac{px}{\hbar}}$, we would have to choose $\hat{p}=i\hbar\partial_x$. Let us now look at the momentum representation. The wave function in the momentum representation us given by
{ "domain": "physics.stackexchange", "id": 66537, "lm_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, wavefunction, conventions, fourier-transform", "url": null }
• If OP is confused as to why $\sup\varnothing=-\infty$: Everything is an upper bound of the empty set, so the least upper bound is just the least element in the space. Why is everything an upper bound of $\varnothing$? Because, for any $c$, there's nothing in $\varnothing$ bigger than $c$. (Indeed, there's nothing in $\varnothing$ at all.) So $c$ is an upper bound. – Akiva Weinberger Sep 7 '15 at 20:35 • Tiny suggestion: Write element instead of value because this is precisely what you mean. I've looked around a bit and there might be valid reason to write value here (Wikipedia's definition, Rudin if you consider values of sets as values of the identity function), but I wanted to express my concerns considering the intuition of some people expecting a value to be an element of $\mathbb{R}$. Tiny improvement: To provide a complete answer, you probably should cover the $\max$-part of the question with a short sentence (or two). – Piwi Sep 8 '15 at 0:11
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759621310288, "lm_q1q2_score": 0.8109017201324203, "lm_q2_score": 0.826711787666479, "openwebmath_perplexity": 196.70274844519327, "openwebmath_score": 0.8959773778915405, "tags": null, "url": "https://math.stackexchange.com/questions/1425791/can-infinity-be-a-supremum-can-it-be-a-maximum/1425815" }
## Sampling set.seed(42) r1 <- rnvmix(n, qmix = qW) r2 <- rnvmix(n, qmix = qW, method = "ghalton") ## Plot if(doPDF) pdf(file = (file <- paste0("fig_rnvmix_W_three-point.pdf")), width = 9, height = 6) ran <- range(r1, r2) opar <- par(pty = "s") layout(t(1:2)) plot(r1, xlab = expression(X[1]), ylab = expression(X[2]), main = "Pseudo-random sample", xlim = ran, ylim = ran) plot(r2, xlab = expression(X[1]), ylab = expression(X[2]), main = "Quasi-random sample", xlim = ran, ylim = ran) layout(1) par(opar) if(doPDF) dev.off() When $$W$$ is discrete and has finite support, one can also easily sample from the corresponding normal variance mixture using rNorm(). ## Sampling set.seed(42) r <- lapply(1:3, function(k) rNorm(p[k] * n, scale = diag(x[k], 2)))
{ "domain": "microsoft.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109507462227, "lm_q1q2_score": 0.8051562928287104, "lm_q2_score": 0.8175744717487329, "openwebmath_perplexity": 3932.762992000776, "openwebmath_score": 0.8324417471885681, "tags": null, "url": "https://cran.microsoft.com/snapshot/2018-11-24/web/packages/nvmix/vignettes/nvmix_functionality.html" }
So we have got 45 two digits odd numbers which can represent the difference of two perfect squares. Now lets consider N as an even number and lets assume N = a^2-b^2 where a and b are whole numbers. Now lets assume N = a^2-b^2 = (a+b)*(a-b) where a>b and try to find out what conditions will fullfill this. Now for N to be an even number either both a and b has to be even (Case 1) or both of them have to be odd (Case 2). If one of them is even and one of them is odd then both a+b and a-b will be odd and the product of two odd numbers is an odd number which is not the original assumption since N is an even number. Case 1: Lets say both a and b are odd, therefore we can say that a+b is even and also a-b is even. Now lets assume a=2p+1 and b=2q+1 where p>q.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9859363704773487, "lm_q1q2_score": 0.8014354574980309, "lm_q2_score": 0.8128673223709252, "openwebmath_perplexity": 252.20416314276898, "openwebmath_score": 0.7775478363037109, "tags": null, "url": "https://math.stackexchange.com/questions/56649/how-many-numbers-below-100-can-be-expressed-as-a-difference-of-two-perfect-squ" }
graph. I'm not familiar with graph clustering algorithms, but it seems like most of them rely on subgraph density, which doesn't apply here since the graph has uniform. The answer depends a lot on the algorithms that you are planning to apply to your graphs. If a weighted directed graph G is known to have no shortest paths longer than k edges, then it suffices to run Bellman-Ford for only k passes in order to solve the single-source shortest paths problem on G. Weighted graphs may be either directed or undirected. You should never bring in namespaces in a header file (except in rare cases where you put it inside some other scope), otherwise you pollute the namespaces of everyone who #includes it; In Graph. Adjacency matrix. In the case of a directed graph GD. Directed graph. Category People & Blogs; Show more Show less. 2 builds and prints that graph. Lecture #2: Directed Graphs - Transition Matrices. The problem is that my network is weighted and directed, and I was wondering wether
{ "domain": "incommunity.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.982287698185481, "lm_q1q2_score": 0.8185645006034283, "lm_q2_score": 0.8333245973817158, "openwebmath_perplexity": 763.2774657729245, "openwebmath_score": 0.5039048194885254, "tags": null, "url": "http://ouzp.incommunity.it/weighted-directed-graph.html" }
quantum-chemistry, orbitals, theoretical-chemistry Now, most operators are not $n$-electron operators. For example, the kinetic energy operator is a 1-electron operator (only the coordinates of a single electron are needed to calculate a kinetic energy), the standard electronic Hamiltonian is a 2-electron operator (because the Coulomb potential is only dependent on the positions of two electrons at a time). Hence, we don't need the full $n$-particle density matrix to get energies and properties. The 1(or 2 or 3...)-particle (reduced) density matrix Since we don't need all of those other coordinates we can integrate them out. Indeed, the trace operation that we described above would do just that. Say we want the expectation value of a 1-particle operator (like kinetic energy). We can define a 1-particle reduced density matrix (sometimes the word "particle" or "reduced" is omitted), often abbreviated as 1PDM, 1RDM, $P^{(1)}$, or $\gamma^{(1)}$ (also others). $$P(x_1)=N\int \rho(x_1,x_2,\cdots x_n)dx_2\cdots dx_n$$
{ "domain": "chemistry.stackexchange", "id": 8587, "lm_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-chemistry, orbitals, theoretical-chemistry", "url": null }
to solve probability questions a. Looking for use branches to show the different outcomes of an experiment to Venn diagrams are a tool... Probability of a box that represents the sample space Venn diagrams is relatively simple as shown below ; Mathematics Data... Aub in the question in the question in the world of statistics a that doesn t. Too long on one question three-set Venn diagrams from Edexcel 1MA1 9-1 Mathematics... Construct a Venn diagram below: B ) a student is selected at random: in the diagram... World of statistics is a simple but powerful way to represent the relationships between datasets I will be able arrange... Can be studied in conjunction with set theory, with Venn diagrams ( H ) - Version 2 2016! ) What is the probability that the student does not study History drawing Venn diagrams www.naikermaths.com probability: diagrams! ) the first thing we need to do is draw a Venn diagram below, a contains odd in... 80 students in total that like crocodiles resources to
{ "domain": "statesindex.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.960361157495521, "lm_q1q2_score": 0.8023659367611087, "lm_q2_score": 0.8354835371034368, "openwebmath_perplexity": 960.8429574463719, "openwebmath_score": 0.3636991083621979, "tags": null, "url": "http://statesindex.org/ek-niranjan-yhftk/venn-diagram-probability-questions-cbf37a" }
c++, beginner, simulation, game-of-life Thank you very much! Here is the raw code: #include "util.h" #include <vector> #include <chrono> #include <thread>
{ "domain": "codereview.stackexchange", "id": 42649, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, simulation, game-of-life", "url": null }
fft Title: How FFTW factorizes array length? To compute fft with FFTW algorithms I think that it needs to factorizes the array size in prime factors, but it is an hard problem. which Algorithm uses FFTW to do it? FFTW factorizes by testing against a table of primes. This is fast due to the fact that the size of the table is limited because the size of computer memory in which the FFT data is to be computed is itself limited to a very tiny number in mathematical terms (less than a few petabits). You only need up to the square root of that number.
{ "domain": "dsp.stackexchange", "id": 9862, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft", "url": null }
If each player receives one king, then there are four ways to give one of the four kings to the first player, three ways to give one of the remaining three kings to the second player, two ways to give one of the remaining two kings to the third player, and one way to give the remaining king to the fourth player. Hence, there are $$4! = 4 \cdot 3 \cdot 2 \cdot 1$$ ways to distribute the four kings so that each player receives one. By symmetry, there are also $$4!$$ ways to distribute the queens so that each player receives one and $$4!$$ ways to distribute the jacks so that each player receives one. Hence, the number of favorable cases is $$4!4!4!$$ Therefore, the probability that each player receives one king, one queen, and one jack when the twelve face cards are distributed to four players when each player is dealt three cards is $$\frac{4!4!4!}{\dbinom{12}{3}\dbinom{9}{3}\dbinom{6}{3}\dbinom{3}{3}}$$ Taking the probabilities of each card dealt we get this product of fractions:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9873750529474512, "lm_q1q2_score": 0.8049402201222113, "lm_q2_score": 0.8152324871074607, "openwebmath_perplexity": 125.46894806856362, "openwebmath_score": 0.7714856266975403, "tags": null, "url": "https://math.stackexchange.com/questions/3755782/probability-that-every-player-gets-1-queen-jack-and-king" }
python, genetic-algorithm This function generates schedules in the form of lists. It locates the first quanta of a session, then changes it to a number which corresponds to the number representing the activity to be scheduled. It then changes the next element downstream to the same number, and repeats this until the duration of the session matches the value given by it's corresponding duration gene. def GenerateInitialPopulation(popSize): initialPopulation = [] for i in range(popSize): initialPopulation.append( Schedule( durationGenes=GenerateRandomDurationGenes(), startTimeGenes=GenerateRandomStartTimeGenes())) initialPopulation[i].index = i return(initialPopulation) This produces randomised genes, uses those to create a schedule object, and repeats until a population of the desired size is achieved. def CalculatePopulationSuboptimalities(population): for i in population: i.CalculateTotalCosts()
{ "domain": "codereview.stackexchange", "id": 35993, "lm_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, genetic-algorithm", "url": null }
In a second scenario, the 5-cent coins and 10-cent coins exchange quantities exactly, and they total $2.15 5A + 10B = 175 (P) 10A + 5B = 215 (Q) Multiply (Q) by two, and subtract (P) 20 A + 10B = 430 __5A + 10B = 175 15A = 255 A = 17 There are 17 coins worth 5 cents. Use (P) to find the number of 10-cent pieces 5(17) + 10B = 175 10B = 90 B = 9 There are 9 coins worth 19 0 cents. A = 17, B = 9, total = 26 coins Answer A I have run this problem three ways, including vishalbalwani 's, and working from answer choices. This combination (number of coins), is the only one that works. Question: Is the method sound? The variables work, but they seem inconsistent. I use A as a quantity for 5-cent coins. The coefficients of the variables -- 5 and 10 -- are the values of the coins in cents. But in the second equation, (Q) I do not think I have switched quantities, per the prompt. I think have switched values. In the second equation, (Q), the 5, a value, is in front of B -- which is supposed to be
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9658995762509216, "lm_q1q2_score": 0.859934817155683, "lm_q2_score": 0.8902942275774318, "openwebmath_perplexity": 4795.028110111905, "openwebmath_score": 0.38608285784721375, "tags": null, "url": "https://gmatclub.com/forum/a-purse-contains-5-cent-coins-and-10-cent-coins-worth-a-total-of-249516.html" }
regular-languages, automata, context-free, formal-grammars Clearly, every s-language (produced by an s-grammar) is unambiguous and easily parsed, since each terminal symbol from left-to-right and non-terminal uniquely determine the production to apply. For example, if the string is $abc$, then the pair $\langle S,a\rangle$ uniquely determines the first production of the parsing, and so on for each terminal and the non-terminal to its immediate right. Thus, a language defined by an s-grammar can be parsed one symbol at a time, without lookahead, yielding linear parsing time, in fact, time $|x|$. S-grammars are not terribly important in their own right, since most real languages exceed their power. But they are a stepping stone to other grammars parsed in linear time, such as $LL(k)$ grammars in which there is a bound $k$ on the lookahead needed to determine a production during parsing. In effect, an s-grammar is an $LL(0)$ grammar.
{ "domain": "cs.stackexchange", "id": 232, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "regular-languages, automata, context-free, formal-grammars", "url": null }
c++, animation, timer, fltk // rotate 6 degrees (6 degrees x 60 seconds = 360 one rotation) double angle_radians = ((30.) * PI) / 180.; Point new_time = rotate (old_time, center, angle_radians); // delete old indicator, create new one and attach it detach (*hour_indicator); hour_indicator = new Line (center, new_time); hour_indicator->set_style (Line_style (Line_style::solid, 8)); attach (*hour_indicator); // redraw (); draw (); } Result: after 33 seconds: after 1 min 24 seconds: Questions:
{ "domain": "codereview.stackexchange", "id": 16815, "lm_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++, animation, timer, fltk", "url": null }
quantum-mechanics, wavefunction, schroedinger-equation, differential-equations, hydrogen $$ \bbox[pink]{\frac{1}{R}\frac{\rm d}{{\rm d}r}\left(r^2\frac{{\rm d}R}{{\rm d}r}\right)}+\bbox[pink]{\frac{2\mu r^2}{\hbar^2}\left(E+\frac{Ze^2}{4\pi\epsilon_0r}\right)}= -\,\bbox[lightblue]{\frac{1}{Y\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial Y}{\partial\theta}\right)+\frac{1}{Y\sin^2\theta}\frac{\partial^2Y}{\partial\phi^2}} \quad , $$ you see that while the left-hand side only depends on $r$ (i.e. is a function of $r$ only), the right-hand side only depends on $\theta$ and $\phi$ (i.e. is a function of $\theta$ and $\phi$ only). So changing $r$ cannot lead to a change of the right-hand side and a change of $\theta$ or $\phi$ cannot lead to a change of the left-hand side. Consequently, both terms must be constant - with respect to $\theta$, $\phi$ and $r$. If $A$ would depend on either $r$ or $\theta$ or $\phi$ (or on all variables), then a change in e.g. $r$ would lead to a change of the right-hand side of the equation, which is not possible.
{ "domain": "physics.stackexchange", "id": 77060, "lm_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, schroedinger-equation, differential-equations, hydrogen", "url": null }
fourier-transform, frequency, homework, frequency-spectrum $$ y[n] = a^{4n}u[n] - a^{4(n-4)+4}u[n-4] $$ $$ y[n] = a^{4n}u[n] - a^{4n-12}u[n-4] $$
{ "domain": "dsp.stackexchange", "id": 157, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fourier-transform, frequency, homework, frequency-spectrum", "url": null }