If statements with a Boolean
Map a function across a list conditionally
What is this "answer your own question" jazz? What is the format for e-mail headers that display a name rather than the e-mail? Why use Chef/Puppet over shell scripts? New to Puppet and Chef tools. Seems like the job that they are doing can be done with shell scripting. Maybe it was done in shell scripts until these came along.  I would agree they are more readable. But, are there any other advantages over shell scripts besides just being readable? "Welcome to the Jones__": Plural or Plural Possessive? When making a welcome sign, what form of the name Jones would you use?  ("Welcome to the Jones__") Establishing a Basis for $F[x]/(f(x))$ Hypothesis:   $f(x) = a_0 + a_1 x + \ldots + a_n x^n \in F[x]$ s.t. $f(x)$ irreducible over field $F$. $deg(f(x)) = n \ge 1$. Let $V = (f(x)) \subset F[x]$.   Goal: Show that $\mathcal{B} = \{1 + V, x + V, x^2 + V, \ldots , x^{n-1} + V\}$ forms a basis for $E = F[x]/V$  Attempt:   Linear Independence: If this set weren't linearly independent, then a non-trivial $b_i \in F$ would satisfy  $$ b_0 + b_1x + \ldots + b_{n-1} x^{n-1} + V = 0 + V $$   But this would then imply that $b_0 + b_1x + \ldots + b_{n-1} x^{n-1}  \in 0 + V$. But this would contradict $V = (f(x))$ since it is impossible that $f(x)\,\,|\,\,b_0 + b_1x + \ldots + b_{n-1} x^{n-1}$ of strictly lower degree.  Now how would I show that this set spans $F[x]/V$? I am working on a few examples where my author said this is true if $h$ is continuous. Can someone explain why? Just because the integral is $0$ doesn't mean the integrand is zero as well.   $\int_{a}^b h^2=0\implies h=0$? given a polynomial $p(x,y)$ from $\mathbb Z[x,y]$. I want to substitute $x=1$ leaving $y$ as it is. The command Value(p,[1,y]) does not work. Can you give me a hint?  After that it gets a little more complicated. Let  $$p(x,y)=x^6+y^6$$ After substituting $x=1$ we have $p(1,y)=1+y^6$. Given a natural number $j$. I want to find all expressions $y^j$ in $p$ and substitute these $y^j$ by $1$ and the others by $0$. In this case (and for $j=6$) we would get $1+1=2$. If $$p(x,y)=x^4y^2+x^2y^6$$ we should get $0+1=1$. Is there any way to do this?  Thanks for reading! edit: Well, it turns out I used the function Value wrong. The right code for my problem would be Value(p,[x,y],[1,y]). So my first question is solved. I've tried to set -g mouse on, and it works pretty well, but standard mouse behaviour (select, copy &amp; paste) is disabled. But, it enables if I press "Shift" button, and while I hold it, I can select, copy &amp; paste text from/to terminal. Can I inverse this behaviour? I want to use mouse inside tmux (for example to select panes or resize them) only with shift pressed. How to integrate $\int_0^{\infty} \frac{e^{ax} - e^{bx}}{(1 + e^{ax})(1+ e^{bx})}dx$ where $a,b > 0$. This  $$\ \int_0^{\infty} \frac{e^{ax} - e^{bx}}{(1 + e^{ax})(1+ e^{bx})}dx \text{ where } a,b &gt; 0. $$ is a problem that showed up on a GRE practice test. I believe you're supposed to use complex contour integration, but I'm not sure which contour to use. I think it's the keyhole contour, but I wasn't able to get anything useful. Multiple monitors, multiple workspaces? I connected my laptop to my LCD. Using the laptop display hotkey I can switch between different modes - only laptop monitor on, only LCD monitor on, both on and display the same view, both on and the desktop is stretched (divided).  But, I'm looking for something else - I would like to have two workspaces, one visible on the laptop monitor and the other on the LCD.  Is that possible? How do I redirect in a class sub-classing the EventSubscriber class? Understanding complete separation for logistic regression Why does logistic regression not converge for a linearly separable data set?   For linear separable data sets the model parameters go to infinity when mimizing the error function (according to Bishop2006, Pattern recognition and machine learning, section 4.3.2). I don't understand why. It must be connected to setting the score function, i.e. the derivative of the error function, to zero.  The error function is given by $E(\mathbf{w})$ as shown in the figure below. Where $\mathbf{t}$ is the target variable vector of the training set and $\mathbf{w}$ the parameter / coefficient vector. The posterior probabiltiy for class 1 is given by  $$y(n) = p(C_1|\mathbf{x}_n) = \sigma(\mathbf{w}'\mathbf{x}_n).$$ Where sigma is the logistic sigmoid function and $\mathbf{x}_n$ is the feature vector for instance $n$ including the predictors.     My second question to logistic regression is if the to posterior probabilities $p(C_1|\mathbf{x}_n)$ and $p(C_2|\mathbf{x}_n)$ sum to one? Good methods for density plots of non-negative variables in R? plot(density(rexp(100))   Obviously all density to the left of zero represents bias.  I'm looking to summarize some data for non-statisticians, and I want to avoid questions about why non-negative data has density to the left of zero.  The plots are for randomization checking; I want to show the distributions of variables by treatment and control groups. The distributions are often exponential-ish.  Histograms are tricky for various reasons.    A quick google search gives me work by statisticians on non-negative kernels, e.g.:  .    But has any of it been implemented in R?  Of implemented methods, are any of them "best" in some way for descriptive statistics?  EDIT:  even if the from command can solve my current problem, it'd be nice to know whether anyone has implemented kernels based on literature on non-negative density estimation I'm currently working on some logging code that supposed to - among other things - print information about the calling function. This should be relatively easy, standard C++ has a type_info class. This contains the name of the typeid'd class/function/etc. but it's mangled. It's not very useful. I.e. typeid(std::vector&lt;int&gt;).name() returns St6vectorIiSaIiEE.  Is there a way to produce something useful from this? Like std::vector&lt;int&gt; for the above example. If it only works for non-template classes, that's fine too.  The solution should work for gcc, but it would be better if I could port it. It's for logging so it's not so important that it can't be turned off, but it should be helpful for debugging. What's the best way to animate an illustration for the web? I have a couple of illustrations done in Illustrator and I am planing to animate it for a website that I am working on, I've heard of  toolkit with flash, but is it the best way to go or is there another "better" way of doing it?  Here's an example of the kind of animations I am aiming for: My created page with link  The 404 page after following my new url. How do I change JPanel inside a JFrame on the fly? To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action.  So, what's the correct way of doing such a thing? I've tried  panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();   but this won't work. What would you suggest? I cannot submit my answer to    I am aware that my reputation is low. Also, spam posting is discouraged.  My answer includes a compilation of Android graphing libraries, with links, so fellow hackers do not have to Google each and every one of them.  I believe this answer is superior to the current answers, because it is updated to 03/2012 and covers more than 90% of all Android charting libraries.  How can I post the answer, or how can I increase my reputation without being able to post quality answers? The old school websites included just a bunch of links to other places, I am an old man!  Alternative solution would be to blog it, and just post a link to my blog, which is not optimal. I know that $\operatorname{Spec} \mathbb{C}[x]$ can be identified with the set $\mathbb{C}\cup *$, where $*$ is a generic point via the correspondence  $$ \prod_{i}(x-a_i) \leftrightarrow \{a_i\}_i , \ \ \ \ (0)\leftrightarrow *. $$ This correspondence holds for any $\operatorname{Spec} k[x]$ with algebraic closed field $k$.   When $k$ is not algebraic closed, how should one understand $\operatorname{Spec} k[x]$? I have an Object[] array, and I am trying to find the ones that are primitives. I've tried to use Class.isPrimitive(), but it seems I'm doing something wrong:  int i = 3; Object o = i;  System.out.println(o.getClass().getName() + ", " +                    o.getClass().isPrimitive());   prints java.lang.Integer, false.  Is there a right way or some alternative?