How to create args[] from string in java
Split string on spaces in Java, except if between quotes (i.e. treat \"hello world\" as one token)
If I add a new case class, does that mean I need to search through all of the pattern matching code and find out where the new class needs to be handled?  I've been learning the language recently, and as I read about some of the arguments for and against pattern matching, I've been confused about where it should be used.  See the following:  Pro:  and    Con:   The comments are pretty good in each case, too.  So is pattern matching something to be excited about or something I should avoid using?  Actually, I imagine the answer is "it depends on when you use it," but what are some positive use cases for it and what are some negative ones? I am getting a warning when trying to include the .net 3.5 sp1 prerequisite for my setup project.  The warning states Prerequisite could not found for bootstrapping.  Any suggestions?  Thanks how to output text to both screen and file inside a shell script? Currently I have a shell script which logs messages to a log file like this:  log_file="/some/dir/log_file.log" echo "some text" &gt;&gt; $log_file do_some_command echo "more text" &gt;&gt; $log_file do_other_command   When executing this script, there is no output to screen, and, since I'm connecting to the server via putty, I have to open another connection and do "tail -f log_file_path.log", because I can't terminate the running script and I want to see the output in real time.  Obviously, what I want is that the text messages are printed on screen and into file, but I'd like to do it in one line, not two lines, one of which has no redirection to file.  How to achieve this? In my book, the following are described to be the steps that one must follow if he wishes to find the direction of static friction force acting on an object:  &quot;(1) Draw the F.B.D(free body diagram) of the object in question with respect to the other object on which it is kept. (2) Include the pseudo force also, if the contact surface is accelerating. (3) Decide the direction of the resultant force and resolve this force into two components; one along the surface of contact and the other along the normal to this surface. (4) The direction of static friction is opposite to the component of the result force along the contact surface.&quot;  Firstly, are these steps correct? Will I always obtain the correct answer by following these steps? Secondly, consider the following problem:  In questions like these, when I try to find the resultant force and then assign the direction to static friction, I find that my answer is incorrect! Are there some other steps to follow when I know that the object is definitely accelerating in one direction or another? Edit 1: I approached the above question by doing exactly what my book suggests; first, I identified all the forces acting on the smaller block, being the normal force applied by the block A and its weight mg downward. Adding these two forces, I get another force that actually acts on the body like so:  I wonder if I'm not supposed to take either of the contact forces into consideration when drawing the F.B.D to figure out the direction of static friction acting on the body. Also, are there other steps for finding the direction of kinetic friction? Edit 2: From Judge's answer, I have been able to figure out my mistake, it being that I completely missed step (3) and didn't resolve the resultant force into components! Sheesh. Sorry! Much thanks in advance! :) Regards. Space after LaTeX commands In an exercise in Atiyah-Macdonald it asks to prove that the prime spectrum $\operatorname{Spec}(A)$ of a commutative ring $A$ as a topological space $X$ (with the Zariski Topology) is compact.   Now because the basic open sets $X_f = \{\mathfrak{p} \in \operatorname{Spec} (A) : \{f\} \not\subseteq \mathfrak{p} \}$ form a basis for the Zariski Topology it suffices to consider the case when   $$X = \bigcup_{i \in I} X_{f_i}$$   where $I$ is some index set. Then taking the complement on both sides we get that   $$\emptyset = \bigcap_{i \in I} X_{f_i}^c$$  so there is no prime ideal $\mathfrak{p}$ of $A$ such that all the $f_i$'s are in $\mathfrak{p}$. Now from here I am able to show that the ideal generated by the $f_i$'s is the whole ring as follows. Since there is no prime ideal $\mathfrak{p}$ such that all the $f_i \in \mathfrak{p}$, it is clear that there is no $\mathfrak{p}$ such that $(f_i) \subseteq \mathfrak{p}$ for all $i \in I.$ Taking a sum over all the $i$ then gives $$\sum_{i \in I} (f_i) = (1).$$  Now here's the problem:          How do I show from here that there is an equation of the form $1 = \sum_{i \in J} f_ig_i,$ where $g_i \in A$ and $J$ some finite subset of $I$?       This part has been giving me a headache. I am not sure if the finiteness bit has to do with algebra, topology or the fact that we are dealing with prime ideals.  This is not a homework problem but rather for self-study.  $\textbf{Edit:}$ I have posted my answer below after the discussion with Dylan and Pierre. How to determine the optimal control law? Given the differential equation $$\dot x = -2x + u$$ determine the optimal control law $u = - kx$ that minimizes the performance index $$J = \int_0^{\infty} x^2 \, \mathrm d t$$  My approach was to find the state feedback $k$. But since the value of $R$ (positive semidefinite Hermitian) is not given, that means $R=0$. How do I determine the optimal control for this system where $R=0$? I just recently completed a neutral run where I experimented seeing how the story would go on if I only killed certain characters (it was my second run, my first run was True Pacifist) and I ended up choosing to kill Flowey instead of letting him live. I planned to start a Genocide run after resetting the game, but Flowey was gone when i did. Flowey is basically the base for each story in undertale (pacifist and genocide) so I know I can't progress any further without him being here. I really just want to start anew and, without Flowey, I dont think I can access True Resets anymore. It may be possible if I did a genocide route, but then I'd have to fight Sans, and that would take FOREVER.  Basically, I am wondering if I can erase all my progress somehow. I heard that True Resets don't erase everything entirely, so is there another way? Please respond, Undertale is the only game I have that's any fun and I don't want to have to buy another game. Where to place my local website starting with the 2.4.7 version of apache2? I recently installed Ubuntu 14.04, then I installed lamp-server and placed my webpages in /var/www directory, but when I opened localhost in the browser there was nothing. I think that happened because Zend updated Apache.  Whatever the reason may be, I want to know where to keep my php files so that I can access them from my browser. I'm trying to prove that $e^{\sqrt 2}$ is irrational. My approach: $$ e^{\sqrt 2}+e^{-\sqrt 2}=2\sum_{k=0}^{\infty}\frac{2^k}{(2k)!}=:2s $$ Define $s_n:=\sum_{k=0}^{n}\frac{2^k}{(2k)!}$, then: $$ s-s_n=\sum_{k=n+1}^{\infty}\frac{2^k}{(2k)!}=\frac{2^{n+1}}{(2n+2)!}\sum_{k=0}^{\infty}\frac{2^k}{\prod_{k=1}^{2k}(2n+2+k)}\\&lt;\frac{2^{n+1}}{(2n+2)!}\sum_{k=0}^{\infty}\frac{2^k}{(2n+3)^{2k}}=\frac{2^{n+1}}{(2n+2)!}\frac{(2n+3)^2}{(2n+3)^2-2} $$ Now assume $s=\frac{p}{q}$ for $p,q\in\mathbb{N}$. This implies: $$ 0&lt;\frac{p}{q}-s_n&lt;\frac{2^{n+1}}{(2n+2)!}\frac{(2n+3)^2}{(2n+3)^2-2}\iff\\ 0&lt;p\frac{(2n)!}{2^n}-qs_n\frac{(2n)!}{2^n}&lt;\frac{2}{(2n+1)(2n+2)}\frac{(2n+3)^2}{(2n+3)^2-2} $$ But $\left(p\frac{(2n)!}{2^n}-qs_n\frac{(2n)!}{2^n}\right)\in\mathbb{N}$ which is a contradiction for large $n$. Thus $s$ is irrational. Can we somehow use this to prove $e^\sqrt{2}$ is irrational? Access 2007 Work in a separate file using ACCDE Have been working in an Access 2007 application for over 3 weeks and it should be ready now. Anyway, I know (and tried) that "Make ACCDE" can actually split the raw data from the application itself so you can run it using the Access RunTime.  The question is... can I deploy my app for general use and modify a separate copy of the forms/views inside the application to deploy it when it´s ready without touching the data? Does the proof of Bolzano-Weierstrass theorem require axiom of choice? Does there exist an holomorphic function such that $|f(z)|\geq \frac{1}{\sqrt{|z|}}$? I have some trouble solving this problem: Does there exist a holomorphic function $f$ on $\mathbb C\setminus \{0\}$ such that $$|f(z)|\geq \frac{1}{\sqrt{|z|}}$$ for all $z\in\mathbb C \setminus \{0\}$? I don't know where to start. My intuition is that you would get a problem with the singularity near $0$, but I am not sure how to prove it. Any help would be appreciated! Thanks! 1) How do I prove the following:   Let A = {6a + 4b ∈ Z : a, b ∈ Z} and B = {2a ∈ Z : a ∈ Z}. Show that A = B.  Thank you all for the help! Why did the texture I painted in texture paint mode disappear? I was following a  on how to use the Texture Paint feature on blender so I could paint on a terrain I am modeling. I was successful to paint the whole terrain with beautiful, exuberant vegetation, and crystalline water running through the valley.  So I saved my file, and I went to sleep. But now I've reopened the file and everything seems like I left it yesterday, except that I can see no texture in the terrain... The weird thing is that the textures i used are still there... I don't understand, I barely understand the interface, please help. I'm not even sure if the texture is there or if it was never "saved" or something...     I am now going through the second part of the tutorial for possible answers but I (and hopefully many more) will be grateful for your help. Why are the objects in my hair particle system not sitting on top of the ground? I made a hair particle system and set the Dupli Group to a group of 3 objects. Each of the 3 objects has:   it's origin set to be touching the XY plane (on layer 2) it's Scale applied to 1 and it's Rotation applied to 0     I am trying to get each of the objects to sit directly on top of the ground, but instead, they are centered in the plane, half above the plane and half below the plane:      What am I doing wrong? Here is . How does extra damage work for critical hits? Can one executable be both a console and GUI application? I want to make a  program that can be run as a CLI or GUI application depending on what flags are passed into it. Can this be done?  I have found these related questions, but they don't exactly cover my situation: Understanding QGIS buffer tool units How to approximate the student-t CDF at a point without the hypergeometric function? Is there a way to closely approximate the CDF of a student-t distribution at a point $x$ without involving the hypergeometric function? For example, by using a series expansion, or expressing the CDF in terms of simpler functions?  The t-distribution can   $$t = \frac{X\sqrt{n}}{Y}$$  where $X$ is normally distributed with mean 0 and variance $\sigma^2$; $\frac{Y^2}{\sigma^2}$ has a chi-squared distribution. Maybe this expression can help simplify the t CDF?  I am trying to write an algorithm to compute the student-t CDF for any real number, so using the hypergeometric function will be extremely difficult. I am also trying to avoid integrating the PDF to get the CDF.