text
stringlengths
49
10.4k
source
dict
arduino, mobile-robot, localization, mapping, planning If you use 1's and 0's in your map, then Map (currentPos)*Map (destPos) is either 1 if both entries are 1 or 0 if either entry is a 0. That is, it doesn't matter which is the wall, you equally can't move from wall to path or path to wall. If you just use a regular map you should get a symmetric matrix. The nice thing about a Digraph is that it doesn't need to be symmetric. That is, you could have wormholes/tunnels/portals/chutes and ladders where one point on the map is connected to some remote point on the map. Further, these tunnels can be bi-directional (two way), or they can be uni-durectional. That is, Digraph(a,b) could be 1 (path exists) where Digraph(b,a) is zero (path does not exist). If there are such tunnels, you need to add them by hand after the script above runs. Just like sub2ind gives you the linear index given conventional subscripts, ind2sub gives you subscripts given the linear index. Finally, as a note, the Dykstra algorithm should give you a series of way points, but these will all be in linear index form. This is why I point out the ind2sub function above. Hope this helps. Please feel free to comment if you have any more questions. :EDIT EDIT: Linear indexing is just a way to refer to a matrix location with one value. You can brew your own as follows (again in Matlab form not c++, though they are similar): nRows = size(matrixToBeIndexed,1); nCols = size(matrixToBeIndexed,2); N = numel(matrixToBeIndexed); sub2ind = zeros(nRows,nCols); ind2subROW = zeros(1,N); ind2subCOL = zeros(1,N);
{ "domain": "robotics.stackexchange", "id": 717, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "arduino, mobile-robot, localization, mapping, planning", "url": null }
reinforcement-learning, rewards, performance, return, testing Or, when you know the optimal actions, you can plot the number of plays/iterations against the percentage of actions. See for example this RL comparison on the 10-armed testbed problem: Henderson et al. 2017 have a whole section about the evaluation metrics of Reinforcement Learning algorithms. They also comment on the plotting of the average or maximum cumulative rewards, moreover they mention the sample bootstrap method to create confidence intervals for a better comparison. Lastly, they mention that the significance of the improvements of the algorithms should be calculated, using a statistical test, such the two sample t-Test. Note that you should take into account the distributions of the datasets to choose the right statistical test. An interesting article related to this is A Hitchhiker's Guide to Statistical Comparison of Reinforcement Learning Algorithms of Colas et al.. Comparison of plays against humans To find out how well different algorithms play against humans you should do a large number of games and compare - what you consider - important parameters, for example: did the algorithm won, the time it took to win, number of points gained, etc. These values can then be compared statistically. Note that you have to think well about the setup of these experiments since you only should change the algorithms, the other parameters should stay equal. Therefore, you should - preferably - use a large number of subjects (of different ages, sexes, etc. to cover many types of people), and try to prevent any bias; think about the order, how many games are played, location, time etc.
{ "domain": "ai.stackexchange", "id": 1315, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reinforcement-learning, rewards, performance, return, testing", "url": null }
It is currently 18 Oct 2017, 22:56 ### GMAT Club Daily Prep #### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email. Customized for You we will pick new questions that match your level based on your Timer History Track every week, we’ll send you an estimated GMAT score based on your performance Practice Pays we will pick new questions that match your level based on your Timer History # Events & Promotions ###### Events & Promotions in June Open Detailed Calendar # If p, x, and y are positive integers, y is odd, and p = x^2 Author Message TAGS: ### Hide Tags Senior Manager Joined: 22 Sep 2005 Posts: 278 Kudos [?]: 241 [17], given: 1 If p, x, and y are positive integers, y is odd, and p = x^2 [#permalink] ### Show Tags 14 Aug 2009, 12:49 17 KUDOS 88 This post was BOOKMARKED 00:00 Difficulty: 95% (hard) Question Stats: 40% (02:06) correct 60% (02:17) wrong based on 1935 sessions ### HideShow timer Statistics If p, x, and y are positive integers, y is odd, and p = x^2 + y^2, is x divisible by 4? (1) When p is divided by 8, the remainder is 5. (2) x – y = 3 [Reveal] Spoiler: OA Kudos [?]: 241 [17], given: 1 Manager Joined: 25 Jul 2009 Posts: 115 Kudos [?]: 262 [42], given: 17 Schools: NYU, NUS, ISB, DUKE, ROSS, DARDEN Re: PS: Divisible by 4 [#permalink] ### Show Tags 14 Aug 2009, 13:46 42 KUDOS 27 This post was BOOKMARKED netcaesar wrote: If p, x, and y are positive integers, y is odd, and p = x^2 + y^2, is x divisible by 4? (1) When p is divided by 8, the remainder is 5. (2) x – y = 3 SOL:
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 1, "lm_q1q2_score": 0.900529778109184, "lm_q2_score": 0.900529778109184, "openwebmath_perplexity": 2726.3281205360695, "openwebmath_score": 0.5733380317687988, "tags": null, "url": "https://gmatclub.com/forum/if-p-x-and-y-are-positive-integers-y-is-odd-and-p-x-82399.html?kudos=1" }
quantum-state, quantum-operation, nielsen-and-chuang as on the same page it states that if $\varepsilon(|{\psi_{j}}\rangle\langle{\psi_{j}}|) = p|{\psi_{j}}\rangle\langle{\psi_{j}}|+(1-p)\frac{I}{2}$ then $S(\varepsilon(|{\psi_{j}}\rangle\langle{\psi_{j}}|)) = H(\frac{1+p}{2})$, so $C(\varepsilon)=1-H(\frac{1-p}{2})$, which can't come about unless it's the entropy of the two states, not just the channel acting on them, or am I misreading this completely? Adding my comment as an answer: I think this is a typo. The equation contains a scalar, namely $S(\cdot)$ and an operator, the output of the channel $\mathcal{E}(\cdot)$ in linear combination (their dimensions do not match). Therefore, this has to be a typo (there are no hidden Identity operators in the scalar terms as is easy to check).
{ "domain": "quantumcomputing.stackexchange", "id": 1676, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-state, quantum-operation, nielsen-and-chuang", "url": null }
python, linked-list, interview-questions, queue I wrote the following tests to make sure that my code works a pretty comprehensive following unit test cases, and it passed against all test cases, so the code seems to be working fine. from queue import Queue import unittest class DblQueueTest(unittest.TestCase): def test_init(self): q = DeQueue() assert q.front() is None assert q.length() == 0 assert q.is_empty() is True def test_init_with_list(self): q = DeQueue(['A', 'B', 'C']) assert q.front() == 'A' assert q.length() == 3 assert q.is_empty() is False def test_length(self): q = DeQueue() assert q.length() == 0 q.enqueue_back('A') assert q.length() == 1 q.enqueue_front('B') assert q.length() == 2 q.dequeue_front() assert q.length() == 1 q.dequeue_back() assert q.length() == 0 def test_enqueue(self): q = DeQueue() q.enqueue_back('B') assert q.front() == 'B' assert q.length() == 1 q.enqueue_back('C') assert q.front() == 'B' assert q.length() == 2 q.enqueue_front('A') assert q.front() == 'A' assert q.length() == 3 assert q.is_empty() is False
{ "domain": "codereview.stackexchange", "id": 28092, "lm_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, linked-list, interview-questions, queue", "url": null }
javascript, html, css, event-handling </div> <script src="script.js"></script> </body> </html> How it works: The page content (were the dummy content is+navbar) is set at width="100%" when clicking on the hamburger menu, heres what happens 1) We store the user scroll position before changing anything 2) We set the page content to position="fixed" 3) We add the following property to the content: top="(page scroll position)"; 4) We make the sidenav go display="block" (if its not set as none when closed, sometimes, old browsers will click on the sidenav buttons even if closed) 5) The page content goes left:150px (Lets not forget that CSS makes it transition between the two stages which makes it look real good) 6) We also make the navbar go left:150px cause on old browsers, it doesnt moves (or glitches/stretches if youre on iOS 7 safari) 7) The sidenav is now scrollable and the page content isnt. Yay! 8) (optional) cool ass hover effect for items in the sidenav. When closing the sidenav Pretty much the reverse thing but we add those steps: 1) The animation between open and closed lasts 0.2 seconds. Keep that in mind. 2) We store the user's scroll position We add the following properties to the sidenav: 3) Position="fixed" 4) top="(scroll pos)" Wait 0.2 seconds 5) display="none" SO thats pretty much how it works... I may have brushed over some details tho, bare with me please, haha. Any suggestions? Ideas? Toughts? Do you think this could be used as production code? This code appears to function correctly but I wouldn't use it in production unless it is cleaned up. See the suggestions below. The first five variables are declared as globals:
{ "domain": "codereview.stackexchange", "id": 35426, "lm_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, html, css, event-handling", "url": null }
• @Wildcard: A simpler property than "variance" that is different between the two cases is "highest possible outcome" of the random variables. One chicken with 100 trials can end up unpecked 100 times with a small but nonzero probabilty. For one trial with 100 chickens, it is impossible for all 100 to be unpecked. May 19 '17 at 16:15
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9504109784205503, "lm_q1q2_score": 0.8290885218905153, "lm_q2_score": 0.8723473746782093, "openwebmath_perplexity": 508.7693879713699, "openwebmath_score": 0.7903633713722229, "tags": null, "url": "https://math.stackexchange.com/questions/2282622/expected-number-of-unpecked-chicks-nyt-article/2282639" }
- 3 years, 5 months ago Hm, is that a sufficient and necessary condition? What does that tell us about the complex numbers? Is there any possible description? Staff - 3 years, 5 months ago i think it's not possible .if condition 1 is true ,then 2 must be false and vice-verse - 3 years, 5 months ago $$z_{1}, z_{2}, z_{3},$$ and $$z_{4}$$ are vertices of a rectangle ABCD. Here is the proof(rigorous): In general, we can prove it for any $$|z| = a(>0)$$ rather than 1. First, you should know that the value of $$|p+q|^2 = 2|p^2|(1 + \cos \theta)$$, where $$\theta$$ is theta is the angle that complex numbers $$p$$ and $$q$$ lying on a circle centered about origin subtend at origin. Let $$\alpha$$ be the angle between lines OA and OB, and $$\beta$$ be the angle between lines OC and OD, $$z_{1}+ z_{2} = -(z_{3}+z_{4})$$ Taking modulus and squaring, we get: $$2|z^2|(1+ \cos \alpha|) = 2|z^2| (1 + \cos \beta)$$ $$\cos \alpha = \cos \beta$$ , or $$\alpha = 2 \pi - \beta$$ (not possible) Similarly, if $$\gamma$$ and $$\delta$$ are angles between $$OA$$ and $$OD$$ , and $$OB$$ and $$OC$$ respectively, we can prove that $$\gamma = \delta$$ Now, as $$\alpha, \beta$$, and $$\gamma, \delta$$ are pairs of vertically opposite angles, we get that Lines AOC , BOD are straight, i.e. the diagonals intersect at O.
{ "domain": "brilliant.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9449947148047778, "lm_q1q2_score": 0.8087748053319579, "lm_q2_score": 0.8558511414521922, "openwebmath_perplexity": 371.49817438799363, "openwebmath_score": 0.8998536467552185, "tags": null, "url": "https://brilliant.org/discussions/thread/system-of-complex-equations/" }
autocorrelation, cross-correlation, correlation Title: Two different definitions of cross-correlation I have come across two different definitions of the cross-correlation function: $$ R_{XY}(\tau) = \int_{-\infty}^{+\infty} x(t) y(t+ \tau) dt $$ and $$ R_{XY}(\tau) = \int_{-\infty}^{+\infty} x(t) y(t- \tau) dt $$ Are these two definitions equal? Also is $ R_{XY}(\tau) = R_{YX}(\tau)$? The first definition is the more common one. In its more general form it should read $$R_{XY}(\tau)=\int_{-\infty}^{\infty}x^*(t)y(t+\tau)dt\tag{1}$$ which also holds for complex-valued signals ( $^*$ denotes complex conjugation). If we use $\tilde{R}_{XY}(\tau)$ to denote the function defined by the second equation (and if we assume conjugation of $x(t)$ as in $(1)$), then we simply have $$R_{XY}(\tau)=\tilde{R}_{XY}(-\tau)\tag{2}$$ So the difference between the two definitions is trivial and just a matter of convention. However, they are obviously not the same, because we have $$R_{XY}(\tau)=R^*_{YX}(-\tau)\tag{3}$$ and, consequently, $$\tilde{R}_{XY}(\tau)=R^*_{YX}(\tau)\tag{4}$$ Note that for the auto-correlation (i.e., if $x(t)=y(t)$), both definitions are equivalent: $$R_{XX}(\tau)=\tilde{R}_{XX}(\tau)\tag{5}$$
{ "domain": "dsp.stackexchange", "id": 6944, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "autocorrelation, cross-correlation, correlation", "url": null }
measurements, remote-sensing, glaciology, ice-sheets, radar Ice, on the other hand reacts differently depending on the radar's frequency. It reflects high-frequency radio waves, but despite being solid, lower frequency radar can pass through ice to some degree. This is why MCoRDS uses a relatively low frequency—between 120 and 240 MHz. This allows the instrument to detect the ice surface, internal layers of the ice and the bedrock below. "To sound the bottom of ice you have to use a lower frequency," said John Paden, CReSIS scientist. "Too high a frequency and signal will be lost in the ice."
{ "domain": "earthscience.stackexchange", "id": 1693, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "measurements, remote-sensing, glaciology, ice-sheets, radar", "url": null }
game-ai, go For such NP (or combinatorial) problems, the solution is to lower the computational complexity at the cost of introducing inaccuracies in the solution. Thus not computing a perfect (optimal) solution anymore but, instead, an approximated (or locally optimal) one. The way you can achieve this is, for example, by using search heuristics that help to cut down the search space (by pruning some sub-trees) thus allowing to solve larger $N$, or to approximate more severely like sampling a single (or few) paths in the full tree of possibilities like MTCS (monte-carlo tree search, which also powers AlphaGo) does. Another example is deep learning, that allows to solve hard but also difficult to code problems by learning from data. DL models yield an approximated solution that is usually (or better said always, in practice) a local optimum. You can control the goodness of the solution by the number of epochs for example. Therefore, a better model may allow to get the same solution in few epochs or even a better one - but the point is that it's still approximated. Thus, DL can be seen as a smart way to approximate a brute-force search. So to conclude better (learning) algorithms allow to calculate better solutions in less time, but the problem remains intractable. Therefore is best to invest time in inventing better/faster/more accurate (approximated) algorithms rather than waiting to get a better CPU. (As a side note, in theory and in ideal conditions, quantum computers may process an exponential amount of information, potentially solving combinatorial problems in linear or so time: be aware that I'm not a big expert. Indeed, in practice you have few qbits that are partially interconnected and you need to deal with errors and external interference, and as well approximation of operations with the quantum gates. Maybe in the future quantum computers would allow to solve for very large $N$, with good solutions too, but I think that it would still be possible to hit the hardware limit by finding a sufficiently large $N$ that is just too much to solve for.)
{ "domain": "ai.stackexchange", "id": 3844, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "game-ai, go", "url": null }
optimization, dynamic-programming, linear-algebra Informal proof Considering the simplest case using two matrices, $(AB)^n$, we note that $A$ and $B$ have dimension $X \times Y$ and $Y \times X$ respectively. Any product using $A$ and $B$ has one of the following dimensions: $X \times Y$ $Y \times X$ $Y \times Y$ $X \times X$ We have either $X < Y$ or $Y ≤ X$. Assumption 1a): $X < Y$ $AB$ has dimension $X \times X$, and this ordering is guaranteed to be optimal from a bottom-up approach. Any other configuration of $A$ and $B$ is either equally good, or worse. Thus, the problem is optimally solved as $(AB)^n$. Assumption 1b): $Y ≤ X$ $BA$ has dimension $Y \times Y$. This is the optimal ordering for all products involving $A$ and $B$. Thus, the solution is optimally found as $A(BA)^{n-1}B$. This concludes the proof, and we have only looked at the two orderings found in $ABAB$, the square problem. Using more matrices, the argument is similar. Perhaps an inductive proof is possible? The general idea is that solving the MCM for the square will find the optimal size for the operations with all involved matrices considered. Case study: julia> a=rand(1000,2); julia> b=rand(2,1000); julia> c=rand(1000,100); julia> d=rand(100,1000); julia> e=rand(1000,1000);
{ "domain": "cs.stackexchange", "id": 9058, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optimization, dynamic-programming, linear-algebra", "url": null }
javascript, beginner, html, css </html> Lets start with the first chunk of code: var firstColumn; var lastColumn; { let tables=document.getElementsByTagName("table"); var width=tables[0].rows[0].cells.length; let td=document.getElementsByTagName("td"); for (let i=0,len=td[0].parentNode.cells.length;i<len;++i) { if (firstColumn===undefined) firstColumn=i; lastColumn=i; } for (let i = 0;i < td.length; ++i) { td[i].onkeydown = kbhandle; if (!td[i].className) td[i].setAttribute("contentEditable", true); } } The extra block statement makes the code slightly harder to read. It's important to remember that tables and td will not be accessible outside the block, but width will. That might be the intended behavior here, but using extra blocks like this could easily get you trouble. The width variable is never used after being set. It would seem like firstColumn is always set to 0 no matter what. Setting it with an if statement during the for loop is unnecessary. You can just set it to 0 when you initialize it. In fact that whole first for loop is unnecessary, since you can just set last column to td[0].parentNode.cells.length -1
{ "domain": "codereview.stackexchange", "id": 25790, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, beginner, html, css", "url": null }
Setting $Q=5$ as in the question we obtain for $N=7$ the sequence $$1, 2, 5, 10, 21, 41, 65, 97, 131, 148, 148, 131,\ldots$$ for $N=8$ the sequence $$1, 3, 11, 52, 252, 1413, 7812, 41868, 207277, 936130, 3826031,\\ 14162479,\ldots$$ for $N=9$ the sequence $$1, 4, 20, 155, 1596, 20528, 282246, 3791710, 47414089, 542507784,\\ 5659823776,53953771138,\ldots$$ and finally for $N=10$ the sequence $$1, 5, 28, 324, 5750, 142148, 3937487, 108469019, 2804300907,\\ 66692193996,1452745413957, 29041307854703,\ldots.$$ To illustrate the good complexity of this algorithm here is the sequence for $N=13:$ $$1, 5, 42, 813, 34871, 2777978, 304948971, 37734074019,\\ 4719535940546, 566299855228261, 63733180893169422,\\ 6674324951638852138,\ldots$$ Finally we obtain for $N$ variable with $Q=5$ and $T=3$ the sequence $$0, 0, 0, 0, 0, 1, 5, 11, 20, 28, 35, 39, 42, 43,\\ 44, 44, 44, 44,\ldots$$ The Maple code to compute these was as follows: with(combinat); with(numtheory); pet_flatten_term := proc(varp) local terml, d, cf, v; terml := [];
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682461347528, "lm_q1q2_score": 0.8658627922254889, "lm_q2_score": 0.8757869948899665, "openwebmath_perplexity": 1499.359269412658, "openwebmath_score": 0.6212775707244873, "tags": null, "url": "https://math.stackexchange.com/questions/498954/counting-number-of-distinct-systems" }
functions can be formed that will be orthogonal to each other. Because we assumed , we must have , i.e. Eigenvalues and Eigenvectors of an operator: Consider an operator {eq}\displaystyle { \hat O } {/eq}. We can also look at the eigenfunctions of the momentum operator. Lecture 13: Eigenvalues and eigenfunctions An operator does not change the ‘direction’ of its eigenvector In quantum mechanics: An operator does not change the state of its eigenvectors (‘eigenstates’, ‘eigenfunctions’, ‘eigenkets’ …) Conclusion: How to find eigenvectors: How would one use Mathematica to find the eigenvalues and eigenfunctions? Assume we have a Hermitian operator and two of its eigenfunctions such that Such an operator is called a Sturm -Liouville operator . In fact we will first do this except in the case of equal eigenvalues. 1.2 Eigenfunctions and eigenvalues In general, when an operator operates on a function, the outcome is another function. Another example of an eigenfunction for d/dx is f(x)=e^(3x) (nothing special about the three here). L.y D2.y d d 2 x2 y λ'.y y( 1) y(1) 1 or any symmetric boundary condition I'm struggling to understand how to find the associated eigenfunctions and eigenvalues of a differential operator in Sturm-Liouville form. In the case of degeneracy (more than one eigenfunction with the same eigenvalue), we can choose the eigenfunctions to be orthogonal. We can write such an equation in operator form by defining the differential operator L = a 2(x) d2 dx2 +a 1(x) d dx +a 0(x). Eigenvalues and Eigenfunctions of an Integral Operator Analogous to eigenvalues and eigenvectors of matrices, satisfying we can consider equations of the form Here T is a general linear operator acting on functions, meaning it maps one function to another function. Determine whether or not the given functions are
{ "domain": "bullies2buddies.info", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668662546613, "lm_q1q2_score": 0.8067047348003024, "lm_q2_score": 0.8221891327004133, "openwebmath_perplexity": 543.4626258310159, "openwebmath_score": 0.954338550567627, "tags": null, "url": "https://bullies2buddies.info/9egzorx/how-to-find-eigenfunctions-of-an-operator-6b4b1c" }
cc.complexity-theory, reference-request, computable-analysis Title: For two representations of finite length of one computable number are there $P$-time algorithms that compute one from another Any computable number may have different representations of finite length . For example,$\sqrt{2}$ may be represented as root of equation, or as a (shortest for a universal Turing Machine)program of finite length that outputs every bit sequently in infinite time. For two representations of finite length of one computable number, are there $P$-time algorithms that compute one from another? No, it is undecidable. Imagine a TM that outputs a sequence $0.1111\ldots$ that may be finite or not. If it is finite, the conversion algorithm should give some fraction like $\frac{11\ldots11}{10\ldots000}$. If it is infinite (the TM doesn't halt) then the output should be $\frac{1}{9}$. Any program that converts between the $TM$ representation of a number and a fraction would be able to decide the halting problem.
{ "domain": "cstheory.stackexchange", "id": 2974, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, reference-request, computable-analysis", "url": null }
thermodynamics, black-holes For completeness, there is one more final possibility that I've ignored until now. If the initial energy density is very large, or the volume very small, the Schwartzchild radius of the system will be larger than V, meaning that when you form a black hole it is larger than the box itself. If this is the case, then this whole notion of an isolated black hole breaks down. This happens at $V_s=\frac{8 G^3 E_0^3}{c^{12}}$.
{ "domain": "physics.stackexchange", "id": 70979, "lm_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, black-holes", "url": null }
thermodynamics, water, pressure, hydrogen Title: Water, can it break through temperature? If water is heaten up to ridicilously high temperatures, is it possible for the atoms in the molecules to lose their bonds? And if it is possible, isn't this some kind of chain-reaction? Like you heat up water --> steam, keep heating it, then wamm you get 1 oxygen and 2 hydrogen atoms, and at that temperature they most likely will self combust creating more heat to make more steam turn into oxygen & hydrogen etc. Extra question: If you got 1 mole oxygen and 2 mole hydrogen in a container, will it turn into 1 mole water? Or does the pressure matter? Or does the temperature matter? Whenever you have a chemical reaction like $2H_2O \rightleftharpoons 2H_2 + O_2$, it goes both ways. In this reaction, the products on the right have more chemical energy, so going to the right requires energy input, and going to the left releases energy, by the same amount. Under any conditions, the reaction is running in both directions, but usually at different rates. So in any situation, you will have a predominance of one side over the other. By changing the temperature and/or pressure, you can change the relative reaction rates, but in no case is energy created or destroyed.
{ "domain": "physics.stackexchange", "id": 4431, "lm_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, water, pressure, hydrogen", "url": null }
classical-mechanics, experimental-physics, home-experiment Title: Can force be transferred through objects in a chain to the last object without any displacement of objects in the middle? sorry for terrible graphical representation, I did an experiment, i took 6 coins fixed 4 of them in one place by placing some real heavy objects on them , then i took a 5th coin placed it in the final position at the last , all these coins were touching each other and only the fifth one was free to move . Now i took a striker (6th coin) and collided it with this chain of coins and every time the final coin moved as if the force was transmitted through all these coins in the middle to the last one while themselves NOT(assumption) moving at all . How can this happen how can the force be transmitted to the final coin if the coins in the middle didn't moved at all the experiment works with as much as 10 fixed coins in place of 4 . By far the only explanation i can give is that the coins in the middle do move(very little ) but cant prove this theory . This is similar, but not quite identical to Newton's cradle, with the difference being the heavy objects placed on the middle coins. To explain things, first consider the simpler case where there is no heavy object on top of the coins, and suppose the 5 nonmoving coins in "frame 1" are separated by a distance $L$. When two objects of mass $m$ and velocities $v_1$ and $v_2=0$ undergo a perfectly elastic collision, there is no energy loss to heat, and so solving energy and momentum conservation $\frac{1}{2}m_1 v_1^2+0=\frac{1}{2} m_1 {v'_1}^2+\frac{1}{2}m_2 {v'_2}^2$ and $m_1 v_1+0=m_1 v'_1+m_2 v'_2$ for the final velocities $v'_1$ and $v'_2$ yield $$v'_1=0 \mbox{ and }v'_2=v_1.$$
{ "domain": "physics.stackexchange", "id": 10485, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, experimental-physics, home-experiment", "url": null }
homework-and-exercises, general-relativity, gravity, lagrangian-formalism, variational-calculus where the first term vanishes in the integral and we conclude that $$D_{\mu}(e \ e^{[\mu}{}_{a}e^{\nu]}{}_b) =0.$$ however, I do not see how that brings us the proposed solution. Any hints and help to reach the conclusion would be much appreciated. Edit 2: I found a source, which skips almost all actual steps of the derivation, but gave one good hint and an intermediate result. From the definition of the determinant $e$, we can conclude up to factors that: $$ e \ e^{[\mu}{}_{a}e^{\nu]}{}_b \sim \varepsilon_{abcd}\varepsilon^{\mu\nu\rho\sigma} e^{c}{}_\rho e^d{}_\sigma, $$ which then would give $$D_{\mu}(\varepsilon_{abcd}\varepsilon^{\mu\nu\rho\sigma} e^{c}{}_\rho e^d{}_\sigma) = 0.$$ If now the covariant derivative of the $\varepsilon$s would be zero, we would arrive at $$\varepsilon_{abcd}\varepsilon^{\mu\nu\rho\sigma} D_{\mu} (e^{c}{}_\rho e^d{}_\sigma) = 0,$$ which by anti symmetry immediately gives $$\varepsilon_{abcd}\varepsilon^{\mu\nu\rho\sigma} D_{\mu} (e^{c}{}_\rho) e^d{}_\sigma = 0,$$ which according to the source, eq. (2.14) is not only the case, but also implies the wanted equations of motion!
{ "domain": "physics.stackexchange", "id": 75153, "lm_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, general-relativity, gravity, lagrangian-formalism, variational-calculus", "url": null }
lisp, scheme, racket (if (char-numeric? first) (--read-number (--char->number first)) '())) (define (-tokenize-openparen first) (if (equal? first #\() (list #\( (read-char)) '())) (define (-tokenize first endchar) (if (equal? first endchar) '() (let ([operator (-tokenize-operator first)] [number (-tokenize-number first)] [openparen (-tokenize-openparen first)]) (cond ([pair? operator] (cons (car operator) (-tokenize (cadr operator) endchar))) ([pair? number] (cons (car number) (-tokenize (cadr number) endchar))) ([pair? openparen] (list (-tokenize (cadr openparen) #\)))) (else (tokenize)))))) (let ([first (read-char)]) (-tokenize first #\newline))) ;; parsing and evaluation function (define (reduce tokens) (define (-operator-priority op) (cond ([ormap (lambda (p) (equal? p op)) (list + -)] 1) ([ormap (lambda (p) (equal? p op)) (list * /)] 2))) (define (-rvalue list max-priority) (define (--lower-parentheses parenthesed-expression next-tokens) (let ([paren-result (car (-rvalue parenthesed-expression 0))]) (-rvalue (cons paren-result next-tokens) max-priority)))
{ "domain": "codereview.stackexchange", "id": 3657, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lisp, scheme, racket", "url": null }
moveit, ros-kinetic, ur5 Originally posted by shu on ROS Answers with karma: 64 on 2019-11-25 Post score: 1 Can't accept new action goals. Controller is not running. The "controller" here is most likely the JointTrajectoryController (see here where it prints that message). Even though the spawner has tried to start it, it may not actually be running, probably due to the robot controller (ie: the UR controller) not being in the correct state. Make sure you have a TP program running that starts the External Control mode. See UniversalRobots/Universal_Robots_ROS_Driver#4 for an issue about the exact same problem. There is an open PR to add a FAQ section to the ur_robot_driver documentation which also describes this: UniversalRobots/Universal_Robots_ROS_Driver#44. Finally: always copy-paste verbatim console output into your question. It's very difficult to help you if you paraphrase errors or don't show context. Originally posted by gvdhoorn with karma: 86574 on 2019-11-25 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 34054, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "moveit, ros-kinetic, ur5", "url": null }
particle-physics, mass, electrons, standard-model, protons Theoretical Proton to Electron Mass Ratio Theoretically, you first need to understand a basic principal of particle physics. Mass and Energy take on very similar meanings in particle physics. In order to simplify calculations and use a common set of units in particle physics variations of $\mathrm{eV}$ are used. Historically this was developed from the usage of particle accelerators in which the energy of a charged particle was $\mathrm{qV}$. For electrons or groups of electrons, $\mathrm{eV}$ was convenient to use. As this extends into particle physics as a field, the convenience remains, because anything develop theoretically needs to produce experimental values. Using variations of $\mathrm{eV}$ thus removes the need for complex conversions. These "fundamental" units, called the planck units, are: $$\begin{array}{|c|c|c|} \hline \text{Measurement} & \text{Unit} & \text{SI value of unit}\\ \hline \text{Energy} & \mathrm{eV} & 1.602176565(35) \times 10^{−19} \, \mathrm{J}\\ \hline \text{Mass} & \mathrm{eV}/c^2 & 1.782662 \times 10^{−36} \, \mathrm{kg}\\ \hline \text{Momentum} & \mathrm{eV}/c & 5.344286 \times 10^{−28} \, \mathrm{kg \cdot m/s}\\ \hline \text{Temperature} & \mathrm{eV}/k_B & 1.1604505(20) \times 10^4 \, \mathrm{K}\\ \hline \text{Time} & ħ/\mathrm{eV} & 6.582119 \times 10^{−16} \, \mathrm{s}\\ \hline \text{Distance} & ħc/\mathrm{eV} & 1.97327 \times 10^{−7} \, \mathrm{m}\\ \hline \end{array}$$ Now then, what's the rest energies of a proton and electron?
{ "domain": "physics.stackexchange", "id": 51164, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, mass, electrons, standard-model, protons", "url": null }
the precise integral in 1809. This depends on finding a vector field whose divergence is equal to the given function. Accordingly, its volume is the product of its three sides, namely dV dx dy= ⋅ ⋅dz. Triple Integral Spherical Coordinates Pdf Download >>> DOWNLOAD (Mirror #1). Numerical Integration and Differentiation Quadratures, double and triple integrals, and multidimensional derivatives Numerical integration functions can approximate the value of an integral whether or not the functional expression is known:. 1 DOUBLE INTEGRALS OVER RECTANGLES TRANSPARENCIES AVAILABLE #48 (Figures 4 and 5), #49 (Figures 7 and 8), #50 (Figure 11), #51 (Figures 12 and 13) SUGGESTED TIME AND EMPHASIS 1 2 –1 class Essential Material POINTS TO STRESS 1. V = \iiint\limits_U {\rho d\rho d\varphi dz}. The cylindrical coordinate system describes a point (x,y,z) in rectangular space in terms of the triple (r,θ,z) where r and θ are the polar coordinates of the projection. TRIPLE INTEGRALS IN CYLINDRICAL AND SPHERICAL COORDINATES 5 3. Challenge: 11,23 4. Applications of Double/Triple Integrals. Such integrals arise whenever two functions are multiplied, with both the operands and the result represented in the Legendre polynomial basis. dimensional integrals. dimensional domain. Just as for double integrals, a region over which a triple integral is being taken may have easier representation in another coordinate system, say in uvw-space, than in xyz-space. Try to visualize the 3D shape if you can. P 1 f(P1)=14kg=m3 f(P2)=7kg=m3 P 2 P 3 f(P3)=9kg=m3 P 4 f(P4)=21kg=m3 Suppose f 2C(R3) measures density (kg=m3) throughout W. To obtain double/triple/multiple integrals and cyclic integrals you must use amsmath and esint (for cyclic integrals) packages. 5 36 Triple Integral Strategies The hard part is guring out the bounds of your integrals. Let D be the half-washer 1 x2 + y2 9, y 0, and let E be the solid region above D and below the graph z = 10 x2
{ "domain": "bollola.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808741970027, "lm_q1q2_score": 0.8534298480576168, "lm_q2_score": 0.8705972650509008, "openwebmath_perplexity": 1024.54283541851, "openwebmath_score": 0.9065842032432556, "tags": null, "url": "http://cghb.bollola.it/triple-integral-pdf.html" }
ros, catkin, cmake Originally posted by gvdhoorn with karma: 86574 on 2020-06-13 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by hiro1117 on 2020-06-13: Thank you very much for your comment and help!! I just ran the code and installed catkin_pkg and it ran perfect!! Thank you so much!! Comment by Dirk Thomas on 2020-06-15: On Ubuntu / Debian you shouldn't install Python packages with pip if there is an equivalent .deb. Simply because any new releases available from .deb won't be visible on your system since the pip package (which don't get updated automatically) will take precedence. You should pip3 uninstall catkin_pkg again and apt install python3-catkin-pkg-modules instead (the -module packages for Python 2 and 3 are side-by-side installable. Comment by gvdhoorn on 2020-06-15: Python 3.6.9 does not appear to be a version of Python 3 on Ubuntu provided by Canonical (or at least: I cannot find it listed here: packages.ubuntu.com. Not in updates, nor in Eoan or newer). Wouldn't the apt package only work for the system packaged version of Python 3? That's why I suggested using pip3 in this case. Edit: ah, it's the python3.6 package on Bionic. Comment by gvdhoorn on 2020-06-15: I've just updated my answer. python3.6 does have its own directory under /usr/lib, but also loads the packages from /usr/lib/python3. That's the reason this can work with the .deb`.
{ "domain": "robotics.stackexchange", "id": 35118, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, catkin, cmake", "url": null }
special-relativity, mass-energy, speed, approximations For example the third term in the expansion would be $\frac{3}{8} \frac{v^4}{c^2}$ which would become significant, I'm assuming, somewhere around $v=\sqrt c$. The relation $v=\sqrt{c}$ doen't make sense, because both $v$ and $c$ have units of velocity. On the other hand, we could say that the third term becomes relevant when it is, for example, at least ten times smaller than the second term: $$ \frac{3}{8} \frac{v^4}{c^2}\ge 0.1\ \frac{1}{2}v^2 $$ which is the same as $v\ge \sqrt{2/15}\ c\approx0.37c$.
{ "domain": "physics.stackexchange", "id": 30177, "lm_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, mass-energy, speed, approximations", "url": null }
ros-melodic also i got "" for rosverion ros I'm not sure why you feel that is a problem. I get the exact same thing. if you want to know which ROS version you have installed, you should use rosversion -d (where -d is short for --distro). Comment by Addy on 2020-04-07: It took time like its installing for first time.. thats not a problem..im happy thats its installed now.. how do u want me to contine now Comment by gvdhoorn on 2020-04-07: Looks like things are installed. You could -- just to make sure -- check whether you still have the Python packages installed (which are not part of melodic_desktop_full) by following the rest of the installation instructions. It does seem like you've "fixed" your install now. Keep an eye out for any commands not working. It could be that not all packages have been reinstalled. Comment by Addy on 2020-04-07: Thanks for the help. i dont know how to check if those packages installed or not..will it be a problem if i install them anyway even when i have those packages Comment by gvdhoorn on 2020-04-07:\ i dont know how to check if those packages installed or not well, you'd run into the same problem with missing commands again. will it be a problem if i install them anyway even when i have those packages Probably not.
{ "domain": "robotics.stackexchange", "id": 34709, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic", "url": null }
haskell, monads, telegram instance ToJSON PostMessage where toJSON = genericToJSON defaultOptions { omitNothingFields = True } Usage Here is how to use the framework: you write a number of handlers, create a controller with these handlers and start polling messages to your bot from Telegram. You then pass each new message to Handler. Handlers/NumberGameHandler.hs {-# LANGUAGE FlexibleContexts #-} module Handlers.NumberGameHandler (numberGameHandler) where import Control.Monad.IO.Class (liftIO) import System.Random (randomRIO) import Text.Read (readMaybe) import Handler numberGameHandler :: Handler numberGameHandler = Handler { command = "guess" , handleMessage = doHandleMessage , handleResponse = Just doHandleResponse , handleAnswer = Nothing } doHandleMessage :: String -> HandlerAction () doHandleMessage _ = do number <- liftIO (randomRIO (1, 10) :: IO Int) save "number" number reply "Guess a number between 1 and 10" doHandleResponse :: String -> HandlerAction () doHandleResponse message = do guess <- readNumber message number <- recall "number" case compare guess number of LT -> reply "My number is greater" GT -> reply "My number is less" EQ -> reply "Correct!" >> deleteSession where readNumber :: String -> HandlerAction Int readNumber message = maybe (throwError "This is not a number") return $ readMaybe message Main.hs module Main where import Control.Monad (unless) import Control.Monad.IO.Class (liftIO) import Config (ConfigT, runConfigT, loadConfig) import Handlers.PingHandler import Handlers.NumberGameHandler import Controller (Controller(..), processUpdate) import qualified Telegram (getUpdates) import qualified Telegram.Types as TTypes (Update(..), GetMessage(..)) controller = Controller { handlers = [ pingHandler , numberGameHandler ] }
{ "domain": "codereview.stackexchange", "id": 39399, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "haskell, monads, telegram", "url": null }
This is a general approach that will work in a wide variety of settings. In this particular problem, however, there is a shortcup. Each sequence of likes and dislikes can be paired with its opposite, obtained by turning each $L$ into a $D$ and vice versa. Thus, $LLDLD$, for instance, is paired with $DDLDL$. Each pair contains one sequence with $3$ or more likes and one with $2$ or fewer, so exactly half of all sequences have $3$ or more likes, and the probability of getting one of these is therefore $\frac12$, since all sequences are equally likely. -
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822877018151065, "lm_q1q2_score": 0.8007928417962344, "lm_q2_score": 0.8152324826183822, "openwebmath_perplexity": 195.4058701557295, "openwebmath_score": 0.8453946709632874, "tags": null, "url": "http://math.stackexchange.com/questions/289380/probability-if-i-have-a-friend-that-likes-half-of-the-food-he-tries-what-is-th" }
performance, programming-challenge, haskell Title: Advent of Code 2018 day 1 part 2: find the first repeated number after some increases and decreases Here is the problem: Part Two You notice that the device repeats the same frequency change list over and over. To calibrate the device, you need to find the first frequency it reaches twice. For example, using the same list of changes above, the device would loop as follows: Current frequency 0, change of +1; resulting frequency 1. Current frequency 1, change of -2; resulting frequency -1. Current frequency -1, change of +3; resulting frequency 2. Current frequency 2, change of +1; resulting frequency 3. (At this point, the device continues from the start of the list.) Current frequency 3, change of +1; resulting frequency 4. Current frequency 4, change of -2; resulting frequency 2, which has already been seen. In this example, the first frequency reached twice is 2. Note that your device might need to repeat its list of frequency changes many times before a duplicate frequency is found, and that duplicates might be found while in the middle of processing the list. Here are other examples: +1, -1 first reaches 0 twice. +3, +3, +4, -2, -4 first reaches 10 twice. -6, +3, +8, +5, -6 first reaches 5 twice. +7, +7, -2, -7, -4 first reaches 14 twice. What is the first frequency your device reaches twice? And here is my solution: module Main where import Data.List.Split parseString :: Integer -> String -> Integer parseString acc s = let num = read $ tail s :: Integer operator = head s in if operator == '+' then acc + num else acc - num findFreq :: Integer -> [Integer] -> [String] -> (Integer, Integer, [Integer]) findFreq curr acc [] = (0, curr, acc) findFreq curr acc (x:xs) = let next = parseString curr x in if next `elem` acc then (next, 0, []) else let f = acc ++ [next] in findFreq next f xs
{ "domain": "codereview.stackexchange", "id": 32765, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, programming-challenge, haskell", "url": null }
discrete-signals, continuous-signals, kalman-filters Title: Discrete Kalman filter for a continuous system The question is related to the implementation of a discrete kalman filter given a description of the system model in continuous time. I will give an example. Suppose we have a mass, spring and damper system as below:
{ "domain": "dsp.stackexchange", "id": 7610, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "discrete-signals, continuous-signals, kalman-filters", "url": null }
speech-recognition, smoothing, speech $$ f_s[n] = 0.1 f[n-2] + 0.8 f[n-1] + 0.1 f[n] $$ $f_s[n]$ is the smoothed version of the discrete-time input sequence $f[n]$, generated by passing $f[n]$ through an FIR filter with the coefficients $[0.1, 0.8, 0.1]$. The frequency response of this filter is as follows:
{ "domain": "dsp.stackexchange", "id": 508, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "speech-recognition, smoothing, speech", "url": null }
c#, game, unity3d onto the ObjectPool class: So, similar story with the private fields and so forth. aside form that, I have always hated the line: GameObject obj = (GameObject)Instantiate(objectToPool); equally as bad as the resource load line above, take both. make yourself some extension methods ro a helper class or something. For the non unity-ers you may be wondering why so extreme for one line, well, because once you create a gameObject in unity there is a 90% chance you will add or get a component. making an easier method to create a configured gameObject in a well phrased single function is a good idea. as for error checking...... you are able to call "GetPooledObject" and if you didn't call LateStart, the list would be null and throw an exception, lazy load your list. List<GameObject> PooledObjects { get { return _pooledObjects ?? (_pooledObjects = new List<GameObject>(); ) } } so basically, if the pooledObjects doesn't exist, create it, then...return it. If it already exists...just return it. this is just me being a bit picky, (as i am a linq fan) but you can simplify the GetPooledObject to: PooledObjects.Where(x=>!x.activeInHierarchy).First(); I would also argue you could separate out the pool item from the look a little. void AddPoolItem(){} and then use: for(int i = 0; i < pooledAmount; i++) AddPoolItem(); easier on the eyes... MachineGun is next.... privatize fields as before. variablize the magic strings, either make them passable parameters or constants. (will you ALWAYS have "FirePoint" in your scene and will it always be called that?) as for unity specific, GameObject.Find is SLOWWWWWWWWW. and a bad idea to traverse the whole tree to find something. Id made the poolManager a singleton, have it set itself on the Awake() function,
{ "domain": "codereview.stackexchange", "id": 14424, "lm_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#, game, unity3d", "url": null }
c#, homework Console.Write("ii) Cellphone and Telephone: "); monthlyExpenses.Add("Phone", GetExpenses()); expensesWarning(monthlyExpenses); Console.Write("ii) Other expenses: "); monthlyExpenses.Add("Other", GetExpenses()); expensesWarning(monthlyExpenses); Console.WriteLine("Would you like to rent ('1') or buy property ('2') ?: "); option = GetOption(); if (option == 1) // User enters the value of their rent per month { RentPayment(); expensesWarning(monthlyExpenses); } else // User enters details of the house they will be applying for a loan to buy a house { HomeLoanPayment(); expensesWarning(monthlyExpenses); } Console.WriteLine("Would you like to buy a vehicle? ('1' Yes) or ('2' NO): "); option = GetOption(); if (option == 1) { VehiclePayment(); expensesWarning(monthlyExpenses); } DisplayExpenses(); } private void DisplayExpenses() { Console.WriteLine($"Your remaining month for the month after all deductions is: {GetRemainingMoney():C2}"); Console.WriteLine("Your monthly expenses in descending order:"); Console.WriteLine("--------------------------------------------"); Console.WriteLine("Expense \t Amount"); Console.WriteLine("--------------------------------------------"); monthlyExpenses.OrderBy(key => key.Value); for (int i = 0; i < monthlyExpenses.Count; i++) {
{ "domain": "codereview.stackexchange", "id": 42990, "lm_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#, homework", "url": null }
quantum-algorithms, bernstein-vazirani-algorithm Title: Applicability of the Bernstein-Vazirani to different modulus The Bernstein Vazirani can solve s for f(x) = s(dot product) x mod 2. My question is if its possible to modify this to work for mod 3,4 etc. Is this even possible? Edit: Whats the probability of the modified algorithms success? In the case where the modulus you want to take is even, you can return to standard Benstein-Vazirani: If you're doing $f(x)=s\cdot x\text{ mod }2p$, then this has a $k$-bit output and the least significant bit of this is just $s\cdot x\text{ mod }2$. You can use the standard Bernstein-Vazirani algorithm. You just have to be careful that the extra $k-1$ bits don't prevent the interference. I believe the trick is that on the $k$-qubit register, you input the state $|-\rangle$ on the least significant bit, and $|+\rangle$ on all the others. This means that you only get the phase kick-back from the one bit you're interested in.
{ "domain": "quantumcomputing.stackexchange", "id": 3736, "lm_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-algorithms, bernstein-vazirani-algorithm", "url": null }
c, parsing return sectionentry; } enum parser_states entryname_state(char next_char, struct parser_state* pastate) { if(next_char == '\n') { // this is an error; data are discarded pastate->buffer_cursor = 0; return linestart; } if(next_char == ';' || next_char == '[' || next_char == ']') { // this is an error; data are discarded pastate->buffer_cursor = 0; return comment; } if(next_char != '=') pastate->buffer[pastate->buffer_cursor++] = next_char; // protection from buffer overflow if(pastate->buffer_cursor > 254) { // too long, discard everything pastate->buffer_cursor = 0; return comment; }
{ "domain": "codereview.stackexchange", "id": 16308, "lm_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 }
quantum-mechanics, homework-and-exercises, quantum-information, density-operator, bloch-sphere $$\rho = \frac{1}{2}(I +r_x\sigma_x + r_y\sigma_y+r_z\sigma_z),$$ and if $r_1^2+r_2^2+r_3^2=1$, then the density matrix represents a pure state. If $r_1^2+r_2^2+r_3^2<1$, it is a mixed state. The form we're given is $$\rho = \alpha\sigma_0 + \beta \hat{\vec{n}} \cdot \vec{\sigma}= \alpha I + n_x\beta\sigma_x + n_y\beta\sigma_y + n_z\beta\sigma_z = \frac{1}{2} ( 2\alpha I + 2n_x\beta\sigma_x + 2n_y\beta\sigma_y + 2n_z\beta\sigma_z)$$ Using this method, it is clear that $\alpha = \frac{1}{2}$, and we have that $r_1^2+r_2^2+r_3^2 = (2\beta n_x)^2 + (2\beta n_y)^2 + (2\beta n_z)^2 = 4\beta^2$. Since we want this to equal $1$, we have $1=4\beta^2 \implies \beta = \frac{1}{2},$ or $\beta= -\frac{1}{2}$. Hope this helps.
{ "domain": "physics.stackexchange", "id": 86672, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, homework-and-exercises, quantum-information, density-operator, bloch-sphere", "url": null }
seurat, single-cell, clustering Error in `[[.Seurat`(x, i, drop = TRUE) : Cannot find 'meta.data' in this Seurat object Calls: lapply ... lapply -> FUN -> mean -> $ -> $.Seurat -> [[ -> [[.Seurat and p3 <- FeaturePlot(seurat_object, features=c('percent.mito'), cols = c("gold", "firebrick4"), pt.size=0.5, label=TRUE, repel=TRUE) p3 <- lapply(X = seurat_object, FUN = function(x) mean(seurat_object$meta.data$seurat_clusters)) CombinePlots(plots = p3) Error in as.list.default(X) : no method for coercing this S4 class to a vector Calls: lapply -> lapply -> as.list -> as.list.default``` If anyone can provide some guidance -- you will be inducted into my personal hall of fame. :) Thank you for your time. P.S. I am using Seurat 3.1 Update: md = surate_object@meta.data md_mean <- ddply(md, .(seurat_clusters), summarize, mean_mito_per=mean(percent.mito)) This was not the approach I was hoping for but I have the values -- which when expanded to the length of the original df, I can insert it into a free slot in the seurat_object. If anyone has a better approach I would love to hear it. UPDATE: Using @PPK's approach # First the cluster annotation and the tsne embeddings are merged label.df <- cbind(as.data.frame(seurat_object@meta.data), as.data.frame(seurat_object@reductions$tsne@cell.embeddings))
{ "domain": "bioinformatics.stackexchange", "id": 1606, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "seurat, single-cell, clustering", "url": null }
newtonian-gravity Title: Jumping and falling force same? When someone tries to jump he/she can only jump for a height of few inch and doesnt break his leg which requires a small force but when someone falls from a small building he/she will have much higher impact force so basically why the person that falls (has higher impact force) doesnt break his leg, why someone can withstand so much force but cant even jump for a few inchs. For example lets assume a bodybuilder withstands 4000newton when he/she falls. I think you are asking if we can fall, say, 10 feet and not break a leg, why can we not jump 10 feet. Our muscles are used for jumping, and our bones can normally, if in good health, withstand more pressure than our muscles can deliver, otherwise we could break a leg climbing stairs quickly.
{ "domain": "physics.stackexchange", "id": 59462, "lm_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-gravity", "url": null }
r, rna-seq I get this error: Error in cor(exprs(gse), use = "c") : no complete element pairs I also tried this: corMatrix <- cor(exprs(gse),use="c", use="complete.obs") I get this error: Error in cor(exprs(gse), use = "c", use = "complete.obs") : formal argument "use" matched by multiple actual arguments I want to achieve this plot: The GSE133399 dataset contains both ATAC-seq and RNA-seq data, none of which can be queried with GEOquery which works only for microarray data. exprs(gse) ## print the expression data returns an empty object as you might have noticed, therefore the errors in the lines that follow this command. On the bottom of https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE133399 at the Supplementary file section you can download FPKM-transformed count data and use these. I would be careful though as FPKM is not ideal for inter-sample comparison. I personally always (if feasable) download the raw data and then process myself, but for a guess on what is going on the FPKMs probably will do.
{ "domain": "bioinformatics.stackexchange", "id": 1597, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "r, rna-seq", "url": null }
thermodynamics, statistical-mechanics, definition, scaling If $A_2 = 2 A$ then $A$ is extensive. (e.g. energy, particle number) If neither of the above then $A$ is not intensive, and strictly speaking it is not extensive either. Finally, we require that there is nothing special about the number 2 for our system, so we require also that similar statements apply to $\lambda$ copies of the system, where $\lambda$ can be any integer, and then we can also imagine gathering the copies in groups which extends the outcome to all rational multiples $\lambda$ , and from there we can take the result for all real $\lambda$ in the limit.
{ "domain": "physics.stackexchange", "id": 58331, "lm_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, statistical-mechanics, definition, scaling", "url": null }
computation-models, data-compression, kolmogorov-complexity Title: Storing N bits on the smallest possible space in a real computer Update. Since my original question was misunderstood by many, and lead to a lot of debate about various issues, let me try to pose this modified and rephrased question: Assume that I have a computer with a giant disk that can store $2^{1000}$ bits. Is it possible for any $N<2^{999}$ to write a code in Python for any $N$-long bit string $x$ that prints $x$, such that the code of the program uses at most $N+O(\log N)$ bits of space?
{ "domain": "cs.stackexchange", "id": 20688, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computation-models, data-compression, kolmogorov-complexity", "url": null }
quantum-mechanics, atomic-physics, resource-recommendations Title: Reference for a study material of exact solution of Helium atom in 3D? I am curious to read exact solution of Helium atom in 3D. Can anyone refer me a reference, a book or a site? I suggest to read the book: Bransden, B. H., Joachain, C. J., & Plivier, T. J. (2003). Physics of atoms and molecules. Pearson education. Chapter VII has a good description of two electron-atoms properties, with analytic results. Even though a detailed analysis is provided, an exact analytical solution is missing. That's because, as far as I know, an exact analytical solution is still missing. Same for: Cohen-Tannoudji, C., Diu, B., Laloe, F., & Dui, B. (2006). Quantum Mechanics (2 vol. set). In this case, see chapter 14. I also heard of: Drake, G. W. (Ed.). (2006). Springer handbook of atomic, molecular, and optical physics. Springer Science & Business Media, but never read it.
{ "domain": "physics.stackexchange", "id": 71133, "lm_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, atomic-physics, resource-recommendations", "url": null }
# $f(x, z, n)$ where, depending on $z$, the derivative, proportional to $x$, increases, decreases, or remains constant I'm looking for a function that will produce a downwards sloping line, the shape of which is determined by one of the function's parameters. For example, given the function $f(x, z, n)$, where $x$ has the domain of $0$ to $n$, varrying the parametr $z$ should potentially produce the following curves: Thus, depending on $z$, the derivative can be constant, decreasing, or increasing (but never goes above $0$). Also, the line should always start at $1$ and end at $0$, ie. $f(x=0, z, n) = 1$ and $f(x=n, z, n) = 0$. Is there a practical formula for such a function? - You could use $$\left(1-\frac xn\right)^z\;.$$ In your image, you'd roughly have something like $z_1=1/2$, $z_2=1$, $z_3=2$. Here's a plot. [Edit in response to the comment:] Yes, you can make the curves more like quarter-circles by using $$\left(1-\left(\frac xn\right)^{1/z}\right)^z$$ instead. Here's a plot for that. Then the curve for $z=1/2$ is exactly a quarter-circle (it's distorted by different scaling on the axes on the W|A plot), but the curve for $z=2$ isn't exactly the corresponding reflected quarter-circle. I think to get that to be the case with a single formula while fulfilling the other constraints would be tricky, but you can always use the above expression for $z\le1$ and then for $z\gt1$ just use the one for $1/z$ reflected; that would be
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.976310529389902, "lm_q1q2_score": 0.8218832355735209, "lm_q2_score": 0.8418256393148982, "openwebmath_perplexity": 237.22503405617704, "openwebmath_score": 0.9164741635322571, "tags": null, "url": "http://math.stackexchange.com/questions/57996/fx-z-n-where-depending-on-z-the-derivative-proportional-to-x-incre" }
cholesterol Some LDL cholesterol circulating through the bloodstream tends to deposit in the walls of arteries. This process starts as early as childhood or adolescence. White blood cells swallow and try to digest the LDL, possibly in to digest the LDL, possibly in an attempt to protect the blood vessels. In the process, the white blood cells convert the LDL to a toxic (oxidized) form. More white blood cells and other cells migrate to the area, creating steady low steady low-grade inflammation in the artery wall. Over time, more LDL cholesterol and cells collect in the area. The ongoing process creates a bump in the artery wall called a plaque. The plaque is made of cholesterol, cells, and debris. The process tends to continue, growing the plaque and slowly blocking the artery. There is a good overview of the general physiology here in Robbins The Pathologic Basis of Disease. Chapter 5, Genetic Disorders, reviews the physiology, and the relevance to disease, in the section on Familial Hypercholesterolemia. The review is relevant to hypercholesterolemia in general.
{ "domain": "biology.stackexchange", "id": 9591, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cholesterol", "url": null }
php, laravel // pass through the data to the correct views return view($view, [ "events" => $events ]); } // function for the /events page public function workshopsList() { // get the course data from the database $events = Eventary::query() // show all events with the category 1 (events & workshops) ->where('category', '1') ->where('start', '>', Carbon::now()) ->get(); // pass through the data to the correct views return view('pages.course.event-list', [ "events" => $events ]); } // function for the /kalender page public function calendarList() { // get the course data from the database $events = Eventary::query() // show all events with the category 1 (events & workshops) ->where('start', '>', Carbon::now()) ->get(); // pass through the data to the correct views return view('pages.calendar', [ "events" => $events ]); } // function for fullcalendar json generation public function feed() { // get database $events = DB::table('eventaries')->get(); return json_encode($events, JSON_PRETTY_PRINT); } } there is a lot of code that gets reused. So I think that this is something that I should improve. But are there any other suggestions? Put your repeated or complicated queries into scopes on the model class. Here I also use the helper now to avoid importing Carbon: public function scopeFuture($query) { $query->where('start', '>', now()); } You can even use this scope in other scopes. If you find yourself using the same scope on most to all queries, you could use a global scope, but I'm not a fan since they're usually unexpected and confusing.
{ "domain": "codereview.stackexchange", "id": 42585, "lm_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, laravel", "url": null }
help you to finish your crossword today. Here is the answer to questions like: What is the cube root of 125 or what is the cube root of 125? WHO WANNA JOIN MY … 125 can be written as 125(e^0), 125(e^((2pi)i)), 125(e^((4pi)i)) where e is euler’s number, i is the imaginary unit, i^2=-1, and e^((theta)i)=cos(theta)+(i)(sin(theta)) where theta is an angle measured in radians. The cube root of -64 is written as $$\sqrt[3]{-64} = -4$$. Inter state form of sales tax income tax? cube root of 125/512 = 5/8. Volume to (Weight) Mass Converter for Recipes, Weight (Mass) to Volume to Converter for Recipes. Therefore the cube roots of 125 are 5(e^0),5(e^((2pi)i/3)),5(e^((4pi)i/3)). What is the birthday of carmelita divinagracia? When did organ music become associated with baseball? What is the conflict of the story of sinigang? What is plot of the story Sinigang by Marby Villaceran? The nearest previous perfect cube is … The cube root of a number answers the question "what number can I multiply by itself twice to get this number?". The length of a side (edge) of a cube is equal to the cube root of the volume. Not sure about the answer? Why don't libraries smell like bookstores? The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply. Cube Root of 125. Find the interest rate … that Sally earned from the bank. That number is 5. Who of the proclaimers was married to a little person? For example, 5 is the cube root of 125 because 53 = 5•5•5 = 125, -5 is cube root of -125 because (-5)3 = (-5)•(-5)•(-5) = -125. Just right click on the above image, then choose copy link address, then past
{ "domain": "hurdman.net", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347905312772, "lm_q1q2_score": 0.8878852104492885, "lm_q2_score": 0.9111797106148062, "openwebmath_perplexity": 354.3765989599167, "openwebmath_score": 0.5956003665924072, "tags": null, "url": "http://hurdman.net/ekli2a6u/776769-what-is-the-cube-root-of-125" }
physical-chemistry, concentration, solid-state-chemistry, notation Title: What does x mean in (1-x)A – xB composite materials, molar ratio, weight ratio or volume fraction? I've been collecting data about ceramic materials and often I get to see composite materials are described as $(1-x)\ce{A} - x\ce{B}$. I am confused what this $x$ means. And I haven't seen any of the papers mention what $x$ is unless %wt is given specifically. For an example in $(1-x)\ce{MgO} - x\ce{LiF}$ ceramic material, does $x$ mean molar ratio or weight ratio? For me it doesn't make sense to think of $x$ as a volume fraction as most of the times powders of these materials are taken for sintering. If nothing is mentioned, is it all right to assume $x$ as the molar ratio? Can we assume volume fraction is equal to molar ratio even in solids or liquids? Here, $x$ is a variable $(x\in[0;1])$ denoting mole fraction of a given constituent in a phase of variable composition (non-stoichiometric compound). This is an algebraic way of denoting a given compound from the phase diagram for a solid solution: $x$ corresponds to its abscissa axis. And no, volume fraction is not equal to mole fraction and is overall a very inconvenient variable to use, so it's usually being avoided. For example, volume fraction would deviate for the different morphologies and allotropes of the same solid, which is not useful for the description of chemical composition, not to mention it's also temperature-dependent.
{ "domain": "chemistry.stackexchange", "id": 11377, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, concentration, solid-state-chemistry, notation", "url": null }
thermodynamics Title: Is there a general equation which calculates the temperature which shifts the equilibrium mostly to the right which applies to most reactions? Say I have the following simple reaction $ \ce{HCl(aq) + NaOH(aq) \rightarrow NaCl(aq) + H2O(l)} $ Does there exist a calculation which gives the ideal temperature for this reaction to occur at? Background I used this example as it was the easiest one I could think of from the top of my head but I mean this generally. I tried looking this up but could only find calculations to do with how much heat is released. Edit Ideal meaning the point in temperature where the reaction will give the greatest yield of products. Kind of reminds me of enzymes the optimum temperature. Like one of the commentators mentioned the haber process, the temperature at which the equilibrium shifts mostly to the right, or the minimum temperature required for the reaction to get going. Actual question Is there an equation which calculates the optimum/shifts equilibrium mostly to the right temperature or is it just empirical? I mean a general equation which might apply to most reactions, if there is such a thing? Apologies for being vague. Anytime when asking for ideal, optimal or the best, the one who asks must provide criteria, how the ideality, optimality or being the best is evaluated, as it is highly subjective criteria. In reaction context, one of possible criteria is the maximal reaction quotient achieved at given reaction conditions, together with minimal expenses. This makes sense for slow enough reactions, what is not the case of strong acid + base neutralisation. The typical textbook case for optimization is catalyzed Haber-Bosch synthesis of ammonia: $$\ce{3 H2(g) + N2(g) <=> 2 NH3(g)}$$ There are 4 major factors: Increased temperature speeds up the reaction. Increased pressure shifts equilibrium in favour of the product. Increased temperature shifts the equilibrium constant in favour of the reactants. Increased cost for higher pressure and temperature. The reaction is performed as gases pass the solid state catalyst, ammonia is separated and remaining reactants are by loopback returned to react. The pressure is kept as high as technologically reasonable. But there are higher time and operational expenses (device cost, energy spent) for higher pressure. The major parameter to optimize is temperature:
{ "domain": "chemistry.stackexchange", "id": 16784, "lm_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", "url": null }
astronomy, astrophysics, stars, stellar-evolution Title: Red Giant branch and Asymptotic Giant branch What's the difference between the RGB and the AGB? I can't seem to find an clear distinction anywhere. Thanks. Red giants and asymptotic giants have some close similarities, and one actually evolves into the other. Both have an extended envelope of relatively cool, non-burning material (mostly $\rm{H}$, $\rm{He}$). They also each have a core of dense, non-burning material; in the case of the red giant this is mostly $\rm{He}$, while for the asymptotic giant it's $\rm{C}$ and $\rm{O}$. The burning shell in the red giant is $\rm{H}$. For stars of the right mass, the conditions (density, temperature) in the core will periodically be sufficient to ignite the $\rm{He}$ causing a "core flash". Red giant structure: After the red giant branch of stellar evolution there is a brief period where the $\rm{He}$ core burns called the horizontal branch. Once the He core is exhausted (it's been converted to $\rm{C}$ and $\rm{O}$), the star starts on the asymptotic giant branch. This branch has two parts, the early asymptotic giant branch (E-AGB) and the thermal-pulse asymptotic giant branch (TP-AGB). E-AGB structure: Stars on the E-AGB are like red giants, but in addition to a $\rm{H}$ burning shell there is a $\rm{He}$ burning shell (the energy output is dominated by the He burning shell). In the TP-AGB, the $\rm{H}$ shell picks up again and dominates the energy output, but periodically as the $\rm{He}$ produced by $\rm{H}$ burning is accreted onto the $\rm{He}$ shell, "helium shell flashes" occur, analogously to helium core flashes in red giants. Source/Reference: Carroll & Ostlie "An Introduction to Modern Astrophysics: 2nd Edition" (Pearson)
{ "domain": "physics.stackexchange", "id": 9105, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astronomy, astrophysics, stars, stellar-evolution", "url": null }
histology Title: Why can't plasma proteins migrate from capillaries? Why can't plasma proteins shift from capillaries to connective tissue but WBCs can be very rich in connective tissue even though obviously the WBCs had to go through capillaries. Another example: in alveolar sacs neutrophils are there in the lumen despite the presence of epithelia of alveolar sacs, and it can only reach there via capillaries. So, how can they get into lumen despite the epithelia lining? Histology textbooks say that no plasma proteins can enter or leave capillaries, but WBCs (which are much larger than proteins) can move to connective tissue via capillaries? Cells of the endothelium are joined by tight cell junctions which are impermeable or selectively permeable. Generally, proteins can only migrate through the endothelium via active transcytosis. Leukocytes (specifically neutrophils, lymphocytes and monocytes) express various adhesion molecules and cytokine receptors which allow them to interact with endothelial cells and facilitate their movement (diapedesis) either between (paracellular) or through (transcellular) the cells. The process of leukocytes leaving the endothelial lumen is known as extravasation. Carman CV. 2009. Mechanisms for transcellular diapedesis: probing and pathfinding by `invadosome-like protrusions'. J Cell Sci 122:3025-3035. (C,D) The process of diapedesis, whether during intravasation or extravasation, can occur by two distinct pathways: paracellular or transcellular. (C) Paracellular diapedesis. Leukocytes and endothelial cells coordinately disassemble endothelial cell-cell junctions and open up a gap between two or more endothelial cells (Muller, 2003). (D) Transcellular diapedesis. Leukocytes migrate directly through individual endothelial cells via a transient transcellular pore that leaves endothelial cell-cell junctions intact. Note that the two individual endothelial cells in C and D are distinguished by different shades of pink.
{ "domain": "biology.stackexchange", "id": 6038, "lm_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 }
hamiltonian, interactions, coupled-oscillators but this doesn't feel like the right way to do it. How would I diagonalize the above hamiltonian where the spring constants differ? We consider any potential of the form \begin{align} V( x) = K_{11}x_1^2 + 2K_{12} x_1x_2 + K_{22}x_2^2. \end{align} The key to "diagonalization" of this potential is to note that such a potential is quadratic in the positions $x_1$ and $x_2$, and can therefore be written in matrix notation as follows: \begin{align} V( x) = \underbrace{(x_1\, x_2)}_{ x^t}\underbrace{\begin{pmatrix} K_{11} & K_{12} \\ K_{12} & K_{22} \\ \end{pmatrix}}_{K} \underbrace{\begin{pmatrix} x_1 \\ x_2 \\ \end{pmatrix}}_{ x} \end{align} where a superscript $t$ denotes transpose, and $ x = (x_1, x_2)^t$ is considered a column vector. Now, when we want to "diagonalize" the potential, we simply need to diagonalize the matrix $K$ (assuming that it is diagonalizable). In other words, we find a matrix $Q$ for which \begin{align} K = Q^{-1}DQ \end{align} where $D$ is a diagonal matrix. In the case at hand, notice that $K$ is a real, symmetric matrix. It is a mathematical fact that any such matrix admits an orthogonal diagonalization, namely that the matrix $Q$ can be chosen orthogonal which means $Q^{-1} = Q^t$. It follows that we can write \begin{align} K = Q^tDQ \end{align} where $D$ is diagonal with the eigenvalues $\lambda_1, \lambda_2$ of $K$ on its diagonal so that \begin{align}
{ "domain": "physics.stackexchange", "id": 11402, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "hamiltonian, interactions, coupled-oscillators", "url": null }
post for the amazing list of examples. This book explores the integral calculus and its plentiful applications in engineering and the physical sciences. Center of mass of a rod and centroid of a planar region. Fluid Mechanics and the Theory of Flight. Self-contained and unified in presentation, the book contains many solved examples and exercises. Application Calculus Civil Engineering Application Calculus Civil Engineering Thank you very much for reading Application Calculus Civil Engineering. Some basic formula conversions are given. Each chapter ends with exercises for students to attempt on their own. Most real-world problems are concerned with. 1 MAXIMUM, MINIMUM AND INFLECTION POINT & SKETCHING THE GRAPH Introduction to Applications of Differentiation In Isaac Newton's day, one of the biggest problems was poor navigation at sea. 174 Chapter 3 Matrix Algebra and Applications quick Examples Matrix, Dimension, and Entries An m × n matrix A is a rectangular array of real numbers with m rows and n columns. Pestana Department of Civil and Environmental Engineering University of California. However, people benefit from the applications of calculus every day, from computer algorithms to modeling the spread of disease. Calculus is a very versatile and valuable tool. Disclaimer: None of these examples is mine. Get this from a library! Calculus with applications. But nevertheless the lungs, edit my paper on hunting without angst. If you want to entertaining books, lots of. The Resequencing Calculus project is now in phase 2. BA201 ENGINEERING MATHEMATICS 2012 57 CHAPTER 3 APPLICATION OF DIFFERENTIATION 3. If f is continuous on [a, b] then. It is aimed mainly (but not exclusively) at students aiming to study mechanics (solid mechanics, fluid mechanics, energy methods etc. For engineering applications, examples of unsteady vertical flows include the interaction of wakes and shocks with the boundary layer in a transonic turbine and vorticity dissipation shed due to the temporal variations in blade circulation that can have a profound loss influence and affect the overall performance of a turbomachine (e. The Student[Calculus1] package contains four routines that can be used to both work with and visualize the concepts of function averages, arc lengths, and volumes and surfaces of revolution. Even if they see a business application, the main focus is on the mathematical techniques. The book includes many solved problems showing applications in all branches of engineering, and the reader should pay close attention to them in each section. The middle formula tells us. Each project begins with a brief review of
{ "domain": "rivoliccr.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517514031507, "lm_q1q2_score": 0.8253730772942013, "lm_q2_score": 0.8438950966654774, "openwebmath_perplexity": 791.5377248847301, "openwebmath_score": 0.5360766649246216, "tags": null, "url": "http://olml.rivoliccr.it/application-of-calculus-in-engineering-examples.html" }
ros ## Create the nodelet tutorial library add_library(nodelet_test_plugins src/test.cpp src/test.h ) find_package(Torch REQUIRED) target_link_libraries(nodelet_test_plugins ${catkin_LIBRARIES} ${PROJECT_LIBRARIES} ${TORCH_LIBRARIES}) if(catkin_EXPORTED_LIBRARIES) add_dependencies(nodelet_test_plugins ${catkin_EXPORTED_LIBRARIES}) endif() ## Mark the nodelet library for installations install(TARGETS nodelet_test_plugins ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) install(FILES nodelet_test_plugins.xml mynodelet.launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) All other files are empty/dummy. test.cpp: #include <pluginlib/class_list_macros.h> #include "test.h" PLUGINLIB_EXPORT_CLASS(random_pkg::Test, nodelet::Nodelet) namespace random_pkg { void Test::onInit() {} } test.h #include "ros/ros.h" #include <nodelet/nodelet.h> namespace random_pkg { class Test : public nodelet::Nodelet { public: Test(){} private: virtual void onInit(); }; } nodelet_test_plugins.xml <library path="libnodelet_test_plugins"> <class name="random_pkg/Test" type="random_pkg::Test" base_class_type="nodelet::Nodelet"> <description> Write things here. </description> </class> </library> random.launch (When this file is launched the above error shows up) <launch> <node pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager" output="screen"/>
{ "domain": "robotics.stackexchange", "id": 36825, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
automata-theory, context-free Related: Are DPDAs without a $\epsilon$ moves as powerful as DPDAs with them? Crossposted: https://cs.stackexchange.com/questions/114995/pdas-without-%ce%bb-steps-or-popping-more-than-one-from-stack In the standard $\epsilon$-free PDA definition the transition function is: $\sigma : Q \times \Sigma \times \Gamma \to Q \times \Gamma^*$ $(q_i, a, A, q_j, \alpha) \in \sigma$ means that the PDA on state $q_i$, with head on input $a$ and $A \in \Gamma$ on top of the stack, enters state $q_j$ and replace $A$ with $\alpha \in \Gamma^*$ According to this definition, if $|\alpha| \leq 1$ there is no way to increase the stack and the resulting automata is a DFA. But letting $|\alpha| \leq 2$ is enough to recognize all CFLs; and this is a direct consequence of the following theorem: Theorem [D.J. Rosenkrantz. Matrix equations and normal forms for context-free grammars] Given a proper context-free grammar $G$, an equivalent context free grammar in quadratic Greibach normal form can effectively be constructed from $G$ A grammar $G$ in quadratic Greibach normal form if every right side of the rules is in the form $A V^*,\; |V| \leq 2$ ($A$ is the terminal alphabet, $V$ is the set of non-terminals): $X \to a\, B C$ or $X \to a\, B$ or $X \to a$ $B, C \in V$ ***ADDENDUM This is an idea to prove that even with the constraint required by domotorp in the question (at each step 1 POP or 1 PUSH or NO CHANGES ) we can recognize all CFLs.
{ "domain": "cstheory.stackexchange", "id": 4755, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "automata-theory, context-free", "url": null }
java, android public String getContactLocations(String id){ String addr = null; ContentResolver addrCr = context.getContentResolver(); String selection = ContactsContract.CommonDataKinds.StructuredPostal.CONTACT_ID + " = ?"; String[] selectionArgs = new String[]{id}; String[] projection = new String[]{ ContactsContract.CommonDataKinds.StructuredPostal.STREET, ContactsContract.CommonDataKinds.StructuredPostal.CITY, ContactsContract.CommonDataKinds.StructuredPostal.REGION, ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE }; Cursor addrCur = addrCr.query(ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_URI, projection, selection, selectionArgs, null); if (addrCur.getCount() > 0) { while(addrCur.moveToNext()) { addr = addrCur.getString( addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.STREET)); addr += " " + addrCur.getString( addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.CITY)); addr += " " + addrCur.getString( addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.REGION)); addr += " " + addrCur.getString( addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE)); } } addrCur.close(); return addr; }
{ "domain": "codereview.stackexchange", "id": 1446, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, android", "url": null }
cpu-pipelines, computer-architecture Title: Which kind of branch prediction is more important? I have observed that there are two different types of states in branch prediction. In superscalar execution, where the branch prediction is very important, and it is mainly in execution delay rather than fetch delay. In the instruction pipeline, where the fetching is more problem since the instructions do not actually get executed till later.
{ "domain": "cs.stackexchange", "id": 664, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cpu-pipelines, computer-architecture", "url": null }
machine-learning, natural-language-processing, agi, singularity, neuroscience Title: Is there any specific SW framework, libraries or algorithms designed for implementing a practical artificial general intelligence (AGI) system? Any (AGI)-KERAS like libraries useful to develop a real Artificial General Intelligence (AGI) system? Any deep-learning framework to develop AGI applications? any real Transformer-based (like Chat-GPT) libraries that can be used to achieve a minimum level of Artificial General Intelligence? Existing frameworks/algorithms used in NN, NLP, ML, etc are not enough in my opinion. In my opinion any framework has to be based on building blocks from: Cognitive Science, Neuroscience, Mathematics, Artificial Intelligence, Computer Science, psycology, sociology, etc. Not to my knowledge. The problem is that this is such an enormous task, it cannot really be tackled at once. So the obvious solution is to reduce the scope. In early AI people were using toy domains, whereas nowadays AI systems work more generally (but still perform better if the domain is restricted). So while (slow) progress is being made putting the individual building blocks together, we're still a long way off building an overarching general system from them.
{ "domain": "ai.stackexchange", "id": 2792, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, natural-language-processing, agi, singularity, neuroscience", "url": null }
roscpp Title: how to identify topic and data type mapping in ros Hi All, I want to know the exact data type of topic published. So in some scenario data type integer related information published under some topics or it might be image or string data. in some scenario published information under topic might be collection of some of the data types (int, bool, string, float, double) . so how to identify through command line or API what data type is published under particular topic. Originally posted by can-43811 on ROS Answers with karma: 101 on 2017-08-28 Post score: 0 For command line usage you can run rostopic info <topic-name> and that will show the message type along with other information. Here's an example with just roscore running. $ rostopic info /rosout Type: rosgraph_msgs/Log Publishers: None Subscribers: * /rosout (http://127.0.0.1:41588/) Notice the section that says Type: rosgraph_msgs/Log this shows that this topic carries messages of the type rosgraph_msgs/Log. You can read more about this on the wiki. Edit: As @gvdhoorn pointed out in the comments, a great shortcut is rostopic type /my_topic | rosmsg show which will then show (from my above example) $ rostopic type /rosout | rosmsg show byte DEBUG=1 byte INFO=2 byte WARN=4 byte ERROR=8 byte FATAL=16 std_msgs/Header header uint32 seq time stamp string frame_id byte level string name string msg string file string function uint32 line string[] topics which gives the definition of the message. Originally posted by jayess with karma: 6155 on 2017-08-28 This answer was ACCEPTED on the original site Post score: 4
{ "domain": "robotics.stackexchange", "id": 28720, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "roscpp", "url": null }
sql, sql-server, delphi, adodb { TSQLExecBlock } constructor TSQLExecBlock.Create(AOwner: TSQLExecBlocks); begin FOwner:= AOwner; FSQL:= TStringList.Create; FStatus:= sePending; FMessage:= ''; end; destructor TSQLExecBlock.Destroy; begin FSQL.Free; inherited; end; function TSQLExecBlock.GetIndex: Integer; begin Result:= FOwner.FItems.IndexOf(Self); end; function TSQLExecBlock.GetSQL: TStrings; begin Result:= TStrings(FSQL); end; procedure TSQLExecBlock.SetSQL(const Value: TStrings); begin FSQL.Assign(Value); end; { TSQLExecBlocks } constructor TSQLExecBlocks.Create(AOwner: TSQLExec); begin FOwner:= AOwner; FItems:= TList.Create; end; destructor TSQLExecBlocks.Destroy; begin Clear; FItems.Free; inherited; end; function TSQLExecBlocks.Add: TSQLExecBlock; begin Result:= TSQLExecBlock.Create(Self); FItems.Add(Result); end; procedure TSQLExecBlocks.Clear; begin while Count > 0 do Delete(0); end; function TSQLExecBlocks.Count: Integer; begin Result:= FItems.Count; end; procedure TSQLExecBlocks.Delete(const Index: Integer); begin TSQLExecBlock(FItems[Index]).Free; FItems.Delete(Index); end; function TSQLExecBlocks.GetItem(Index: Integer): TSQLExecBlock; begin Result:= TSQLExecBlock(FItems[Index]); end;
{ "domain": "codereview.stackexchange", "id": 9184, "lm_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, delphi, adodb", "url": null }
general-relativity, metric-tensor, notation, history, event-horizon On the contrary, present-day approach, grounded on sounder mathematical bases, is roughly the following. Spacetime is a semi-Riemannian manifold of dimension 4 and signature $+---$. 1.1 A (real) manifold is a set wherein real coordinates may be defined. This can be done in several ways. Coordinates are nothing but labels for the set's points. 1.2 It's not required that a set of coordinates be able to cover the whole manifold. More sets are allowed - it's only required that together they cover the whole manifold and smoothly overlap between them. Each set is named a card and the ensemble is named an atlas. 1.3 An easy instance. To define a sphere as a (2D) manifold a minimum of two cards are required. Among geographers a lot of cartographic projections are in use and a world's atlas is a good example of the general idea. A Riemannian manifold is a manifold where a metric is defined. Roughly, a formula giving the distance between (infinitesimally) near points. 2.1 More exactly, the distance squared $ds^2$. So the metric must be positive definite. 2.2 In a semi-Riemannian manifold an extension is allowed: $ds^2$ may also be negative. (A contradiction? Not quite. It's enough to relax the intuitive interpretation as a distance squared.) Minkowski's spacetime of SR is already an instance of that: there are spacelike intervals, timelike ones, and lightlike too. 2.3 The signature refers to how many independent displacements have metric of each sign. In GR there are two conventions in use: $+----$ means timelike has positive $ds^2$, spacelike negative. $-+++$ is the opposite. There is no real difference - it's only necessary to consistently adhere to one convention. Mixing them in a calculation leads to certain disaster. Leaving aside more sophisticated usages, the metric is the only way we have to give coordinates a physical meaning. It allows to compute the time a clock measures between events or the length of a space interval and so on.
{ "domain": "physics.stackexchange", "id": 59410, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, metric-tensor, notation, history, event-horizon", "url": null }
navigation, ekf, odometry, gps, ros-kinetic <param name="publish_tf" value="false" /> <param name="print_diagnostics" value="true"/> <param name="imu0_queue_size" value="10"/> <param name="imu1_queue_size" value="10"/> <param name="odom0_queue_size" value="10"/> <param name="odom1_queue_size" value="20"/> <param name="debug" value="false"/> <param name="debug_out_file" value="debug_ekf_localization.txt"/>
{ "domain": "robotics.stackexchange", "id": 30616, "lm_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, ekf, odometry, gps, ros-kinetic", "url": null }
ros, rostopic--pub, rostopic Title: rostopic pub geometry_msgs/PoseArray example Can anybody give me an example of geometry_msgs/PoseArray message using rostopic pub? I keep on getting errors when i try and interpret the syntax from the ROS documentation, a solid example would be really helpful. Thanks! Originally posted by Ben12345 on ROS Answers with karma: 98 on 2017-01-09 Post score: 1 Here's an example with the Bash multiline syntax: rostopic pub /test geometry_msgs/PoseArray "header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: '' poses: - position: x: 1.0 y: 2.0 z: 3.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0 - position: x: 4.0 y: 5.0 z: 6.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0" Here's an example using the YAML command line dictionary syntax: rostopic pub /test geometry_msgs/PoseArray "{header: auto, poses: [{position: [1,2,3]}, {position: [4,5,6]}]}"\ You can also use the -f option to read the message contents from a YAML file. For example, imagine tmp.yaml had the following contents: poses: - position: x: 1.0 y: 2.0 z: 3.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0 - position: x: 4.0 y: 5.0 z: 6.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0 This could be published using rostopic pub /test geometry_msgs/PoseArray -f tmp.yaml
{ "domain": "robotics.stackexchange", "id": 26676, "lm_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, rostopic--pub, rostopic", "url": null }
Then, letting $u=2x+1$, \begin{align*} &x\sqrt{x^2+5}+(2x+1)\sqrt{4x^2 + 4x + 6}=0 \qquad\qquad\qquad\qquad\;\; \\[4pt] \iff\;&x\sqrt{x^2+5}+u\sqrt{u^2 + 5}=0\\[4pt] \iff\;&f(x) + f(u)=0\\[4pt] \iff\;&f(x) = -f(u)\\[4pt] \iff\;&f(x) = f(-u)\qquad\text{[since $f$ is odd]}\\[4pt] \iff\;&x = -u\qquad\qquad\;\;\text{[since $f$ is one-to-one]}\\[4pt] \iff\;&x = -(2x+1)\\[4pt] \iff\;&3x+1 = 0\\[4pt] \iff\;&x = -{\small{\frac{1}{3}}}\\[4pt] \end{align*} As an alternative, using the same trick, you can get a factored form: \begin{align*} &x\sqrt{x^2+5}+u\sqrt{u^2 + 5}=0\\[4pt] \implies\;&x\sqrt{x^2+5}=-u\sqrt{u^2 + 5}\\[4pt] \implies\;&x^2(x^2+5)=u^2(u^2 + 5)\\[4pt] \implies\;&x^4+5x^2=u^4+5u^2\\[4pt]
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9859363713038174, "lm_q1q2_score": 0.8399712466825968, "lm_q2_score": 0.8519527944504227, "openwebmath_perplexity": 603.8355338098116, "openwebmath_score": 0.9582511782646179, "tags": null, "url": "https://math.stackexchange.com/questions/2443864/solve-the-radical-equation-x-sqrtx25-2x1-sqrt4x24x6-0" }
quantum-mechanics, electrons, atomic-physics, orbitals Title: Orbitals and electron jumping Bohr model (tries to) explain how electron goes to higher state(orbit) from lower state(orbit) on photon absorption.But in quantum mechanics, we have orbitals which can at most accommodate 2electrons. Let's consider an electron that has absorbed a photon sufficient to make it jump from Orbital 1 to Orbital 2.If the Orbital 2 is already filled with 2 electrons where will the excited electron go? If the excited electrons can't be stimulated, then the photon simply won't interact with the lower-level electron as the electron's transition is forbidden.
{ "domain": "physics.stackexchange", "id": 37897, "lm_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, atomic-physics, orbitals", "url": null }
quantum-mechanics, condensed-matter, symmetry, gauge-invariance As for a more general proof related to any operator, as long as it is diagonal in the real space and have a translational symmetry (which is true for the Hamiltonian) and that we compare matrix elements of the form $\left\langle \psi_{nk}|O(r)|\psi_{mk}\right\rangle$ (at the same k instead of k+b like above), the same argument holds.
{ "domain": "physics.stackexchange", "id": 95779, "lm_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, condensed-matter, symmetry, gauge-invariance", "url": null }
vcf, variant-calling, variation Title: Find overlap between VCF files I have two VCF files and I want to compare the missing rate in each of them, but I want to only look at sites that are present in both files. How could I go about getting a list of positions that are included in both VCF files and then filtering those VCF files to only include those positions? Something like vcf-isec? Quoting: Creates intersections and complements of two or more VCF files. Given multiple VCF files, it can output the list of positions which are shared by at least N files, at most N files, exactly N files, etc. The first example below outputs positions shared by at least two files and the second outputs positions present in the files A but absent from files B and C.
{ "domain": "bioinformatics.stackexchange", "id": 1001, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vcf, variant-calling, variation", "url": null }
ros, gazebo, force Title: Can I get force information in gazebo? and how? Hello! I want to simulate the force control of robots using gazebo. But I don't know how to get the force information in gazebo. I can get the joint position and velocity by pr2_mechanism_model::RobotState. However, there is no function to get the joint effort. Thank you very much Originally posted by hannuaa on ROS Answers with karma: 11 on 2014-03-25 Post score: 0 Use GetForce in Joint in Gazebo's Physics library. You'll find more in here and there. Also, you'll get better response for Gazebo questons in http://answers.gazebosim.org. Originally posted by 130s with karma: 10937 on 2015-01-15 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 17411, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, gazebo, force", "url": null }
dft, fourier-series Where $A=10$, $T=1$, $N=50$ (number of samples) and the DFT is normalized by $\tau = T/N$ and $1/N/\tau$ for the inverse. Now, the imaginary part as far as I can understand comes from the Fourier coefficients $$ c_n = \frac{iA}{2\pi N} $$ These coefficients (see e.g. Brigham, section 5.2) equal the fourier transform $S(t)$ scaled by $\frac{1}{T}$ and sampled at $n/T$. Given we have a discrete signal, we need to account for aliasing in the frequency space, which can be represented by repeating $c_n$ at $N$ intervals and summing with themselves, something like the following? probably missing a constant $$ Im(S_n) = \sum_{m=-\infty}^{\infty} c_n\delta(n-mN) \qquad n \in [0,N-1] $$ What about the non zero real part? As an afterthought I can rationalize it because the sawtooth is non zero at $t=0$, so it must have a non zero mean DFT. But if I take a sawtooth centered in $-T/2,T/2$ it's still there even if the signal crosses the origin. I'd like to find a better relation that gets me from the Fourier series to the DFT, accounting both for the imaginary and the real part. Any pointer to good resources to help understand the whole thing would be more than welcome. Just looking at the DFT, the real part, with my normalization should be: $$ -\frac{A}{2}\tau\sum_{n=-\infty}^{\infty}\delta\left(f-\frac{n}{T}\right) $$ How do I justify this result? especially the multiplication factor?
{ "domain": "dsp.stackexchange", "id": 3448, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dft, fourier-series", "url": null }
organic-chemistry, acid-base, hydrocarbons, halogenation Sulfuric acid treatment serves to remove resinous materials, oil, unsaturated hydrocarbons, and other unstable substances from crude wax, as well as to remove polycyclic aromatic compounds, by treatment with 102-103% oleum and subsequent neutralization with caustic. After sulfuric acid treatment, the wax may contain free sulfuric acid or caustic, the presence of which is explained either by incomplete neutralization of the acid after treatment or by incomplete washing of the caustic used in neutralizing the acid. The presence of either acids or alkalis in waxes is extremely undesirable, since such materials will cause corrosion of metals under the conditions of production, use, and storage. These impurities in commercial paraffin waxes are the cause of undesirable processes of oxidation, resin formation, and decomposition. Apart from free sulfuric acid, derivatives such as sulfonic acids and acid esters may be present in paraffin. These are equivalent to the mineral acid in chemical action. A negative result from the test of a petroleum product for free acid or alkali still does not guarantee that these compounds will not be formed in the petroleum product. If the product contains salts of sulfonic acids, acid esters, naphthenic acids, or byproduct compounds, then the action of high temperature or moisture (hydrolysis) will quite probably result in the formation of acidic substances of a mineral nature.(3) References
{ "domain": "chemistry.stackexchange", "id": 12632, "lm_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, acid-base, hydrocarbons, halogenation", "url": null }
python, natural-language-processing Prints: Most common words: ('society', 'system', 'people', 'power', 'would', 'one', 'human', 'technology', 'leftist', 'need') Most popular terms: ('society', 'people', 'freedom', 'whole', 'human', 'lead', 'system', 'necessity', 'process', 'use') Most unique/important terms: ('license', 'simplification', 'personnel', 'carried', 'crossroad', 'eminent', 'exactly', 'paramount', 'danger', 'virtue') I am still learning and would like my code to be reviewed. Would appreciate any feedback about the code quality, performance or any other possible improvements. Also, I am not 100% sure the TF-IDF model is applied in the most appropriate way. Currently, I am treating each sentence as a separate document. Is this a good approach to detect the most "important"/"valuable" terms/words, or should I use other articles/posts as documents for the corpus? First, I will start with PEP 8 specifications. The PEP 8 analysis shows the following: E501:17:80:line too long (94 > 79 characters) E501:25:80:line too long (99 > 79 characters) E501:46:80:line too long (82 > 79 characters) E501:66:80:line too long (114 > 79 characters) E731:76:5:do not assign a lambda expression, use a def W292:79:62:no newline at end of file If I am not incorrect, one of the things that you are trying is to calculate the frequency distribution of words, namely the most common words and most rare words. I tried to re-write your code like viz. from bs4 import BeautifulSoup from nltk import FreqDist, re import requests def retrieve_text(url): """Downloads HTML content from a URL, parses with an HTML parser and returns text only.""" response = requests.get(url) soup = BeautifulSoup(response.content, "html.parser") return soup.get_text()
{ "domain": "codereview.stackexchange", "id": 28564, "lm_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, natural-language-processing", "url": null }
javascript, snake-game, webgl const line = new newLineSegments(edges, new newLineBasicMaterial({ color: segmentColor,linewidth:2 })); cube.position.copy(pos); line.position.copy(pos); snakeobject.add(line,cube); }) scene.add(snakeobject); }, move() { this.segments.unshift(this.nextHead); if(this.checkCollision()) { this.segments.shift(); gameOver(); return; }; var nextHeadPos = this.nextHead; this.direction = this.nextDirection; (directionSwitch[this.direction])(nextHeadPos) if(stringify(this.segments[0]) === stringify(apple.pos)) { speed=0.95*speed; score++; if(apple.type === "superapple") { speed = 1.10*speed; score += 4; } apple.move(); } else { this.segments.pop(); }; }, changeDirection(key) { switch(key){ case 39: case 68: case 37: case 65: keyLookup[key][this.direction]() break; case 192: case 55: case 56: keyLookup[key]() break; } }, checkCollision() { const head = this.segments[0] const headz = head[2]; const headx = head[0]; const wallCollision = headz === -10 || headz === 30 || headx === 0 || headx === 40; var selfCollision = false; this.segments.forEach(function(item, index) { if(index) { if(item[0] === head[0] && item[2] === head[2]) { selfCollision = true; }; }; }); const collision = selfCollision || wallCollision; return collision; } }
{ "domain": "codereview.stackexchange", "id": 30557, "lm_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, snake-game, webgl", "url": null }
c++, performance, numerical-methods file1 << v.real_space(i) << "\t" << v.real_space(j) << "\t" << imag(v.value[i][j]) << "\t" << real(v.value[i][j]) << "\t" << abs(v.value[i][j]) << std::endl; } } for (int k = 0; k < grid_point; k++) { file2 << v.real_space(k) << "\t" << abs(v.density_x1[k]) << "\t" << abs(v.density_x2[k]) << std::endl; } file2.close(); file1.close();
{ "domain": "codereview.stackexchange", "id": 24595, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, numerical-methods", "url": null }
java, matrix, reinventing-the-wheel, graphics case KeyEvent.VK_S: sceneObjectList.stream().forEach((o) -> { o.rotate(rotationSource, -0.1, -0.0, 0.0); }); break; case KeyEvent.VK_Q: sceneObjectList.stream().forEach((o) -> { o.rotate(rotationSource, 0.0, 0.0, -0.1); }); break; case KeyEvent.VK_E: sceneObjectList.stream().forEach((o) -> { o.rotate(rotationSource, 0.0, 0.0, 0.1); }); break; } repaint(); } @Override public void keyPressed(KeyEvent e) {} @Override public void keyReleased(KeyEvent e) {} } SceneFrame.java: package net.coderodde.lib3d; import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.JFrame; /** * This class implements the frame containing a view. * * @author Rodion "rodde" Efremov * @version 1.6 */ public class SceneFrame extends JFrame { /** * The actual view component. */ private final SceneView view; /** * Constructs a frame containing the view. * * @param width the width of the frame in pixels. * @param height the height of the frame in pixels. */ SceneFrame(int width, int height) { super("3D Cube"); add(view = new SceneView(width, height)); pack(); setResizable(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); final Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); // Center out the frame. setLocation((screenDimension.width - getWidth()) / 2, (screenDimension.height - getHeight()) / 2); setVisible(true); }
{ "domain": "codereview.stackexchange", "id": 13667, "lm_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, matrix, reinventing-the-wheel, graphics", "url": null }
organic-chemistry, stereochemistry, optical-properties Title: Does inversion of configuration necessitate reversed optical rotation? Say, optically pure 2-bromobutane undergoes $\mathrm{S_N2}$ reaction with an alkali to form 2-butanol. The configuration about chiral carbon will now be inverted, but is it necessary that the sign of optical rotation will be opposite to that of substrate? i.e. if optical rotation of optically pure 2-bromobutane is $+x^\circ$, will optical rotation of the product be $- y^\circ$? if optical rotation of optically pure 2-bromobutane is some (+X) degrees, will optical rotation of the product be some (-Y) degrees? No, there is no correlation between the configuration at a chiral carbon and the sign of optical rotation. For example (from the Aldrich catalogue), the following chiral bromo compound, (R)-(+)-2-Bromo-3-methylbutyric acid, has an optical rotation of [α]22/D +21°, c = 37 (c is the sample concentration in grams/100 ml solution) in benzene. The inverted hydroxyl analogue, (S)-(+)-2-Hydroxy-3-methylbutyric acid, also rotates light in the (+) direction. Its optical rotation is [α]20/D +19°, c = 1 in chloroform.
{ "domain": "chemistry.stackexchange", "id": 9409, "lm_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, optical-properties", "url": null }
7. Originally Posted by TheEmptySet You are really close you should have gotten $2x = \frac{\pi}{2}+n\pi \iff x =\frac{\pi}{4}+n\frac{\pi}{2}$ eek, sorry that was a typo on my part What I meant to type was $\cos(2x) = 0$ $2x = \pm \frac{\pi}{2} + 2\pi n$ $\implies x = \pm \frac{\pi}{4} + n \pi$ If we let n = 0 and sub back into the original equation we have $\sin\left(\frac{\pi}{2}\right) + \sin(\pi) = \cos\left(\frac{\pi}{2}\right) + \cos(\pi)$ $1 = -1$ which is obviously wrong but I can't see where the error is EDIT: I got Calculus26 method to work, very nice idea to square both sides I didn't think of that. Now I'm wondering why I can't get it to work using the sum to product way =P 8. Originally Posted by Stonehambey eek, sorry that was a typo on my part What I meant to type was $\cos(2x) = 0$ $2x = \pm \frac{\pi}{2} + 2\pi n$ $\implies x = \pm \frac{\pi}{4} + n \pi$ If we let n = 0 and sub back into the original equation we have $\sin\left(\frac{\pi}{2}\right) + \sin(\pi) = \cos\left(\frac{\pi}{2}\right) + \cos(\pi)$ $1 = -1$ which is obviously wrong but I can't see where the error is
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9728307668889048, "lm_q1q2_score": 0.8704787177361966, "lm_q2_score": 0.8947894611926921, "openwebmath_perplexity": 380.09546312716003, "openwebmath_score": 0.9131166338920593, "tags": null, "url": "http://mathhelpforum.com/trigonometry/89376-general-solution-trig-problem.html" }
astronomy, galaxies, spectroscopy Due to internal dynamics, turbulence and rotation etc., these clouds will generally have different velocities than the stars and HII regions, giving them a slight red- or blueshift w.r.t. these. Sometimes, we can distinguish slightly offset absorption line sets from several neutral gas clouds within the galaxy, which can reveal yet more information about its internal workings. Absorption like this happens in the dense, cold, neutral ISM as well as the hotter, less dense but more voluminous, ionized ISM. Different ionization degrees of the same atom will leave different sets of lines, so the same atom can be used to trace both hot and cold ISM. The difference between the line strengths can be used to assess the ionization degree of the parts of the galaxy we're looking at. Emission and absorption of different hydrogen lines is not equally likely, and happens in different places When it comes to Hydrogen lines particularly, the answer is not simple because the lines are very different. You will probably see absorption in Lyman-$\alpha$, because this is a very strong line, that is, if a photon of the right wavelength meets an atom at the right energy state, an absorption is very likely to happen - and these atoms are the most abundant in the Universe. But Lyman-$\alpha$ is complicated, and often you are likely to see both emission and absorption together creating a complicated line profile. Other lines, like the Balmer lines, are not very strongly absorbing, but emit very strongly, so you will mostly see emission from these lines. To see why this is, remember how emission and absorption happens. Lyman-$\alpha$ is the transition between the ground state and the first excited state of the hydrogen atom. In cold gas, hydrogen spends by far the most of its time in the ground state. That means that there are lots of atoms around ready to absorb in Ly$\alpha$. But once the absorption has happened, the electron doesn't sit around in the first excited state for long, but spontaneously re-emits the photons and decays back to the ground state. In the hot ISM, therefore, we can have Lyman-$\alpha$ emission from recombined atoms, and in the cold ISM, there is strong absorption happening. Here is Wikipedia's illustration of the Lyman and Balmer series, for reference:
{ "domain": "physics.stackexchange", "id": 9386, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astronomy, galaxies, spectroscopy", "url": null }
}^{\frac{1}{3}}}+\frac{0.0466106072058453}{{{\left( 7.54760961168997 {{10}^{-4}} \% i+0.01003464748627258\right) }^{0.3333333333333333}}}+0.2253968253968254],[1,1,1]]$ The following commands generate a (pseudo) random matrix 1000x1000 (with real coefficients normally distributed around the mean 0 with variance 1): (%i21) load(distrib)$
{ "domain": "uaslp.mx", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.972830769252026, "lm_q1q2_score": 0.8085615346754277, "lm_q2_score": 0.8311430520409023, "openwebmath_perplexity": 8210.193559783387, "openwebmath_score": 0.9115439653396606, "tags": null, "url": "http://galia.fc.uaslp.mx/~jvallejo/Maxima%20Mini-Tour%2019-May-2019.html" }
# Math Help - More Related Rates :D 1. ## More Related Rates :D Problem: A train is traveling 0.5 km/min along a straight track, moving in the direction as shown in the figure below. A movie camera, 0.5 km away from the track, is focused on the train. (a) How fast is the distance from the camera to the train changing when the train is 3 km from the camera? Give your answer to 3 decimal places. (b) How fast is the camera rotating at the moment when the train is 3 km from the camera? Give your answer to 3 decimal places. What I've done: Well I tried to solve for the first question by using the Pythagorean theorem: $ x^2 + .5^2 = z^2$ $z = \sqrt{x^2 + .25}$ Then I differentiated implicitly with respect to t: $ \frac{dz}{dt} = \frac{x \frac{dx}{dt} }{\sqrt{x^2 + .25}}$ And found x by plugging 3 into the original equation for z: $9 = x^2 + .25$ $x = \sqrt(8.75)$ Then plugged x back into $\frac{dz}{dt}$, and plugged in .5 for $\frac{dx}{dt}$ $ \frac{dz}{dt} = \frac{\sqrt{8.75} (.5) }{\sqrt{\sqrt{8.75}^2 + .25}}$ However, this gave me the wrong answer, so I have no idea what to do. I need help with BOTH part a and b. I'd really appreciate it! 2. The key to related rates is nearly always the chain rule, and this is what you haven't explicitly invoked. You might want to try filling up this pattern... ... where straight continuous lines differentiate downwards (integrate up) with respect to the main variable (in this case time), and the straight dashed line similarly but with respect to the dashed balloon expression (the inner function of the composite which is subject to the chain rule).
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9861513893774303, "lm_q1q2_score": 0.8062522121929186, "lm_q2_score": 0.8175744828610095, "openwebmath_perplexity": 447.17418914962894, "openwebmath_score": 0.8031945824623108, "tags": null, "url": "http://mathhelpforum.com/calculus/114013-more-related-rates-d.html" }
quantum-mechanics, wavefunction, schroedinger-equation, time-evolution The other equation people call the Schrödinger equation is the 'time independent Schrodinger equation'. This is a mathematical tool used in the process of solving the full TDSE. This equation reads something like: $$\hat{H}|E\rangle = E|E\rangle$$ where now we interpret the state $|E\rangle$ not an arbitrary state, but a state with a definite value of energy equal to $E$. The TISE then is read as an equation that, given the form of $\hat{H}$ tells lets you solve for the shape of states with each definite energy $E$. For many models it will turn out that this is only solvable for certain discrete values of $E$. That means that there are not states with intermediate definite energies, which in turn gives rise to the discreteness of atomic spectra etc (and the name 'quantum', ultimately). *P.S. the notation $|\text{stuff}\rangle$ just means 'quantum state of system'. It's convenient because it means you can label a state $|E\rangle$ because it has energy $E$ and not get the symbol for $|E\rangle$ the state and $E$ the number confused.
{ "domain": "physics.stackexchange", "id": 71587, "lm_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, time-evolution", "url": null }
energy, evaporation $$E = (100-30)*4.2 + 2260 = 2.5 MJ = 0.71 kWh$$ Note most of this energy is to actually evaporate the water, not to heat it up. It also tells us that if the evaporating is done in order to distill the water, we can get a LOT more energy efficient by condensing the steam using the incoming (dirty) water - the water will be heated "for free" by the steam, and the steam will turn back into (clean) water. All this quickly turns into engineering... I recommend that if you have follow up questions, you direct them to engineering.stackexchange.com .
{ "domain": "physics.stackexchange", "id": 21630, "lm_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, evaporation", "url": null }
sequence-annotation, ensembl, gtf, gencode What I want to do eventually is to assign the PolyA sites to ENSEMBL gene_ids. According to the GENCODE ftp README file, the value of the 'gene_id', 'transcript_id', 'gene_name' and 'transcript name' fields corresponds to a random identifier. The polyA features are not directly associated to any gene or transcript when manually annotated by Havana. There is other file in the GENCODE release that includes links between polyA features and transcripts: https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_41/gencode.v41.metadata.PolyA_feature.gz ENST00000485748.5 3232 3233 chr1 1496201 1496202 + polya_site ENST00000485748.5 3211 3216 chr1 1496180 1496185 + polya_signal ENST00000474481.1 3367 3368 chr1 1496201 1496202 + polya_site ENST00000474481.1 3346 3351 chr1 1496180 1496185 + polya_signal ENST00000308647.8 2114 2115 chr1 1496201 1496202 + polya_site ENST00000308647.8 2093 2098 chr1 1496180 1496185 + polya_signal 22. gencode.vX.metadata.PolyA_feature.gz: Manually annotated polyA feature overlapping the transcript 3'-end. 1 - transcript id 2 - transcript-based start coordinate of the polyA feature 3 - transcript-based end coordinate of the polyA feature 4 - polyA feature chromosome 5 - polyA feature start coordinate 6 - polyA feature end coordinate 7 - polyA feature strand 8 - polyA feature type ("polyA_site", "polyA_signal", "pseudo_polyA")
{ "domain": "bioinformatics.stackexchange", "id": 2259, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sequence-annotation, ensembl, gtf, gencode", "url": null }
operating-systems, cryptography, randomness, security, entropy NIST SP800-90B provides design guidelines for hardware RNG. Evaluating a hardware RNG is difficult. Hardware RNG are typically delicate beasts, which need to be used with care: many types require some time after boot and some time between reads in order to destabilize, they are often sensitive to environmental conditions such as the temperature, etc. Intel x86-64 processors based on the Ivy Bridge architecture provide the RdRand instruction which provides the output from a CSPRNG seeded by thermal noise. Most smartphone processors include a hardware entropy source, though Android doesn't always use it. Systems that lack a strong entropy source have to make do with combining weak entropy sources and hoping (ensuring would be too strong a word) that they will suffice. Random mouse movements are popular for client machines, and you might have seen the security show by certain cryptography programs that ask you to move the mouse (even though on any 21st century PC operating system the OS will have accumulated entropy without the application needing to bother). If you want to look at an example, you can look at Linux, though beware that it isn't perfect. In particular, /dev/random blocks too often (because it blocks until enough entropy is available, with an overly conservative notion of entropy), whereas /dev/urandom is almost always good except on first boot but gives no indication when it doesn't have enough entropy. Linux has drivers for many HRNG devices, and in accumulates entropy from various devices (including input devices) and disk timings. If you have (confidential) persistent storage, you can use it to save entropy from one boot to the next, as indicated above. The first boot is a delicate time: the system may be in a fairly predictable state at that point, especially on mass-produced devices that essentially operate out of the factory in the same way. Some embedded devices that have persistent storage are provisioned with an initial seed in the factory (produced by a RNG running on a computer in the factory). In virtualized server environments, initial entropy can be provisioned when instantiating a virtual machine from the host or from an entropy server.
{ "domain": "cs.stackexchange", "id": 3291, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "operating-systems, cryptography, randomness, security, entropy", "url": null }
beginner, bash, console, shell while true do echo echo "1) /bin" echo "2) /sbin" echo "3) /usr/bin/" echo "4) /usr/sbin" echo "5) /usr/local/bin" echo "6) /usr/local/lib" echo "7) /usr/local/share" echo "8) /usr/local/include" echo "9) exit" echo read -p 'Select a directory ' d if [[ $d = 1 ]]; then dir=/bin elif [[ $d = 2 ]]; then dir=/sbin elif [[ $d = 3 ]]; then dir=/usr/bin elif [[ $d = 4 ]]; then dir=/usr/sbin elif [[ $d = 5 ]]; then dir=/usr/local/bin elif [[ $d = 6 ]]; then dir=/usr/local/lib elif [[ $d = 7 ]]; then dir=/usr/local/share elif [[ $d = 8 ]]; then dir=/usr/local/include elif [[ $d = 9 ]]; then exit else echo 'No such directory' exit 1 fi echo while true do menu=( $(ls -1 ${dir}) ) i=0 for m in ${menu[@]} do echo "$(( i++ ))) $(basename $m)" done | xargs -L3 | column -t echo echo 'Select from the list above' echo 'Type b to go back to main menu' read -p 'Type q to quit at anytime ' n echo if [[ $n = 'b' || $n = 'B' ]]; then break 1 elif [[ $n = 'q' || $n = 'Q' ]]; then exit else for item in ${menu[$n]} do if [[ $item =~ '.txt' ]]; then item="$(echo ${item%.*})" fi man $item done fi done done
{ "domain": "codereview.stackexchange", "id": 21988, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, bash, console, shell", "url": null }
javascript, html, angular.js var familyMembers = [ { name: "Joe", age: 42} , { name: "Jane", age: 40} , { name: "Bob", age: 13} ];
{ "domain": "codereview.stackexchange", "id": 18204, "lm_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, html, angular.js", "url": null }
# Has anyone heard of this maths formula and where can I find the proof to check my proof is correct? $\sum^n_{i = 1}i + \sum^{n-1}_{i=1}i = n^2$ The formula basically is: The sum of all integers before and including $n$, plus all the integers up to and including $n-1$. This will find $n^2$. $$\sum^n_{i = 1}i + \sum^{n-1}_{i=1}i = n^2$$ • You can write formulae on Math SE using TeX. This document should be enough to get you started: ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf – 727 Aug 5 '15 at 22:45 • From Wikipedia: "Most simply, the sum of two consecutive triangular numbers is a square number." See the images here. Aug 5 '15 at 23:01 • The sum of all positive integers. Aug 7 '15 at 4:33 • In the title you ask whether somebody can check your proof. But there is no proof in your post and you have not poster a proof in an answer, either...? Aug 8 '15 at 8:51 $$\begin{array}{ccccccc}&&&\square&&&\\ &&\blacksquare&\square&\square\\ &\blacksquare&\blacksquare&\square&\square&\square\\ \blacksquare&\blacksquare&\blacksquare&\square&\square&\square&\square \end{array} \left.\rightarrow\quad \begin{array}{cccc} \square&\blacksquare&\blacksquare&\blacksquare\\ \square&\square&\blacksquare&\blacksquare\\ \square&\square&\square&\blacksquare\\ \square&\square&\square&\square \end{array}\quad\right\}n\\$$ In numbers,
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464478051827, "lm_q1q2_score": 0.8867624131500732, "lm_q2_score": 0.9086179012632543, "openwebmath_perplexity": 857.6873540672635, "openwebmath_score": 0.9676469564437866, "tags": null, "url": "https://math.stackexchange.com/questions/1385989/has-anyone-heard-of-this-maths-formula-and-where-can-i-find-the-proof-to-check-m/1385998" }
visible-light, reflection, laser, refraction Title: Curved Light stream? I was wondering, a while ago, i asked if there is a way to bend light someway, which I got the answer is index of refraction. Which is when light passes through a material it refracts to a certain degree. In this question I wish to know if this method when applied with a dense enough index, that that when you turn the light beam to a different direction, do you see it arc or curve in a smooth form, that given enough index of refraction or am I thinking of something else? I usually thought certain substances like a water tank with oil or sugar can cause a light beam to curve smoothly. Are you asking if it is possible to get a curved light beam by varying the refraction index? Yes, it is possible. Every time light propagates in a medium with a non uniform refraction index, the ray trajectory is not rectilinear. If there is a sharp transition between regions with two different values of the refraction index, the Snell law controls the angle the refracted beam gets closer or farther from the normal to the incidence point. If the refraction index is a smooth function of the position, the light beam is bent smoothly and follows a curve trajectory instead of a piece-wise straight line. The phenomenon can nicely observed with a laser pointer and a transparent container (like a fish tank) where some salt (NaCl is ok) is put on the bottom and then the container is gently filled by water (without stirring or creating turbulence). After some hours (even one day) there is an almost uniform vertical gradient of salt concentration. A laser beam entering from a side wall is clearly bent as in this picture. The entrance point is the spot on the left.
{ "domain": "physics.stackexchange", "id": 54089, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "visible-light, reflection, laser, refraction", "url": null }
data-cleaning, sql Title: CASE sentence for SQL query I have a question abut MySQL I would like to handle a column with characters without changing the original DB. Below is the levels of the column named 'Maker'. 기아, 현대, BMW, VolksWagen, Porsche So there are about 10 기아s, 20 현대s, 30 BMWs and so on. As you can see, some of them are written in Korean and others are in English. I do not want to touch English-written words. I only want to change Korean words into English. I tried to you CASE and IF sentences like below. SELECT CASE WHEN Maker='기아' THEN 'KIA' WHEN Maker='현대' THEN 'HyunDai' END AS new_Maker FROM table_name It successfully changes KIA and HyunDai but BMW, VolksWagen, and Porsche shows as NULL. I would appreciate any advice. Thank you. You haven't specified what happens for values other than '기아' ('KIA') and '현대' ('HyunDai'). Try SELECT CASE WHEN Maker='기아' THEN 'KIA' WHEN Maker='현대' THEN 'HyunDai' ELSE Maker END AS new_Maker FROM table_name
{ "domain": "datascience.stackexchange", "id": 5465, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "data-cleaning, sql", "url": null }
With this relationship in mind, let’s take a look at statement 1. ## (1) The next time he prepares this dish, Malik will make half as many servings as he did the last time he prepared the dish. Since we don’t know how many servings Malik made the last time, we still don’t know how many servings he will make the next time. So statement 1 is insufficient. Let’s try the next statement. ## (2) Malik used 6 cups of pasta the last time he prepared this dish. With this information, we can use the equation from our proportions before to find the number of serving Malik made the last time. $4*6 = \frac{3}{2}s$ $24 = \frac{3}{2}s$ $24*\frac{2}{3} = s$ $s = 16$ Great! Now we know Malik prepared 16 servings of the dish last time. But, we still don’t know how many servings Malik is planning on preparing next time. Insufficient. ## Let’s try both statements together: Well, we know Malik made 16 servings last time from statement 2. We also know that the next time, Malik will make half as many servings as he did last time. This means next time, Malik is planning on making 16/2 = 8 servings next time. Since we have proportions relating servings to cups of pasta, we know we can find the number of cups of pasta Malik will need next time. So, we have all the information we need. Still, let’s finish off the question to make sure. Plugging in 8 for the number of servings into our proportions equation, we have: $4p = \frac{3}{2}*8$ $4p = 12$ $p = 3$ So, we know Malik will need 3 cups of pasta the next time he makes the dish. Both statements together were sufficient.
{ "domain": "atlanticgmat.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9896718459575752, "lm_q1q2_score": 0.8044718989628942, "lm_q2_score": 0.8128673178375734, "openwebmath_perplexity": 1564.0918726539437, "openwebmath_score": 0.5386762022972107, "tags": null, "url": "https://atlanticgmat.com/maliks-recipe-for-4-servings-of-a-certain-dish-requires/" }
c#, strings, html, escaping possibleTag.Substring(0, 1) == "/", why not possibleTag[0] == '/'? It would be faster. if (replaceable?.Any() ?? false) 1) replaceable cannot be null, then if (replaceable.Any()) is almost fine 2) but it just check is List contains any elements, then if (replaceable.Length > 0) is better. 3) but foreach will not process the collection if it's empty, even Enumerable.Reverse call is fine for the empty collection. Thus you may wipe the if statement completely. The fastest way to construct some string from data in .NET Framework is StringBuilder. (.NET Core and newer .NET has Span-based method string.Create which is faster in some cases) And finally, here's my version of the implementation // required array can be created once per application start private static readonly string[] tags = "div span p br ol ul li center font strong em sub sup".Split(); public static string EncodeLessThanEntities(this string html) { if (html.Length < 8) // the shortest valid html is <p></p>: 7 chars but there's no room for other chars return html; StringBuilder sb = new StringBuilder(html.Length); // spawn StringBuilder with initial capacity, this will reduce amount of memory allocations int i; for (i = 0; i < html.Length - 2; i++) { if (html[i] == '<' && !tags.Any(tag => html.StartsWithAt(i + (html[i + 1] == '/' ? 2 : 1), tag))) sb.Append("&lt;"); else sb.Append(html[i]); } // 'i' has value 'html.Length - 2' here, append two last chars without changes return sb.Append(html[i]).Append(html[i + 1]).ToString(); }
{ "domain": "codereview.stackexchange", "id": 40930, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, strings, html, escaping", "url": null }
Each element of the set F = \left \{{f}_{1},\kern 1.95872pt {f}_{2},\kern 1.95872pt {f}_{3},\kern 1.95872pt {f}_{4},\kern 1.95872pt {f}_{5}\right \} = \left \{2,\kern 1.95872pt 5,\kern 1.95872pt 6,\kern 1.95872pt 7,\kern 1.95872pt 8\right \} is the index of a variable, except for {f}_{5} = 8. We refer to {x}_{{f}_{1}} = {x}_{2}, {x}_{{f}_{2}} = {x}_{5}, {x}_{{f}_{3}} = {x}_{6} and {x}_{{f}_{4}} = {x}_{7} as “free” (or “independent”) variables since they are allowed to assume any possible combination of values that we can imagine and we can continue on to build a solution to the system by solving individual equations for the values of the other (“dependent”) variables.
{ "domain": "ups.edu", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137942490254, "lm_q1q2_score": 0.8266843921082145, "lm_q2_score": 0.8418256412990657, "openwebmath_perplexity": 656.1434657925603, "openwebmath_score": 0.8862626552581787, "tags": null, "url": "http://linear.ups.edu/jsmath/0223/fcla-jsmath-2.23li19.html" }
ros, rviz, turtlebot, tutorial, 2d-pose-estimate $ rosrun rviz rviz -d `rospack find turtlebot_navigation`/nav_rviz.vcg [ INFO] [1315931847.897357347]: Loading general config from [/home/user/.rviz/config] [ INFO] [1315931847.905051080]: Loading display config from [/home/user/.rviz/display_config] [ WARN] [1315931876.219268690]: Message from [/amcl] has a non-fully-qualified frame_id [map]. Resolved locally to [/map]. This is will likely not work in multi-robot systems. This message will only print once. [ INFO] [1315931976.304023293]: Setting pose: 0.360 -0.107 -0.427 [frame=/map] [ INFO] [1315931996.143238028]: Setting pose: 0.322 -0.112 -0.390 [frame=/map] [ INFO] [1315932004.627046894]: Setting goal: Frame:/map, Position(-0.084, 0.127, 0.000), Orientation(0.000, 0.000, 0.996, 0.086) = Angle: 2.970 [ INFO] [1315932008.714840910]: Setting goal: Frame:/map, Position(-0.203, 0.249, 0.000), Orientation(0.000, 0.000, 0.987, 0.159) = Angle: 2.822 Originally posted by C on ROS Answers with karma: 13 on 2011-09-07 Post score: 1
{ "domain": "robotics.stackexchange", "id": 6623, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, rviz, turtlebot, tutorial, 2d-pose-estimate", "url": null }
#> 9 -0.873 -1.35 -0.680 -0.680 -0.873 0.0382 0.0171 1.22 -0.682 -0.623 #> 10 -0.873 -1.30 0.0915 0.0915 -0.873 0.0382 0.0171 -0.807 1.45 -0.623 #> # … with 68 more rows, and 8 more variables: V11 <dbl>, V12 <dbl>, V13 <dbl>, #> # V14 <dbl>, V15 <dbl>, V16 <dbl>, V17 <dbl>, V18 <dbl> Note that we use cbind rather than c within the for loop to add the results of z_trans to out. This is because z_trans returns a vector for every column of only_numeric. Alternatively, we also could have constructed a very long vector (with a length of nrow(fpp_numeric) x ncol(fpp_numeric) = 78 x 18 = 1404) and turned it into a rectangular table later. 1. Repeat the task of 2. (i.e., applying z_trans to all numeric columns of falsePosPsy) by using the base R apply function, rather than a for loop. Save and print your resulting data structure as a tibble out_2. Hint: Remember to set the MARGIN argument to apply z_trans over all columns, rather than rows. #### Solution # Data: # fpp_numeric out_2 <- apply(X = fpp_numeric, MARGIN = 2, FUN = z_trans) # Print result (as tibble): out_2 <- as_tibble(out_2) out_2 #> # A tibble: 78 x 18 #> study ID aged aged365 female dad mom potato when64 kalimba #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 -0.873 -1.70 -0.902 -0.902
{ "domain": "bookdown.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126513110865, "lm_q1q2_score": 0.8024399741234667, "lm_q2_score": 0.8198933293122507, "openwebmath_perplexity": 3506.343945840964, "openwebmath_score": 0.3427765369415283, "tags": null, "url": "https://bookdown.org/hneth/ds4psy/A-12-iter-sol.html" }
“there purely exists an $x:A$ such that $P(x)$ would denote the type $\mathchoice{\sum_{x:A}\,}{\mathchoice{{\textstyle\sum_{(x:A)}}}{\sum_{(x:A)}}{% \sum_{(x:A)}}{\sum_{(x:A)}}}{\mathchoice{{\textstyle\sum_{(x:A)}}}{\sum_{(x:A)% }}{\sum_{(x:A)}}{\sum_{(x:A)}}}{\mathchoice{{\textstyle\sum_{(x:A)}}}{\sum_{(x% :A)}}{\sum_{(x:A)}}{\sum_{(x:A)}}}P(x)$. We may also use “purely” or “actually” just to emphasize the absence of truncation, even when that is the default convention. In this book we will continue using untruncated logic as the default convention, for a number of reasons. 1. 1. We want to encourage the newcomer to experiment with it, rather than sticking to truncated logic simply because it is more familiar. 2. 2. Using truncated logic as the default in type theory suffers from the same sort of “abuse of language” problems as set-theoretic foundations, which untruncated logic avoids. For instance, our definition of “$A\simeq B$” as the type of equivalences between $A$ and $B$, rather than its propositional truncation, means that to prove a theorem of the form “$A\simeq B$” is literally to construct a particular such equivalence. This specific equivalence can then be referred to later on. 3. 3.
{ "domain": "planetmath.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517450056273, "lm_q1q2_score": 0.8407956260295587, "lm_q2_score": 0.8596637451167997, "openwebmath_perplexity": 430.16087788279094, "openwebmath_score": 0.9029503464698792, "tags": null, "url": "http://planetmath.org/310whenarepropositionstruncated" }
thermodynamics, statistical-mechanics, pressure, temperature, entropy Title: The definition of Spontaneous in thermodynamics? The definition of spontaneous is often briefly glossed over in most of the thermodynamics texts that I own. Peter Atkins in Physical chemistry defines spontaneous as follows Some things happen naturally, some things don’t. Some aspect of the world determines the spontaneous direction of change, the direction of change that does not require work to bring it about. Later in the text and in many others you then find that The entropy of an isolated system increases in the course of a spontaneous change: $\Delta S_{tot} > 0$
{ "domain": "physics.stackexchange", "id": 95735, "lm_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, statistical-mechanics, pressure, temperature, entropy", "url": null }
inorganic-chemistry, acid-base The amphoteric character of chromium(III) is stated in its Wikipedia article: Chromium(III) oxide is amphoteric. Although insoluble in water, it dissolves in acid to produce hydrated chromium ions, $\ce{[Cr(H2O)6]^3+}$ which react with base to give salts of $\ce{[Cr(OH)6]^{3−}}$. It dissolves in concentrated alkali to yield chromite ions $(\ce{[CrO2]^{-}})$. So, the rule of thumb is as oxidation number increases, charge on metal increases, acidic character increases. Also, basic oxide is soluble in water, acidic oxide is insoluble in water. This can be used to differentiate between acidic and basic oxide.
{ "domain": "chemistry.stackexchange", "id": 8336, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, acid-base", "url": null }
c++, algorithm, c++11, sorting, mergesort Title: Merge sort algorithm implementation using C++ (redux) This is a follow up question to the one I asked a couple of days ago. I reviewed the suggestions & did some research (specifically, read relevant info on CLRS). The new version is 3 times faster (210ms vs 71ms on 100,000 numbers) & looks cleaner. One thing I still feel weird about is not using iterators except than to init the sub-vectors. However, any attempt in using them causes a drop in performance (down to 120ms). I'm also curious if my code is good in terms of code style. Is this idiomatic C++? void merge(std::vector<int>& a, int p, int q, int r) { std::vector<int> l(a.begin() + p, a.begin() + q + 1); std::vector<int> ri(a.begin() + q + 1, a.begin() + r + 1); int n1 = q - p + 1; int n2 = r - q; int i, j; i = j = 0; while (i < n1 && j < n2) { if (l[i] < ri[j]) { a[p++] = l[i++]; } else { a[p++] = ri[j++]; } } while (i < n1) { a[p++] = l[i++]; } while (j < n2) { a[p++] = ri[j++]; } }
{ "domain": "codereview.stackexchange", "id": 7558, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, algorithm, c++11, sorting, mergesort", "url": null }
python, python-3.x, inheritance, heap, priority-queue def poppush(self, item, weight): # First pop, then push. weight, item2 = pyheapq.heapreplace(self.heap, (weight, item)) return item2 def change_weight(self, item, weight): i = self.heap.index(item) old_weight, item = self.heap[i] self.heap[i] = weight, item if weight < old_weight: pyheapq.siftdown(self.heap, 0, self.heap.index(item)) elif weight > old_weight: pyheapq.siftup(self.heap, self.heap.index(item)) def __bool__(self): return bool(self.heap) class _IndexedWeightList(list): """A list of (weight, item) pairs, along with the indices of each "item". We maintain an auxiliary dict consisting of, for each item, the set of indices of that item. Each set will typically have just one index, but we do not enforce this because the heapq module updates multiple entries at the same time. You could say that this class has all of the functionality of priority queue, but without the prioritization.
{ "domain": "codereview.stackexchange", "id": 34462, "lm_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, inheritance, heap, priority-queue", "url": null }
Hope this helps. 4. Originally Posted by Sudharaka Dear vuze88, Notice that, $(a^2+b^2-c)^2=a^4+b^4+c^2+2a^2b^2-2a^2c-2b^2c$ Therefore, $(a^2+b^2-c)^2-4a^2b^2=a^4+b^4+c^2-2a^2b^2-2a^2c-2b^2c$ $a^4+b^4+c^2-2(a^2b^2+a^2c+b^2c)=(a^2+b^2-c)^2-4a^2b^2=(a^2+b^2-c-2ab)(a^2+b^2-c+2ab)$ $a^4+b^4+c^2-2(a^2b^2+a^2c+b^2c)=((a-b)^2-c)((a+b)^2+c)$ Hope this helps. Really nice solution, just thought I should point out a small typo; the last "+" sign should be a "-". Cheers. 5. Originally Posted by undefined Really nice solution, just thought I should point out a small typo; the last "+" sign should be a "-". Cheers. Dear undefined, Thanks. Corrected it.
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9854964207345893, "lm_q1q2_score": 0.8102644452962662, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 2518.6773796577663, "openwebmath_score": 0.9730291366577148, "tags": null, "url": "http://mathhelpforum.com/algebra/149095-factorisation.html" }
newtonian-mechanics, rotational-dynamics, reference-frames, moment-of-inertia Title: I am confused about which point we should take moment of inertia (moi) in diff situations A uniform rod of mass m and length l is kept vertical with lower end clamped. It is slightly pushed to fall down under gravity. Find angular speed of rod when passing through its lowest position. I used work energy theorem here, but I got it wrong. It says that moi should be taken wrt the clamped end. Why can't we take moi about center-of-mass as we are measuring potential energy change wrt it. Any clarification would be appreciated. You have to be consistent in your calculation of kinetic energy. At the pivot, since it does not move you have $$ KE = \frac{1}{2} I_{\rm pivot} \omega^2 $$ But you can consider the center of mass, and include the linear motion as well $$ KE = \frac{1}{2} I_{\rm cm} \omega^2 + \frac{1}{2} m v_{\rm cm}^2 $$ You can easily show that both expressions will result in the same answer since $$ \begin{aligned} v_{\rm cm} & = \omega d \\ I_{\rm pivot} & = I_{\rm cm} + m d^2 \end{aligned} $$ where $ d = \frac{\ell}{2}$ the distance between the pivot and the center of mass. So your error wasn't the wrong point of calculating MMOI, but rather that you forgot to include the linear motion of the center of mass.
{ "domain": "physics.stackexchange", "id": 54920, "lm_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, rotational-dynamics, reference-frames, moment-of-inertia", "url": null }