Java 8 Stream sort map of string to list based on list
Sort a Map by values
Restrictive vs Non-restrictive Relative Clause Can you tell me the difference in the meaning of the two sentences below?  As a defining relative clause.     The location which was called Central Park was a park in New York.    As a non-defining relative clause.     The location, which was called Central Park, was a park in New York. Errors "*ERROR* UVD not responding, trying to reset the VCPU!!!" See my edit below, this is not totally a duplicate of   My reverse-search function in the CLI is broken and I don't know how to fix it back...  When I hit ctrl+r and search a command I did earlier, find it then press the right arrow key to use it, the output is broken. Here is an example:  # I reverse-searched the word "test" then pressed right arrow yoshiji@x1carbon:~/path/to/git/folder (master) $ch)`test': rake test #                                              ^^^^^^^^^^ weird output #                                                     ^ cursor right there   It also "shifts" my cursor to a different position. If I press enter, the right command is executed (rake test in this case) so it means the text displayed is not the same as what is actually executed.  I know this is most-likely related to my PS1 export in my ~/.bashrc, so here are the last lines of this file:  # Git branch in prompt. git_branch() {   branch=$(__git_ps1 2&gt; /dev/null)   if [ "$branch" = " (master)" ]; then      echo -e "\033[33m${branch}\033[00m" # yellow   elif [ "$branch" = "" ]; then      echo -e "\033[90m (no git)\033[00m" # red   else      echo -e "\033[32m${branch}\033[00m" # green   fi } PS1='\u@\h:\w$(git_branch) \$ '   This is something I wrote to displays the git branch in orange (if master branch) or else in green (or no git in gray).  Do you guys have any idea on what is causing this weird behavior?    Edit: This is a different problem from the  in the way that I am using echo -e "some string" to return a string having color+name of the git branch from the function git_branch(). Using echo -e does not escape the characters \[ and \] (try it yourself in your CLI: echo -e "\[\033[33m\]test").  Ideally, I would like to keep those conditional colors based on the branch's presence &amp; name (gray if no branch, orange if master, else green). How to understand the notion of a differential of a function $\operatorname{gcd}(ab,a+b)=1$ if $a$ and $b$ are relatively prime Suppose $X$ and $Y$ are independent positive random variables with probability density functions $f_X$ and $f_Y$ respectively. Show that $Z=X/Y$ is absolutely continuous and find its probability density function.   $\textbf{My Thought:}$ In order to show that $Z$ is absolutely continuous, I need to show that it has a commulative distribution function. Then I can also differentiate the latter to obtain the probability density function of $Z$. I have the following calculation \begin{align*} P(X/Y\leq z)&amp;=P(X\ge zY,Y&lt;0)+P(X\le zY,Y&gt;0)\\ &amp;=\int_{-\infty}^{0}\left(\int_{yz}^{\infty}f_{X}(x)dx\right)f_{Y}(y)dy+\int_{0}^{\infty}\left(\int_{-\infty}^{yz}f_{X}(x)dx\right)f_{Y}(y)dy\\ &amp;=\int_{0}^{\infty}\left(\int_{0}^{yz}f_{X}(x)dx\right)f_{Y}(y)dy. \end{align*} Also, if $z&lt;0$, then we have that $F_Z(z)=0,$ since $X,Y$ are positive random variables. Therefore the random variable $Z$ is continuous, and we can differentiate it to obtain the probability distribution function of $Z$. We have that $f_Z(z)=0$ if $z\leq 0,$ and otherwise we have $$f_Z(z)=\int_{0}^{\infty}yf_{X}(yz)f_Y(y)dy.$$    Is my reasoning above correct?  Any feedback is much appreciated.  Thank you for your time. I have a query to insert a row into a table, which has a field called ID, which is populated using an AUTO_INCREMENT on the column. I need to get this value for the next bit of functionality, but when I run the following, it always returns 0 even though the actual value is not 0:  MySqlCommand comm = connect.CreateCommand(); comm.CommandText = insertInvoice; comm.CommandText += "\'" + invoiceDate.ToString("yyyy:MM:dd hh:mm:ss") + "\', " + bookFee + ", " + adminFee + ", " + totalFee + ", " + customerID +  ")"; int id = Convert.ToInt32(comm.ExecuteScalar());   According to my understanding, this should return the ID column, but it just returns 0 every time. Any ideas?  EDIT:  When I run:  "INSERT INTO INVOICE (INVOICE_DATE, BOOK_FEE, ADMIN_FEE, TOTAL_FEE, CUSTOMER_ID) VALUES ('2009:01:01 10:21:12', 50, 7, 57, 2134);last_insert_id();"   I get:  {"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'last_insert_id()' at line 1"} How can I calculate the number of work days between two dates in SQL Server?   Monday to Friday and it must be T-SQL. How to get a tool that can only break specific blocks and has a name? So, right now I'm using this:  /give @p minecraft:diamond_pickaxe 1 0 {CanDestroy:[minecraft:stone]}   But I need one that also has the Name value. Anyone know this one? How to grep for text in a file and display the paragraph that has the text? Below is the text in the file:  Pseudo name=Apple Code=42B state=fault  Pseudo name=Prance Code=43B state=good   I need to grep for "42B" and get the output from the above text like:   Pseudo name=Apple Code=42B state=fault   Does anyone have idea on how to achieve this using grep/awk/sed? How do I make a Theme from scratch for Unity? I'd like to make a theme from scratch for Unity.  What knowledge and information/skills are needed? Are there any tools or templates out there for something like this already? I don't have any Python experience so tools biased towards beginners are preferable. Is the universe fundamentally deterministic? I'm not sure if this is the right place to ask this question. I realise that this maybe a borderline philosophical question at this point in time, therefore feel free to close this question if you think that this is a duplicate or inappropriate for this forum. Anyway, I'm an electrical engineer and I have some basic knowledge of quantum mechanics. I know that Schrödinger's equation is deterministic. However, quantum mechanics is much deeper than that and I would like to learn more. If this question is not clearly answerable at this point than can anyone point out some recognized sources that try to answer this question. I would appreciate it if the source is scientific and more specifically, is related to quantum theory. How does the "tail" command's "-f" parameter work? $ tail -f testfile   the command is supposed to show the latest entries in the specified file, in real-time right? But that's not happening. Please correct me, if what I intend it to do is wrong...  I created a new file "aaa" and added a line of text and closed it. then issued this command (first line):  $ tail -f aaa xxx xxa axx   the last three lines are the contents of the file aaa. Now that the command is still running (since I used -f), I opened the file aaa via the GUI and started adding a few more lines manually. But the terminal doesn't show the new lines added in the file.  What's wrong here? The tail -f command only shows new entries if they are written by system only? (like log files etc) June 13th 2017 Microsoft blocked handling HTML markup in SharePoint calculated fields - how to get the same functionality back On June 13th 2017 all SharePoint calculated columns with HTML markup stopped working.   Basically the fields now render text (regardless of setting the data type to number). The gist of the notice from Microsoft () is:     In Microsoft SharePoint lists and libraries, calculated fields that   are running in the classic UI mode can be used to display results   based on Excel-like formulas. This is a long standing capability, and   is documented in Calculate data in lists or libraries.      Some users have added HTML markup or script elements to calculated   fields. This is an undocumented use of the feature, and we will begin   blocking execution of custom markup in calculated fields in SharePoint   Online from June 13, 2017 onwards. We are also providing this as a   configurable option for on-premises in SharePoint Server 2016 and   SharePoint Server 2013 via the June 2017 and subsequent Public   Updates.   As we don't have on premise SharePoint (online), we have to find an immediate work around, given that this impacts our processes and thus, business.   Is anyone aware of third party applications that will allow for HTML, script markup (that works with SP online)? I want to use the top half of the circle to make a cut but whenever I apply the boolean modifier, the circle just stays there and becomes attached to my other object.  I've managed to make the cut in a standard cube but not sure why it's not working for this...? What is time dilation really? Please will someone explain what time dilation really is and how it occurs? There are lots of questions and answers going into how to calculate time dilation, but none that give an intuitive feel for how it happens. I hear so many terms involving the word "linear". Linear function, linear equation, linear system, linear operator, linear transformation, linear mapping, linear space, linear algebra, linear electrical circuits, linear filters, linear electrical elements, linear approximation, linear optimization.  I'm getting crazy trying to understand the application of the "linear concept" to all this aspects (function, equation, mapping, system, operator, transformation, algebra, etc.) and I wish to know the one essence that is to be linear. What something has to be to be linear? If I say something is linear, what do I know for sure about that something (no matter what the something is)?       I heard a definition of linearity is by homogeinity (scaling the input results in a scaled output) and addition (summing the inputs results in summing the outputs). Can I apply this simple definition to all the branches (operator, mapping, system, transformation, algebra, ...) I mentioned ? Do they all behave like a line ?  y = ax + b, for example, is a line but doesn't behave like a line because y is not linear. If a person holds prejudice against people because of their nationality, would that be considered racist? Would it be considered racist if a store owner believes all Canadians are thieves and does not let any Canadians into his store? Racism pertains to discriminating based on race, and (correct me if I'm wrong) Canadians are not a race. What would be an appropriate word to describe an individual such as the  store owner?  The discrimination is specific to Canadians, not foreigners in general. I'm looking for a word that could be applied to someone who lives in the country they discriminate against. For example if a Canadian announces "all Canadian culture is stupid!" what would that be called? I've discovered a rather weird behaviour of PdfLaTeX. In this example  \documentclass{article} \usepackage[breaklinks]{hyperref} \begin{document} \url{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/} \end{document}   PdfLaTeX won't break the URL and create a too long line. However, if I replace \url with \href like this:  \documentclass{article} \usepackage{hyperref} \begin{document} \href{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/}{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/} \end{document}   I get the line broken, but the font of the link is not right any more of course (normal instead of texttt). Why doesn't URL break the line at dashes and what could I do to get a nicely typeset line-broken link? If the $n^{th}$ partial sum of a series $\sum a_n$ is $S_n = \dfrac{n-1}{n+1}$, find $a_n$ and the sum.  By definition,  the sum of the series is the $\lim n\to\infty$ of it's $n^{th}$ partial sum.  $$\text{ Sum = } \lim_{n\to\infty} = \dfrac{n-1}{n+1} = 1$$  I am asked to find $a_n$. How do I do this? What is the procedure?