Parenthesis and regular expressions
Finding parenthesis via regular expression
WhatsApp for Ubuntu Phone? Does someone know if there already is a WhatsApp Version for Ubuntu Phone? I decided to install Ubuntu on my Android, but I don't want to use my phone without WhatsApp. What is the correct formula for gravitational time dilation for a satellite in a circular orbit? In the Wikipedia article on  I see two formulae for the gravitational time dilation. One contains $\sqrt{1 - r_0/r}$ but the other $\sqrt{1 - 1.5 r_0/r}$. What formula should I use to calculate the time dilation due to gravity inside a satellite? The speed induced time dilation is of course just special relativity.  With the first of these two formulas I can perfectly reproduce the graphs on time dilation as a function of $r$,  I find that the two contributions to time dilation cancel at 1.5 Earth radii, all numbers are OK... But why not the second formula? CASE WHEN with GROUP BY I have a table that looks like this (oversimplified case of the actual case to make my point)  CREATE TABLE sales (    id int,    currency VARCHAR(5),    price int    shop_id int );   Now I need to make a query that will give me something like this table, grouping by shops yet giving sum of sales per currency My problem is when I make currency column non aggregate it fails because my query becomes non standard. When I add currency to group by then each currency creates new row, something I don't want. I have run out of option and would appreciate any help or pointer to the right direction.  I use MySQL but would appreciate if I would get the solution that works with more databases (PostGreSQL being at the top of the list after MySQL)  Query that works with undesired results  SELECT   shop_id,           (CASE WHEN currency= "GBP" THEN SUM(price) ELSE 0 END) AS POUND,           (CASE WHEN currency= "USD" THEN SUM(price) ELSE 0 END) AS USDOLLAR GROUP BY shop_id, currency   The data that should be produced by the query  shop_id     |   POUND   |   USDOLLAR     -----------------------------------------     1       |   400     |   300 -----------------------------------------     2       |   250     |   100 -----------------------------------------     3       |   400     |   100 ----------------------------------------- I tried to install OracleJDK 8 using   sudo add-apt-repository ppa:webupd8team/java   But it's not working.   I searched the problem and found that      "The Oracle JDK License has changed for releases starting April 16, 2019." And  "Oracle Java (JDK) 8 Installer PPA (DISCONTINUED)"   So I installed the OpenJDK8 .   But why oracle cancelled the license of oracle 8 installer? This is probably easier to show than tell...   On the recent question , I see the following:    As you can see, the first five links render properly, but after that, they stop converting.  Unfortunately, this isn't obvious to the person writing the post, which I discovered when I went to edit the post to fix the "broken" links. In the edit window, it renders all of the links just fine:    I understand that this behavior is expected based on balpha's answer :        Links to questions on the same site are unlimited.   Links to other sites are limited to             a) 5 linked-to sites and     b) N questions per target site, where N is 200 on meta sites and 10 on non-metas (this is about the site that the post containing the link is posted on, not the site that is being linked to)         So if this rule is still going to stay in effect, please fix the edit view to also not automatically convert more than five linked-to sites to help people writing posts know that they need to manually title the links to the other questions.  That said, I'd prefer that (at least on MSE) this limitation be removed or raised. Even in the answer, balpha says:     The restrictions are currently as follows, but note that they do look a bit contrived, resulting from the fact that they have grown over time (from single site to cross-site, from "there are no subsites" to "facebook.SO", etc.), so it's not unlikely that we'll revisit them.   So, if it's not hurting performance, can we please increase the limit or remove it? Student t as mixture of gaussian Using the student t-distribution with $k &gt; 0$ degrees of freedom, location parameter $l$ and scale parameter $s$ having density  $$\frac{\Gamma \left(\frac{k+1}{2}\right)}{\Gamma\left(\frac{k}{2}\sqrt{k \pi s^2}\right)} \left\{ 1 + k^{-1}\left( \frac{x-l}{s}\right)\right\}^{-(k+1)/2},$$  how to show that the Student $t$-distribution can be written as a mixture of Gaussian distributions by letting $X\sim N(\mu,\sigma^2)$, $\tau = 1/\sigma^2\sim\Gamma(\alpha,\beta)$, and integrating the joint density $f(x,\tau|\mu)$ to get the marginal density $f(x|\mu)$? What are the parameters of the resulting $t$-distribution, as functions of $\mu,\alpha,\beta$?  I got lost in calculus by integrating the joint conditional density with the Gamma distribution. "Subject, verb, direct object, object complement" versus "subject, verb, indirect object, direct object" Reading English Grammar (HarperCollins College Outline, published by HarperResource, an imprint of HarperCollinsPublishers) I found a chapter (Sentence Basics) that explains that in English there are different sentence patterns; in particular   Subject, verb, direct object, object complement Subject, verb, indirect object, direct object   The chapter reports the following example for the patterns:     Alice called Charles Professor Miller.   Alice gave Charles the rabbit.   What is the difference between the two kind of sentences? What is the difference between the object complement in the first case, and the indirect object in the second case?  PS: The question, which could appear silly, comes from the fact in my first language there is only the object complement. How to read a text file reversely with iterator in C# I need to process a large file, around 400K lines and 200 M. But sometimes I have to process from bottom up. How can I use iterator (yield return) here? Basically I don't like to load everything in memory. I know it is more efficient to use iterator in .NET. Does the harmonic series converge if you throw out the terms containing a $9$? I found this very amusing comic on the internet the other day:   The last frame seems to claim that the harmonic series converges if you throw out all the terms with a $9$ in the denominator. Is this true? Where could I find a proof? Is it only true for terms with a $9$ or is it true for any number? If it's only true for $9$, why is that? Which groups have precisely two automorphisms Which groups $G$ have precisely two automorphisms, i.e., precisely one non-trivial automorphism?  Examples: $G= C_3, \mathbf{Z},\ldots$.  I think $G$ has to be abelian. In fact, we have $ \vert G\vert \geq 3$. Therefore, if $G$ is not abelian, we have at least two non-trivial inner automorphisms.  If we can show that $G$ is cyclic the above examples are all of them. Which equals operator (== vs ===) should be used in JavaScript comparisons? I'm using  to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.  Is there a performance benefit to replacing == with ===?   Any performance improvement would be welcomed as many comparison operators exist.  If no type conversion takes place, would there be a performance gain over ==? Need help with SQL Server PIVOT I know about the PIVOT feature in SQL Server and I've read a few other questions and answers on here but I just can't seem to grasp it in order to do what I need. I'm trying to run some calculations and I have the following:  TABLE office_settings column office_id (bigint not null) column setting_value (NVARCHAR(500) NOT NULL)  office_id    setting_value -------------------------------------------- 4             0.2 4             0.2 4             2 4             3 5             0.2 5             0.2 5             2 5             3   I'd like to convert this using PIVOT (assuming that's the right tool for the job) to this, basically "grouping by" the office_id column, so:  office_id    value_1    value_2    value_3   value_4 ------------------------------------------------------     4         0.2         0.2         2         3     5         0.2         0.2         2         3   I should also mention that I need to CAST the setting_value column values to DECIMAL(4,2) in the process of this - in case that has any bearing on the T-SQL required to accomplish it.  Any ideas? How do you get \mathbb{1} to work (characteristic function of a set)? I am trying to get the digit one printed the \mathbb{} font in math mode, however the command  \mathbb{1}   outputs some rubbish. I certainly saw the character I am after in some pdf's generated from latex, hence my question: how do you get it to work? This question is a sequel of sorts to my  about .  In the paper, the authors performed molecular dynamics (MD) simulations of parallel-plate supercapacitors, in which liquid resides between the parallel-plate electrodes.  The system has a "slab" geometry, so the authors are only interested in variations of the liquid structure along the $z$ direction.  In my previous question, I asked about how particle number density is computed.  In this question, I would like to ask about how the electric potential is computed, given the charge density distribution.  Recall that in CGS (Gaussian) units, the Poisson equation is   $$\nabla^2 \Phi = -4\pi \rho$$  where $\Phi$ is the electric potential and $\rho$ is the charge density.  So the charge density $\rho$ is proportional to the Laplacian of the potential.  Now suppose I want to find the potential $\Phi(z)$ along $z$, by integrating the Poisson equation.  How can I do this?  In the paper, on page 254, the authors write down the average charge density $\bar{\rho}_{\alpha}(z)$ at $z$:  $$\bar{\rho}_{\alpha}(z) = A_0^{-1} \int_{-x_0}^{x_0} \int_{-y_0}^{y_0} dx^{\prime} \; dy^{\prime} \; \rho_{\alpha}(x^{\prime}, y^{\prime}, z)$$  where $\rho_{\alpha}(x, y, z)$ is the local charge density arising from the atomic charge distribution of ionic species $\alpha$, $\bar{\rho}_{\alpha}(z)$ is the average charge density at $z$ obtained by averaging $\rho_{\alpha}(x, y, z)$ over $x$ and $y$, and $\sum_{\alpha}$ denotes sum over ionic species.  The authors then integrate the Poisson equation to obtain $\Phi(z)$:  $$\Phi(z) = -4\pi \sum_{\alpha} \int_{-z_0}^z (z - z^{\prime}) \bar{\rho}_{\alpha}(z^{\prime}) \; dz^{\prime} \; \; \; \; \textbf{(eq. 2)}$$  My question is, how do I "integrate the Poisson equation" to obtain equation (2)?  How do I go from  $\nabla^2 \Phi = -4\pi \rho$ to equation (2)?  In paricular, where does the $(z - z^{\prime})$ factor come from?   Thanks for your time. Smooth rendering of bitmap fonts I would like to use the Concrete Math font in LaTeX, which is a bitmap font. The rendering with pdflatex is naturally poor-quality with jagged edges.  My solution so far has been to generate a DVI file and then convert to PDF using Linux's dvipdf. This tool effectively traces and smooths the edges of the glyphs and the end result is beautiful. However, using the DVI output format (with latex) causes a host of other problems with including figures, etc. For instance, you can't include .png or .pdf figures when using plain LaTeX.  Is there a way to somehow get the same bitmap font-smoothing effect in pdflatex? or via an intermediate format that still allows you to include at least .png figures? Suppose that $U_n=\frac{1}{\sqrt{2n\sigma^2}}\left(\Sigma X_j-\Sigma Y_j\right)$,  where $X_1,X_2,\ldots$ and $Y_i,Y_2, \ldots$ are i.i.d. sequences of random variables with mean $\mu$ and variance $\sigma^2$ and the sequences $\{X_i\}$ and $\{Y_i\}$ are independent.  Then, for all real numbers $x$, show that, as $n\to \infty$,  $$\mathbb{P}(U_n\leq x) \to  \int_{-\infty}^{x} \frac{1}{(\sqrt(2\pi))} \:e^{-\frac 12{u^2}}\mathrm du $$ Approach  I tried to carry out the integration on the right, but this does not integrate nicely. It ends up involving an error function, so I figured this was the wrong was to go.  Should I be looking at convergence in probability to answer this question? Is Chebyshev's inequality relevant here? If so, how and how does that relate to the integral? Nikkor f/1.8G 35mm or 50mm? I'm new to photography. I got a Nikon D3100 with the 18-55 kit lens.  I was looking to buy a f/1.8 prime lens, and I found two options:   AF-S DX NIKKOR 35mm f/1.8G   AF-S DX NIKKOR 50mm f/1.8G   How should I go for choosing one or the other? Reading through this doc:      We replaced the rich text editor in HTML Area home page components   with a new version that supports more markup but doesn’t allow HTML to   be manually entered.      In Summer ’15 we will start removing unsupported code from HTML Area   home page components. As a result, components that contain JavaScript,   CSS, iframes, or other unsupported markup might stop working properly.   To use JavaScript or other advanced HTML elements in your home page   component, we recommend that you use a Visualforce Area component   instead.   With Visualforce homepage component the best we could do is design fancy home page components, which has not been the big use of sidebar amongst developers. How do we do the fancy hack we do today using html components since visualforce is hosted in a different domain will the sidebar hacks even work after summer 15?     You can include JavaScript in your Visualforce page, but because the   component is rendered in an iframe on the home page layout, the   JavaScript can’t interact with the page that contains the component.   Finally why this move :(? Do spellcasters know when a dismissable spell has been broken? Do spell casters know how long their spells are active, and can they tell at a glance?  Specifically lets talk about , as I know its a permanent duration and dismissable. Does the spell caster who put someone under this spell know how long it is active? Could they tell automatically just by seeing the person (without any clues like them walking in a maze without difficulty or reacting to a sound)? So could they tell if someone has broken the spell they cast? JavaFX accordion with multiple open panes