I have not seen the following notation before (the 1 with a subscript in the density):     Consider the problem of sampling from the truncated normal   distribution $\mathcal{N}_t (\mu, 1, a)$, given by the random variable $X ∼ \mathcal{N} (\mu, 1)$ conditional on the event $\{X \geq a\}$. Its density is proportional to      $$f(x) \propto \mathrm{exp}\{-\frac{(x-\mu)^2}{2 \sigma^2}\}1_{x \geq a}$$   What exactly does that mean?

Here is  an excerpt from "All of Statistics" by Larry Wasserman (page 23):     Given an event A, define the indicator function of A by      $$ I_{A}(\omega)= \color{Red}{I(\omega \in A)} =\begin{cases}  1 &  \text{ if } \omega \in A \\   0 & \text{ if } \omega \notin A   \end{cases} $$   I am not convinced, referring to term colored red, with the notation here. Since this is a widely referred text, I would like to know that whether this is a typo or I am missing something here.


#include <stdio.h>  int main() {   int i=2;    if(i==3,4)   {        printf("If block");   }   else   {       printf("Else block");   }    return 0; }  Why is this code returning "If block" ?``


This is my code. import java.util.Scanner; public class passwordProgram {     public static void main(String[] args) {     Scanner scan = new Scanner(System.in);          String correctPassword = "WooHoo";     int tries = 0;     boolean keepGoing = true;          while(keepGoing = true) {                           tries = tries + 1;         System.out.println("try #" + tries);                  String password;                  System.out.println("Please enter the password: ");                  password = scan.next();                  if(password == correctPassword) {             System.out.println("This is the correct result:" + password);             keepGoing = false;                          if(tries >= 3) {                 System.out.println("Too many wrong tries. Exiting program");                 keepGoing = false;                 break;             }                 }      } } }  The while loop doesn't end when the right password is entered, and it keeps repeating after the allowed number of attempts has been reached and I want to know why. Is it because of the condition statement in the while loop or is there something else wrong with the code?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Let $(M,d)$ be a metric space. Show that $M$ is compact if and only if all infinite open cover of $M$ have a proper subcover.     We remember: If $\mathcal{U}$ is a cover of $M$, then a proper subcover is a proper subset $\widehat{\mathcal{U}}$ of $\mathcal{U}$ such that it is cover of $M$.   Remark: The diection $(\Rightarrow)$ is trivial. The problem is the direction $(\Leftarrow)$, I think hypotheses are missing, but I have not been able to find a counterexample or prove it.  This exercise I found in a book that for me is not very reliable since I have found other exercises with errors.

Let $(X, d)$ be a metric space. I have to prove the following statements are equivalent.   $(X,d)$ is complete (i.e., every Cauchy sequence is convergent) and totally bounded (i.e., for every $\epsilon>0$, $(X,d)$ has a finite $\epsilon$-net). $(X,d)$ is sequentially compact (i.e., every sequence has a convergent subsequence) . $(X,d)$ is Bolzano - Weierstrass compact (i.e., every infinite subset of $X$ has a limit point). $(X,d)$ is compact (i.e., every open cover of $X$ has a finite subcover). Every infinite open cover of $(X,d)$ has a proper subcover.   I have proved the following: 1$\Longleftrightarrow$2, 2$\Longleftrightarrow$3, 4$\implies$3, 2$\implies$4, 4$\implies$5 and 5$\implies$3. Although they are enough to prove the equivalence of all five statements, I tried to prove it from the other possible directions. But I'm stuck with the proof of 3$\implies$4 and 5$\implies$4. Does anybody know how to prove them without using any of the above statements? Please help.


I would like to use (pure) regex to match strings that do not contain the word word. However, I would not like to use lookaround, balancing groups, or that kind of stuff. If it is impossible, then can we match strings that do not start with word instead?  Examples  word should not match. wor should match. wore should match.

I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regular expression?   Input:  hoho hihi haha hede   Code:  grep "<Regex for 'doesn't contain hede'>" input   Desired output:  hoho hihi haha


Is that a good idea to save image data inside database?  I'm currently converting user's uploaded photos to DataURI using base64_encode. And save the result to MySql table with datatype "Longtext".   When I display, I select the value and put inside HTML IMG source like this <img src="<?php echo $photoColumnName; ?>" />.  It works fine when I tested on local machine but when it goes online, the page loads very slow.  Is it better to save the image inside folder?  Thanks.

So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.  What do you think are the pros/cons?


I am learning Selenium in Java. I want to compare 2 strings in do while loop, I want loop to keep running unless my 2 strings value has been equal, when value is equal then loop should stop.  Now I show you my code & tell you what I want to do with this code.  it will open https://www.facebook.com , on Facebook homepage, class name of "First Name" field is "inputtext _58mg _5dba _2ph-". So I created a string variable cname1 that will store class value of current focused element in loop, and cname2 variable has value "inputtext _58mg _5dba _2ph-" , then I compare these 2 in do while loop, and loop should stop when cname1 & cname2 are equal.  But it is not working, it stops in password field of Facebook instead of running until First Name field. Thanks  public class HelloWorldTest { private static String cname1; private static String cname2;  public static void main(String[] args) {  WebDriver driver = new FirefoxDriver(); driver.get("https://www.facebook.com/");  driver.findElement(By.id("email")).click();   do {      driver.switchTo().activeElement().sendKeys(Keys.TAB);      WebElement element = driver.switchTo().activeElement();      String cname1 = element.getAttribute("class");      String cname2 = "inputtext _58mg _5dba _2ph-";      System.out.println(cname1);      System.out.println(cname2);     }     while ( cname1 != cname2 ); }  private void sendKeys(Keys enter) {}  }


I want to determine the convergence of $$\begin{cases}x_0=1 &  \\ x_n=\sin(x_{n-1})  \end{cases}$$ I can see that $x_n=\sin(x_{n-1}) \geq -1$. Which means the sequence is bounded. However, it isn't strictly decreasing in $[-1,1]$, so I can't prove that it is convergent. Is there a way to get a better bound and show that it goes to $0$?

Consider the sequence defined as  $x_1 = 1$  $x_{n+1} = \sin x_n$  I think I was able to show that the sequence $\sqrt{n} x_{n}$ converges to $\sqrt{3}$ by a tedious elementary method which I wasn't too happy about.  (I think I did this by showing that $\sqrt{\frac{3}{n+1}} < x_{n} < \sqrt{\frac{3}{n}}$, don't remember exactly)  This looks like it should be a standard problem.   Does anyone know a simple (and preferably elementary) proof for the fact that the sequence $\sqrt{n}x_{n}$ converges to $\sqrt{3}$?


For $n \ge 1$, let  $$\frac{1}{1 \cdot 5} + \frac{1}{5 \cdot 9} + \cdots + \frac{1}{(4n - 3)(4n + 1)}$$  Guess a simple explicit formula for $a_n$ and prove it by induction.  How do I actually guess a explicit formula for $a_n$? I'm confused, can anyone show me how to solve?

For $n \ge 1$, let   $$a_n = \dfrac1{1 \cdot 5} + \dfrac1{5 \cdot 9} + \cdots + \dfrac1{(4n-3)(4n+1)}.$$   Guess a simple explicit formula for $a_n$ and prove it by induction.   So I have guessed the formula as : $$\frac{n}{4n+1}$$   But wasn't sure how to prove it by induction


Prove that for any integers $m$ and $n$ we have to: $mn=(m,\,n)[m,\,n]$ ($(m,\,n)$  being the gcd & $[m,\,n]$ the lcm). How can i prove it?

I was reading a text book and came across the following:  Important Results (This comes immediately after LCM:) If 2 [integers] $a$ and $b$ are given, and their $LCM$ and $HCF$ are $L$ and $H$ respectively, then $L \times H = a \times b$  Can some please help me understand why the above result is true? Thanks in advance.


The father of my child is in California, I'm sending him money to buy the ticket to come out to TN. He does not have his ID but has a birth certificate.   Will they ask for his ID if he buys the bus ticket? Or when he gets on the bus?

A good friend's daughter is in a bad way.   Not to get into too many irrelevant details, but... She was sent to Arizona to dry out, ended up getting ripped off and is currently living in a shelter. She has no money, and no photo ID.   I'm trying to get her back to Colorado as soon as possible; she's in danger staying where she is, and sending her money will likely increase that danger.   Greyhound sells "will call" tickets on their website. However, they appear to require the traveler to have a photo ID in order to pick them up. Given Greyhound doesn't normally ask for ID, I'm hoping there is a way around this requirement.  Ideas?


Say I am rolling a 20-sided die. What is the expected number of rolls to have rolled each number?  I haven't taken statistics in a while so my syntax might be off but this question has been bugging me for a while. Any help or direction is much appreciated.

I've just played a game with my kids that basically boils down to: whoever rolls every number at least once on a 6-sided die wins.  I won, eventually, and the others finished 1-2 turns later. Now I'm wondering: what is the expectation of the length of the game?  I know that the expectation of the number of rolls till you hit a specific number is  $\sum_{n=1}^\infty n\frac{1}{6}(\frac{5}{6})^{n-1}=6$.  However, I have two questions:   How many times to you have to roll a six-sided die until you get every number at least once?  Among four independent trials (i.e. with four players), what is the expectation of the maximum number of rolls needed? [note: it's maximum, not minimum, because at their age, it's more about finishing than about getting there first for my kids]   I can simulate the result, but I wonder how I would go about calculating it analytically.    Here's a Monte Carlo simulation in Matlab  mx=zeros(1000000,1); for i=1:1000000,    %# assume it's never going to take us >100 rolls    r=randi(6,100,1);    %# since R2013a, unique returns the first occurrence    %# for earlier versions, take the minimum of x    %# and subtract it from the total array length    [~,x]=unique(r);     mx(i,1)=max(x); end  %# make sure we haven't violated an assumption assert(numel(x)==6)  %# find the expected value for the coupon collector problem expectationForOneRun = mean(mx)  %# find the expected number of rolls as a maximum of four independent players maxExpectationForFourRuns = mean( max( reshape( mx, 4, []), [], 1) )  expectationForOneRun =    14.7014 (SEM 0.006)  maxExpectationForFourRuns =    21.4815 (SEM 0.01)


I have an xps model in blender with textures and then when I import to mixamo it is grey. I tried to zip the fbx with the textures but that didnt work it either stayed grey or said couldnt map existing skeleton. I tried saving the grey mixamo animation hoping it would add it back in blender but that didnt work. help?

I used node textures in a mesh I exported to .FBX.  I then imported it into Unreal Engine 4 and it didn't import any textures; I clicked the Upload Textures option in Unreal Engine.  Is there something I'm doing wrong or is it Blender?


here is a graph to demonstrate how signal sampling work:  \documentclass[french]{article}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \usepackage{babel}   \usepackage{pgfplots} \usepackage{tikz} % State diagram  \usepgfplotslibrary{fillbetween} % For pgfplot integral \pgfplotsset{compat=1.12} % For pgfplot integral \usetikzlibrary{babel} % For pgfplot integral  \pgfplotsset{ standard/.style={     axis x line=middle,     axis y line=middle,     enlarge x limits=0.15,     enlarge y limits=0.15,     every axis x label/.style={at={(current axis.right of origin)},anchor=north west},     every axis y label/.style={at={(current axis.above origin)},anchor=north east},     every axis plot post/.style={mark options={fill=white}}     } }  \begin{document} \begin{tikzpicture}         \begin{axis}[             standard,             domain = 0:15,             samples = 16,             xlabel={$n$},             xmin=0,             ylabel={$x[n]$}]             \addplot+[ycomb,black,thick] {sin(2*180*x/13)};             \addplot[name path=f, domain=0:15, samples=100, color=blue] {sin(deg(0.485*x))};             \addplot[draw=none, name path = xaxis, domain=0:15] {0};             \addplot[orange!50] fill between [of=f and xaxis];         \end{axis} \end{tikzpicture} \end{document}   However, i would like to have the number 8, 10 and 12 above the y line, and all other number below. How can i do that ?

given the following code, I want to modify the tick labels in such a way, that for negative values of x, the labels are located above the x-axis. How can I realize this?  \documentclass{report} \usepackage{pgf} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfplotsset{plot coordinates/math parser=false} \begin{document} \begin{tikzpicture} \begin{axis}[% axis x line=middle, axis y line=middle, width=10cm, height=10cm, scale only axis, xmin=-5, xmax=5, xtick={-4, -2, 0,  2,  4}, xticklabels={$-4\pi$, $-2\pi$, $0$, $2\pi$, $4\pi$}, extra x ticks={-4, -2}, ymin=-1.4, ymax=1.4, ytick={-1,  0,  1}] \end{axis} \end{tikzpicture}% \end{document}


It is well known that if $X \sim B(m, p)$ and $Y \sim B(n, p)$ are independent then $X+Y \sim B(m+n, p)$ but what is the distribution of $X-Y$?  Here is what I have tried. $\Pr[X-Y = c] = \sum_{i=0}^n \Pr[X = c+i] \Pr[Y = i]$ which can be simplified to $\left(\frac{p}{1-p}\right)^c (1-p)^{m+n} \sum_{i=0}^n \binom{m}{c+i} \binom{n}{i} \left(\frac{p}{1-p}\right)^{2i}$. Letting $q = \left(\frac{p}{1-p}\right)^2$, simplifying this expression reduces to simplifying $\sum_{i=0}^n \binom{m}{c+i} \binom{n}{i} q^i$. But I am stuck here and perhaps there is a better approach.

Let $X$ ~ $Bin(n,p)$ and $Y$ ~ $Bin(m,p)$ be two independent random variables. Find the distribution of $Z=X-Y$.   see also   I figured this out:  $$ P(Z=z)=\cases{\sum_{i=o}^{min(m,n)} Bin(k+i,n,p)*Bin(i,m,p), &if $z\ge0$;\cr \sum_{i=0}^{min(m,n)} Bin(i,n,p) * Bin(i-z, m, p),&otherwise. \cr}$$  I also validated it by Monte Carlo simulation. For $n=30$, $m=20$ and $p=0.5$, I get the following distribution, where the circles are the analytical probabilities and the line connects the MC estimates.    Because that looked to me pretty much like a binomial distribution, I gave it a try and figured out that its actually a binomial, just shifted by m to the left. This can be simply written as $P(Y=y) = Bin(y+m, m+n, p)$. Hence, given equal success probabilities, the sum of two independent binomially distributed random variables is binomial, but also their difference, just shifted to the left.  This question here  is actually the same as mine, but received no answer and only the comment that there would be no simple formula. But the above formula looks pretty simple to me.   Is it correct that for the case of equal success probabilities, the above equations actually describes the distribution of $Z=X-Y$? I read in a book that $Z$ could not be binomial distributed because it had negative support. Is it right to call it a shifted binomial?


Suppose $f$ is analytic on $\mathbb{D}_r$, where $\mathbb{D}_r$ is a disk with radius $r$. Also $\operatorname{Im}f(z)\geq 0$ for $\operatorname{Im} z\geq 0$, and $\operatorname{Im}f(z)\leq 0$ for $\operatorname{Im}z\leq 0$  Then f'(x)>0 for $x\in (-r, r)$. ---> I proved $f'(x)\geq 0$ for $x\in (-r, r)$, so it remains to show $f'(x)\neq 0$. Edit: here we assume $f$ is non-constant.  Now suppose $g:\mathbb{D}_r\setminus\{0\}\rightarrow\mathbb{C}$ is analytic. Also Also $\operatorname{Im}g(z)\geq 0$ for $\operatorname{Im} z\geq 0$, and $\operatorname{Im}g(z)\leq 0$ for $\operatorname{Im}z\leq 0$.  Then $g$ is meromorphic at $0$.---> Thus we need to show $0$ has a neighborhood such that either $g$ or $1/g$ is holomorphic in it. From part $1$ we know that $g'(x)>0$ for $(-r, 0)\cup (0,r)$. But the domain of $g$ is $\mathbb{D}_r\setminus\{0\}$, can we somehow extend it to $(-r, r)$? If $g$ has a pole at $0$, then the pole is simple (order $1$), and $\operatorname{Res}(g,0)<0$. ---> For this I don't have much idea.

I'm trying to do this old qualifying exam problem from UW Madison. Let $D^\ast=\{z\in\mathbb{C},0<|z|<1\}$ and $f$ be a non constant holomorphic function on $D^\ast$. Assume that $\text{Im} f(z)\geq 0$ if $\text{Im} z\geq 0$ and $\text{Im} f(z)\leq 0$ if $\text{Im} z\leq 0$. Prove that if $z\in D^\ast$ is not real, then $f(z)$ is not real. Show that if $z\in (-1,0)\cup(0,1)$, then $f'(z)\not=0$. Prove that $0$ is either a removable singularity with $f'(0)\not=0$ or $0$ is a simple pole of $f$. What I have thought of so far: If $z\in D^\ast$ and $\text{Im} z>0$, but $\text{Im} f(z)=0$, then apply the maximum modulus principle on $\{z|z\in D^\ast,\text{Im} z>0\}$ to $e^{if}$ to obtain a contradiction. This shows that if $z\in D^\ast$ and $\text{Im} z>0$, then $\text{Im} f(z)>0$. Similarly if $z\in D^\ast$ and $\text{Im} z<0$. Furthermore, the reflection principle shows that $f(\overline{z})=\overline{f(z)}$. If $z\in(-1,0)\cup(1,0)$, to show that $f'(z)\not=0$, we use the following fact: fact: If $f$ is a complex valued function continuous on $\overline{D(0,R)}$ and holomorphic on $D(0,R)$, then for any $z\in D(0,R)$, we have $$f(z)=\int_0^{2\pi}i \text{Im} f(\xi)\frac{\xi+z}{\xi-z}\frac{d\theta}{2\pi}+K$$ for some constant $K$, where $\xi=Re^{i\theta}$. We can differentiate the expression to get an expression of $f'(z)$ in terms of $\text{Im} f$. This same fact shows that $f'(0)\not=0$ if $0$ is a removable singularity. If $0$ is a pole, $\text{Im} z$ is dominated by the imaginary part of $\frac{C}{z^n}$ for some $n\in\mathbb{Z}^+$ and $C\in\mathbb{R}$ when $|z|>0$ is small, then unless $n\not=1$, we can find some $z\in D^\ast$, $\text{Im} z>0$ such that $\text{Im} f(z)<0$. So if $0$ is a pole, then it is a simple pole. My question is: how to show that $0$ is not an essential singularity? Thanks!!


Let $x_1,\ldots,x_r,y_1,\ldots,y_p,z_0,\ldots,z_r,t_0,\ldots,t_p$ be complex numbers.   Let $A$ be the ring generated by these numbers.      Prove the following holds in $\mathbb C(A)$.      $$\begin{multline*}\sum_{i=1}^r \left(\prod_{j=0}^r(z_j-x_i)\prod_{1\leq j\leq r; j\neq i}\left({x_j-x_i}\right)^{-1}\prod_{j=1}^r(y_j-x_i)\prod_{j=0}^p\left({t_j-x_i} \right)^{-1}\right)\\-\sum_{i=0}^p \left(\prod_{j=0}^r(t_i-z_j)\prod_{j=1}^r {(t_i-x_j)}^{-1}\prod_{j=1}^p(t_i-y_j)\prod_{0\leq j \leq p; j\neq i}\left({t_i-t_j}\right)^{-1}\right) \\=-\left(\sum_{i=1}^rx_i-\sum_{i=0}^rz_i \right)+\left(\sum_{i=1}^py_i-\sum_{i=0}^pt_i \right)\end{multline*}$$   This was asked at an oral examination. I post it out of curiosity (no idea how it should be approached).  EDIT It is a duplicate of

We take place on $\mathbb C(x_1,...,x_r,x'_1,...,x'_p,u_0,...,u_r,u'_0,...,u'_p)$ with $r,p\in \mathbb N$     Show that :   $$\displaystyle{\sum_{i=1}^r \left(   \frac{\prod_{j=0}^r (u_j-x_i) \prod_{j=1}^p (x'_j-x_i) }{  \prod_{1\leq j\leq r, j\neq i     }(x_j-x_i) \prod_{j=0}^p (u'_j-x_i)}      \right)}-\displaystyle{\sum_{i=0}^p \left(   \frac{\prod_{j=0}^r (u'_i-u_j) \prod_{j=1}^p (u'_i-x'_j) }{  \prod_{0\leq j\leq p, j\neq i     }(u'_i-u'_j) \prod_{j=1}^r (u'_i-x_j)}      \right)}=\displaystyle{\sum_{i=1}^p x'_i +\sum_{i=0}^r u_i -\sum_{i=1}^r x_i-\sum_{i=0}^p u'_i}$$   I have seen this exercise in an old book at the library. Unfortunately there was no indication how can I solve the problem.   Anyway if someone can give me some ideas it will be greatful.   NB: Sorry for the title, I have not had other ideas


There are a bunch of questions here related to labeling in QGIS, but it's not clear which version they are referring to, and I know this is something that has changed recently. Hopefully it makes sense to start a new question due to the new labeling functionality.  I'm trying to label a road network so that every street is labelled. I have the 'auto' labeling doing a decent job, but it is not placing a label on every street. How can I (with the minimum of effort) keep the existing auto-placed labels (possibly with a few tweaks/manual moves,) but then also go in and manual 'force' missing labels to appear, and position them myself and/or change font size to make them fit?    The new label tools in the toolbar are not very easy to figure out, and the 'pinning' concept is lost on me. Can anyone explain the steps?

Is there a way to manually place labels in QGIS?   I have a map which has almost-duplicate labels in some places (e.g. E 1st St and 1st St) and I'd like to remove some of them.   Also, I'd like to move some of the labels around and maybe label some features that aren't currently.   I'm using new labeling, with the labels curved along the features.


I tried to install Ubuntu 13.04 beside Windows 7. At the point where it gave me the option to increase or decrease partition space, I couldn't figure out which side was the Windows partition and which was the Ubuntu partition. Can you help? Left or right is Windows?    I have 350 GB of disk space and only want to allocate 40 GB to Ubuntu.  However, I don't want to make a mistake and allocate the 40Gb to Windows instead.

I'm installing Ubuntu (or Xubuntu/Lubuntu/Kubuntu) alongside Windows 7/XP. I got to the screen that says, "Allocate drive space by dragging the slider below." On the following screen, I'm not sure whether the right side or the left side is for Ubuntu or for Windows. Which side is which?  Screenshot for Ubuntu: (see  for Lubuntu)


Many times in mathematics one has an assumption (call it Assumption A) that has an interesting variant (call it Assumption A').  I often see in textbooks Assumption A will be written with an equation number like (I) while Assumption A' will get the number (I') to emphasize that it is a variant of (I).  Is there a way to do this in Latex without blowing up the automatic equation numbering?

How to number equations manually? I'm making a presentation on a chapter, so would like my equations to be numbered as in the book, and not necessarily from the first equation in the chapter, for example, if the first equation in my document is numbered (5.23).  Thank you.


Whenever I print a list of values in negative indexing in the console it shows only empty brackets. Whatever is the reason behind this problem  stu_information = ["name","roll_number","address","contact_information"] print(stu_information[-1:-2])  Output: []

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I'm working on a mathematical proof, but the problem I'm having is more to do with logic than math per se.   I'm wondering if these two are equivalent:   If A and B then C   If A and not B, then not C.

For example:     Is (A ∨ B ∨ C) ∧ (D ∨ E ∨ F) the same as   (A ∧ D) ∨ (A ∧ E) ∨ (A ∧ F) ∨ (B ∧ D) ∨ (B ∧ E) ∨ ( B ∧ F) ∨ (C ∧ D) ∨ (C ∧ E) ∨ (C ∧ F)?   How would I check equivalence in general?


What can I use as an alternative to provolone and cacciacavallo cheese in the UK? Both have been difficult for me to find here.

Having recently bought the Frankies Spuntino Cookbook I want to have a go at making braciola. The recipe calls for pork steaks to be stuffed with pecorino romano and provolone.   However, in the UK provolone is hard to come by outside of Italian delis, and Italian delis are relatively rare. I understand that it's similar to mozzarella but drier.   So, what is a good substitute for provolone? Is it usually used for flavour or for its melting texture?


Is there a better way to determine the underlying type of an object even when the current value of the object is null?  The following code doesn't work when someObject is indeed of type string but currently holding a null value.  public void doWork(object someObject) {     var objAsString = someObject as string;     if (objAsString != null)     {             // do work, return             // work involves string specific logging/manupulation     }      var objAsByteArr = someObject as byte[];     if (objAsByteArr != null)     {             // do work, return              // work involves byte specific logging/manupulation     }      throw new Exception("Unknown type encountered"); }

I have a method with an out parameter that tries to do a type conversion. Basically:  public void GetParameterValue(out object destination) {     object paramVal = "I want to return this. could be any type, not just string.";      destination = null; // default out param to null     destination = Convert.ChangeType(paramVal, destination.GetType()); }   The problem is that usually someone would call this like:  string output; GetParameterValue(output);   This will fail because of:  destination.GetType()   destination is null, so we can't call .GetType() on it. We also can not call:  typeof(destination)   because destination is a variable name not a type name.  So is there any way to get the type of an object that is set to null? I would think there would have to be a way to know what type a storage location is without it being assigned anything.    Just to give a bit more info, I am trying to make a utility method that will grab the output parameters of an Oracle stored procedure. The issue is that DbParameter.Value is of type object.  What would be ideal would be for the developers to do something like:  string val = GetParameterValue("parameterName");   The notable thing is that there is no casting of types. In practice, you don't know the lparam of the "equals", so I went with:  string val; GetParameterValue("parameterName", out val);   And figured within the method, I would know the destination type of the output variable. I guess that was a bad assumption. As an alternative, I also wrote the method:  public T GetParameterValue<T>(string paramName)   So the developers can do:  string val = GetParameterValue<string>("parameterName");   I find the explicit "string" declaration to be repetitive, especially since in practice, the destination if probably an object property and the oracle data type could change (think ORM):  MyObj.SomeProp = GetParameterValue<MyObj.SomeProp.GetType()>("parameterName");   But again, if MyObj.SomeProp is null, that .GetType() call fails. The VM has to know the type of MyObj.SomeProp, even when its null, right? or else how would it catch cast exceptions?    To partially solve my own problem, I can do:  MyObj.SomeProp = GetParameterValue<typeof(MyObj).GetField("SomeProp").GetType()>("parameterName");   The whole idea was to not have to explicitly use the Type in more than one place, so that if the data type changes, it only has to be changed in the destination object (MyObj.SomeProp) and in the DB. There has to be a better way...


I asked a question on Computer Science Educators Beta without registering and need to register it now. How can I do that?

I accidentally posted a question without being logged in. Is there a way to associate that question with my account?   For more information, visit "" in the .   a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms)


$$\tt{tan x =tan(x+10^0)tan(x+20^0)tan(x+30^0)}$$ This equation asked from a genius student of my class . I think and solve it  like below . My idea based on $cot(x+30) tan(x)=tan(x+10)tan(x+20)\\15=\dfrac{0+30}{2}=\dfrac{10+20}{2}\\so $   $u=x+15^0$ and substitute $u$ in equation . Then my genius student asked for a other Idea to work with this .I show my work , but I can't go on ...  please  help me to find an Idea . thanks in advanced .

How to solve the following equation? $$\tan x=  \tan(x+10^\circ)\tan(x+20^\circ)\tan(x+30^\circ)$$


I've just installed the Arc theme on my Ubuntu 19.04 machine. The theme looks awesome except one small issue with the top bar.  My top bar is completely transparent and the dock is completely opaque. Is this the way Arc theme is supposed to be displayed?    Thank you so much for your help

In my Ubuntu 18.04 Top Panel becomes fully transparent when any window is not maximized.  When the window is Maximized    When the window is not Maximized   How can I resolve this issue?


I currently use a TCL A1 (A501DL) running Android Version 8.1.0. I went to check my Wi-Fi data usage. I scrolled down and seen all these apps! There are 9 of them. I've never seen them before and when I click them there is no app information. I checked all 44 apps I have, and it doesn't show any of these and it doesn't appear to be feeding off my battery data I already checked that. What's going on? Am I being hacked?? I don't use the cell data on this phone. I just use it for Wi-Fi. Somebody please help me! I'm kind of worried about my privacy now.

A mysterious app named "10102" shows up in my data usage. It bears only the standard Android app icon (the Bugdroid logo with a cube on its torso). From what the graph tells me, it has used 36 megabytes of data in the background and zero on the foreground. I think I haven't uninstalled anything for months. Is it malware? I haven't sideloaded anything and only authorized my laptop as a USB debugger. If it's malware, how do I remove it? I have no idea how to find its package name and 10102 isn't in the list of downloaded apps in settings. I'm running stock & never-been-rooted Android 4.4.4 on Nexus 4.


Today, I receive a notification from DHL that a company named Brand Addition Gmbh Hagen, that they have sent me a package. I have neither heard of the company, nor ordered anything from them. I also dont expect any package at the moment. This company knows my full name (which i dont use for online shopping) and my address. Can anyone please tell me if this has ever happened to you and if this is a scam? I´m thinking about not receiving the package and it will be automatically returned to the company after 7 days.

My wife received a small package, containing a pair of Ray Ban sunglasses (whether original or fake I don't know) in a nice leather-looking case. It is addressed to her, correct name, street, postcode, and her mobile phone number printed on it. Declared with a value of $15 printed on it, and coming from a company in China. Everything fine, except she never ordered any sunglasses, and she never paid for any sunglasses. I know there are scams where scammers send rubbish items to random people, and that entitles them to post fake reviews on Amazon, for example. The only thing is, this isn't a rubbish item. Even if these sunglasses are fake, they would be worth some money. Does anyone have an idea how either (a) a company in China could send goods to a random real person by mistake, or (b) what kind of scam would make it worth while to send an item that would probably cost £10 to £20 on Amazon?


I want to ask a question about finding the position of an element within an array in Python's numpy package.   I am using Jupyter Notebook for Python 3 and have the following code illustrated below:  concentration_list = array([172.95, 173.97, 208.95])   and I want to write a block of code that would be able to return the position of an element within the array.   For this purpose, I wanted to use 172.95 to demonstrate.   Initially, I attempted to use .index(), passing in 172.95 inside the parentheses but this did not work as numpy does not recognise the .index() method -  concentration_position = concentration_list.index(172.95)  AttributeError: 'numpy.ndarray' object has no attribute 'index'   The Sci.py documentation did not mention anything about such a method being available when I accessed the site.   Is there any function available (that I may not have discovered) to solve the problem?

I know there is a method for a Python list to return the first index of something:  >>> l = [1, 2, 3] >>> l.index(2) 1   Is there something like that for NumPy arrays?


Let $V$ be a finite-dimensional vector space over field $k$ and $R = \text{End}_k V$. How do I see that any left ideal of $R$ takes on the form $Rr$ for some suitable element $r \in R$?   Since $R$ is a semisimple ring, every left ideal with split like this: $R = L \oplus L'$. In this decomposition, $1 = e + e'$ where $e \in L$ and $e' \in L'$.  Why does $e^2 = e$ and $(e')^2 = e'$?  And why does $L = Re$?

As the question title suggests, how do I see that every left ideal of a square matrix ring over a field is principal?


A ring is rotating on a frictionless plane. From where does it get its centripetal force to keep on rotating?

Suppose a ring is rotating in space with an angular velocity $\omega .$ Then each element of the ring is having an acceleration of $m\omega^2 r$ ($r$ is the radius of the ring) but what force is causing this acceleration in each element? The acceleration is inward so the force should also be inward but there is nothing to provide this force . The neighbouring elements can only provide a tangential force on a particular element, this force will not have any component along the radius so this can not be the reason for the centripetal acceleration. So how are the elements accelerating and moving with a constant angular velocity ?


Why does $\mathbb{E}[X] = \sum^\infty_{r=0}\mathbb{P}(X > r)$?   I understand if it was $\mathbb{E}[X] = \sum^\infty_{r=0}r\cdot\mathbb{P}(X = r)$, but for this I don't understand why.

I've read the proof for why $\int_0^\infty P(X >x)dx=E[X]$ for nonnegative random variables (located ) and understand its mechanics, but I'm having trouble understanding the intuition behind this formula or why it should be the case at all. Does anyone have any insight on this? I bet I'm missing something obvious.


I was visiting a questions & had filters by java but i found that there is a question that was not related to java.  I don't know how this happens?  It is about HTML & css:

Recently, I was surfing on stackoverflow.com & I have found one bug in Question filter.  I was looking under the java tag and yet I saw questions which were not tagged java    The incorrectly shown question was


In a commutative ring $A$ with $1$ having a subset $S$ and some element $x \notin S$,  does there always exist a prime ideal containing $S$ but not $x$? I am trying to solve the $\Rightarrow$ part of (iii). If this is not true always,can you help me figure out a solution? Thanks in advance.  (Edit) I could not understand the solution given in the link.

The following is exercise I.21.(iii) of Atiyah-Macdonald:     Let $\phi \colon A \to B$ be a ring homomorphisms. Let $X = \operatorname{Spec} A$ and $Y = \operatorname{Spec} B$ [and let $\phi^\ast \colon Y \to X$ be the induced mapping, $\phi^\ast (\mathfrak q) = \phi^{-1} (\mathfrak q)$]. Show that   [...]   iii) If $\mathfrak b$ is an ideal of $B$, then $\overline{\phi^\ast (V (\mathfrak b))} = V (\mathfrak b^c)$.   [...]   After trying myself for a while, I looked at solutions posted on the internet, one of which presented the following solution.     It is clear that $\mathfrak p \in \overline{\phi^\ast (V (\mathfrak b))} \color{blue} \Leftrightarrow r (V (\mathfrak b)^c) \subset \mathfrak p$ and $\mathfrak p \in V (\mathfrak b^c) \Leftrightarrow \mathfrak b^c \subset \mathfrak p$. Then it suffices to show that $\mathfrak b^c \subset \mathfrak p$ if and only if $r(V (\mathfrak b)^c) \subset \mathfrak p$, which is true because $r(V (\mathfrak b)^c) = r(V (\mathfrak b))^c \color{blue} = r(\mathfrak b)^c = r(\mathfrak b^c)$.   where I have marked the things I don't understand in blue.  In the meanwhile I have found a different proof for the exercise, but I still don't understand this proof. In particular   I don't understand the connection between taking the closure and taking the radical. I don't know if $r(V (\mathfrak b)^c)$ is a shorthand for the set of elements contained in the contractions of prime ideals contained $\mathfrak b$ or for the ideal generated by these elements or something else. I don't see why the marked equality holds.


When I go into Setting / Wifi and try to turn Wifi on, it does not let me. The switch is grayed out.  How can I solve this issue?

In my iPhone settings where I'm supposed to turn Wi-Fi on or off, it is just grey & says 'No Wi-Fi'.  I have reset network settings, restored phone, re-synced everything, but still have this problem. Does anyone know how to fix this?


I was trying to install Ubuntu.   When I pressed install Ubuntu it goes into black screen

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I making a fitness application in Android Studio and my projcet has Multiple Activities (6). I am trying to get the value of the radiogroup from the ThirdActivity in the SixthActivity. However, when I try to do this, I get the error:   Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.widget.RadioGroup.getCheckedRadioButtonId()' on a null object reference   I have made sure that all the names for the variables in the xml code are correct and am still running into the same problem.     SixthActivity.java     Intent intent=getIntent();   String experience =intent.getStringExtra("Experience");   I would like to be able to get the value from thirdRadioGroup RadioGroup in ThirdActivity while being in the SixthActivity.  new code:   //ThirdActivity.class   thirdRadioGroup = findViewById(R.id.thirdRadioGroup);  int radioIdExperience = thirdRadioGroup.getCheckedRadioButtonId();  experience = (RadioButton) findViewById(radioIdExperience);  Intent intent = new Intent(this, SixthActivity.class);  intent.putExtra("Experience", experience.getText());  startActivity(intent);   Now, again this throw NullPointerException..  error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.widget.RadioButton.getText()' on a null object reference

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I am self-learning Real Analysis. Stephen Abbott's book leaves the proof of the fact that the Cantor set $C$ has no isolated points as an exercise. I'd like someone to verify, if my construction is correct, or point out any fallacies.  [Abbott, 3.4.3] Review the portion of the proof given in Example 3.4.2 to show that the Cantor set is perfect and follow these steps to complete the argument.   (a) Because $\displaystyle x\in C_{1}$, argue that there exists an $\displaystyle x_{1} \in C\cap C_{1}$ with $\displaystyle x_{1} \neq x$ satisfying $\displaystyle | x-x_{1}| \leq 1/3$.   (b) Finish the proof by showing that for each $\displaystyle n\in \mathbf{N}$, there exists $\displaystyle n\in \mathbf{N}$, there exists $\displaystyle x_{n} \in C\cap C_{n}$, different from $\displaystyle x$, satisfying $\displaystyle | x-x_{n}| \leq 1/3^{n}$.  Proof. Let $\displaystyle x\in C$ be an arbitrary element. Since, $\displaystyle C=\bigcap _{n=0}^{\infty } C_{n}$, $\displaystyle x\in C_{1}$. Exactly, one of the below two possibilities must be true. (1) $\displaystyle x\in \left[ 0,\frac{1}{3}\right]$ (2) $\displaystyle x\in \left[\frac{2}{3} ,1\right]$ In either case, we can pick a number $\displaystyle x_{1}$ to be the left or right end-point of one of the two intervals in $\displaystyle C_{1}$ different from $\displaystyle x$. Since the end-points of $\displaystyle C_{n}$ are contained in $\displaystyle C$, we can pick an $\displaystyle x_{1} \in C\cap C_{1}$, such that $\displaystyle x_{1} \neq x$ and $\displaystyle | x_{1} -x| \leq \frac{1}{3}$. Similarly, $\displaystyle x\in C_{2}$. If $\displaystyle x\in \left[ 0,\frac{1}{3}\right]$, then we have a dichotomy. Either $\displaystyle x\in \left[ 0,\frac{1}{9}\right]$ or $\displaystyle x\in \left[\frac{2}{9} ,\frac{3}{9}\right]$. If $\displaystyle x\in \left[\frac{2}{3} ,1\right]$, then either $\displaystyle x\in \left[\frac{6}{9} ,\frac{7}{9}\right]$ or $\displaystyle x\in \left[\frac{8}{9} ,1\right]$. So, we can pick $\displaystyle x_{2}$ to be the left or right end-point of one of the two intervals in $\displaystyle C_{2}$ different from $\displaystyle x$. Since the end-points of $\displaystyle C_{n}$ are contained in $\displaystyle C$, we can pick an $\displaystyle x_{2} \in C\cap C_{2}$, such that $\displaystyle x_{2} \neq x$ and $\displaystyle | x_{2} -x| \leq \frac{1}{9}$. In general, we can pick a number $\displaystyle x_{n}$ to be the left or right end-point of one of two intervals in $\displaystyle C_{n}$, such that $\displaystyle x_{n} \neq x$ and $\displaystyle | x_{n} -x| \leq \frac{1}{3^{n}}$. Now, consider the sequence $\displaystyle ( x_{n}) =( x_{1} ,x_{2} ,\dotsc )$. Given any arbitrary $\displaystyle \epsilon  >0$, pick $\displaystyle n_{0}$ such that \begin{equation*} \frac{1}{3^{n_{0}}} < \epsilon \quad \text{ or } \quad n_{0}  >\left(\log\frac{1}{\epsilon }\right) /(\log 3) \end{equation*} then for $\displaystyle n\geq n_{0}$, we have $\displaystyle | x_{n} -x| < \epsilon $. So, $\displaystyle ( x_{n})\rightarrow x$. Thus, $\displaystyle C$ is a perfect set.

I found in a book a proof that the Cantor Set $\Delta$ is perfect, however I would like to know if "my proof" does the job in the same way.     Theorem: The Cantor Set $\Delta$ is perfect.        Proof:   Let $x \in \Delta$ and fix $\epsilon > 0$. Then, we can take a $n_0 = n$ sufficiently large to have $\epsilon > 1/3^{n_0}$.   Thus, the interval $[a, b]$ where $x$ lies is a subset of $B_\epsilon > (x)$. Hence, by iterating the construction of the Cantor set for $N >  n_0$, we have intervals of length $1/3^N$ all included in $B_\epsilon  (x)$, but with only one of those intervals such that $x$ lies within.   The intution behind the proof was that we should prove that for every $x$, if $x \in \Delta$, then for every $\epsilon >0$, $B_\epsilon (x) \setminus \{x\} \cap \Delta \neq \varnothing$.    Now, I do not particularly like my reference to the $[a, b]$ interval that is not mentioned before. Moreover, here – by choosing a closed interval – I am trying to address all at once the case in which $x$ is an endpoint of one of the closed intervals that form $\Delta$. Finally, I did not close the proof with a statement like "Thus, there are infinitely many points that differ from $x$ and that lie within $B_\epsilon (x)$.    In the end, I am not completely sure if this can be considered a proof or not. The intuition is correct (I am kind of positive about it), but I am not sure if I was actually able to write down my intuition in a good way.    As always any feedback is more than welcome. Thank you!


For each $\alpha\in I$, let $A_\alpha$ be a subset of some nonempty set $S$. So if $I=\emptyset$, then $$ \bigcup_{\alpha\in I} A_\alpha=\emptyset $$ and $$ \bigcap_{\alpha\in I} A_\alpha=S. $$  Why is this true?

If $A_\alpha$ are subsets of a set $S$ then   $\bigcup_{\alpha \in I}A_\alpha$ = "all $x \in S$ so that $x$ is in at least one $A_\alpha$"  $\bigcap_{\alpha \in I} A_\alpha$ = "all $x \in S$ so that $x$ is in all $A_\alpha$"  It is the convention that $\bigcup_{\alpha \in \emptyset}A_\alpha = \emptyset$ and $\bigcap_{\alpha \in \emptyset} A_\alpha = S$.   But if $x$ is in $\bigcap_{\alpha \in \emptyset} A_\alpha = S$ then $x$ is in all $A_\alpha$ with $\alpha \in \emptyset$ and therefore $x$ is certainly in at least one $A_\alpha$ with $\alpha  \in \emptyset$. But then $x \in \bigcup_{\alpha \in I}A_\alpha$.  Can someone help me and tell me what is wrong with this? Thank you.


Let be $T:V\rightarrow V,k=\mathbb{C}$ so that $T^*=T^{2017}$ $\implies$ $T$ is diagonalizable.   Well, the statement is from a T or F and I already know it's true. I am 99% sure it has to do with properties but I'm really confused by this subject. How can I deduce that the statement is true?  $T^*$ denotes the adjoint operator of $T$ (In case that is not the standar notation).

Show that every idempotent matrix is diagonalizable. What can you say if $A$ is tripotent ($A^3=A?$) What if $A^k=A?$  The first two cases is obvious since we can find the minimal polynomial to be $t(t-1)$ or $t(t-1)(t+1)$, which are products of distinct linear factors. However, what can we say about the general case $A^k=A?$ Any solutions, hints, or suggestions would be appreciated.


When I subdivided the pants mesh a few times to 160,000 or so faces and then attempted to return to object mode, my new computer became totally unresponsive, and I was forced to carry out my first ever hard reset of this computer.

Essentially, my problem is that i am trying to render a scene, however, blender crashes on me early during the render. I only have about 14 total objects in the scene. (It's not that complex) I tried to render a different blender file which was bigger than the one that i am having problems with, and the scene renders just fine. There is no difference in the render presets for both of these files. However, i still cannot render the other scene. It gets to preparing scene data, but then it crashes.  Thank you.


I tried the following command, but it seems that the package was not found.  $ sudo apt-get install libc-bin=2.27-3ubuntu1 Reading package lists... Done Building dependency tree        Reading state information... Done E: Version '2.27-3ubuntu1' for 'libc-bin' was not found

I need a newer version of glibc in my ubuntu version (precise, 12.04), but I don't seem to be able to go beyond version 2.15 using apt-get.  I tried to compile it by myself but I almost destroyed my distribution, so I was wondering if someone has gone through this process successfully and would be so kind to guide me.


I'm looking for a diode with a forward voltage (VF) of 0.6 V at 10 mA IF. While searching for it, I came across many diodes' datasheets where they seem to contradict themselves. For example:    As in the table, it says VF is 0.855 V at 10 mA IF at 25 °C, while in Fig 1 it is around 0.75 V. For this one, it is just 100 mV difference, but I've seen other diodes with a higher difference. Which part of the datasheet should I use?

I am reading the  From the table on ELECTRICAL CHARACTERISTICS (page 2) (TA = 25°C unless otherwise noted) (Each Diode)     Forward Voltage mVdc     IF = 1 mAdc 715mV   IF = 10 mAdc 855mV   IF = 50 mAdc 1.0V   IF = 150 mAdc 1.25V     On page 3 there is the following VI curve graph:  Clearly at 25°C - 100mA is Vf = 0.9V. There is huge difference between the table and the IV curve.  Which source of information I should trust? Is this (typical) and (maximum) where the table guarantees the diode won't exceed Vf 1.0v at 50mA while the graph is just typical values?


Evaluate $\sum_{k=0}^{n} {3n \choose 3k}$. It's not hard to evaluate by putting roots of unity.  Therefore, I would like to see some solutions using elementary mathematical stuffs but not roots of unity.  And the answer is $\frac{1}{3}(2^{3n}+2(-1)^n)$

The other day a friend of mine showed me this sum: $\sum_{k=0}^n\binom{3n}{3k}$. To find the explicit formula I plugged it into mathematica and got $\frac{8^n+2(-1)^n}{3}$. I am curious as to how one would arrive at this answer.  My progress so far has been limited. I have mostly been trying to see if I can somehow relate the sum to $$\sum_{k=0}^{3n}\binom{3n}{k}=8^n$$ but I'm not getting very far. I have also tried to write it out in factorial form, but that hasn't helped me much either.  How would I arrive at the explicit formula?


For example, I have a output:  Hello, this is the output.   (let's say that for example hello is colored red, and the is colored green, and output is colored purple).  Now, let's say that this is the output of a command named x.  If I use this command, the output becomes white:  x | grep hello   I've read that one could use grep --color=always. However, this changes the color to highlight the result I searched for instead of keeping the original line colors.  I want to keep the original line colors. How do I use grep while keeping them?

Test environment:  $ mkdir testdir $ cd testdir $ echo | tee "file  name"   Now, ls will print file?name (under Ubuntu GNU bash, at least), while ls | cat will print file and name in separate lines.  What I'd like to achieve is, print file?name with the  piped version, so something like  $ something ls | cat` or `ls | something | cat` or `ls | something cat   In other words, how to fool a command like ls here into thinking, it has a TTY, when it does not, in the shell?  Note: ls is just an example program here, I'm looking for generic solution, not program specific like ls -q | cat would be.


NOTE: I'm aware of this question: .  Mine is not a duplicate as had been previously cited, the answers to that question also deletes the pattern, while in this question the pattern itself must be preserved.     I am trying to delete n lines after a pattern and m lines before a pattern (without deleting pattern). For example, if the file is:  1 2 3 4 5 6 7 8 9   If, Pattern = 5, and n = 2 and m = 3. Then:  1 5 8 9   Could you please suggest how to do this?    Bonus: It would be great if we could set either m or n = 0 in the same code. For example. If we set m=0 and n=1, in the above example, we should get:  1 2 3 4 5 7 8 9

Consider a text file with the following entries:  aaa bbb ccc ddd eee fff ggg hhh iii   Given a pattern (e.g. fff), I would like to grep the file above to get in the output:  all_lines except (pattern_matching_lines  U (B lines_before) U (A lines_after))   For example, if B = 2 and A = 1, the output with pattern = fff should be:  aaa bbb ccc hhh iii   How can I do this with grep or other command line tools?    Note, when I try:  grep -v 'fff'  -A1 -B2 file.txt   I don't get what I want. I instead get:  aaa bbb ccc ddd eee fff -- -- fff ggg hhh iii


Below is the code that I was trying to understand.  public static void main(String[] args) {     try     {         System.out.println(args[0]);     }     catch (ArrayIndexOutOfBoundsException e)     {         System.out.println("ArrayIndexOutOfBoundsException");         throw new NullPointerException();     }     catch (NullPointerException e)     {         System.out.println("NullPointerException");         throw new Exception();     }     catch (Exception e)     {         System.out.println("Exception");     } }   Everything is fine except when I am throwing new Exception();. So when I am doing so an error is occurring saying, "Unhandled exception type Exception" though I have provided the catch statement below to handle it.  So I know the solution to the problem but I want to know the reason. What are the insights that I am missing.   Can anybody explain it.

This may seem like a programming 101 question and I had thought I knew the answer but now find myself needing to double check. In this piece of code below, will the exception thrown in the first catch block then be caught by the general Exception catch block below?  try {   // Do something } catch(IOException e) {   throw new ApplicationException("Problem connecting to server"); } catch(Exception e) {   // Will the ApplicationException be caught here? }   I always thought the answer would be no, but now I have some odd behaviour that could be caused by this. The answer is probably the same for most languages but I'm working in Java.


Is there a straightforward way to make ligatures more copy-and-pastable? I know that by using  \usepackage[t1]{fontenc}   that many glyphs like accented and umlauted characters become copy-and-pastable from a pdf.   But, for example, the word "five" is typeset with an "fi" ligature (a merging of the two letters into one) and I'm unable to copy this word from the pdf and paste into a text editor. The fontenc package doesn't seem to help with this.  Here is my MWE of the issue. I am using Adobe Reader X to read, and Windows with TeXnikCenter.  \documentclass[12pt]{article}  \begin{document} five  \end{document}   I have tested and cannot successfully paste into TeXnicCenter, MS Word, or the Firefox address bar.

One frequent aspect of pdflatex output that could be improved is to what extent one can select text output from the generated pdf-file and copy-and-paste it. This is essentially an issue of having the right output encoding. There are at least two important aspects to this:   In the ideal case, Unicode would be the output encoding. Ligature glyphs (such as ﬁ) are ideally de-ligated in the output (here: "fi").   It seems that output encodings are specified through the fontenc package. What is the range of possible output encodings, and most importantly: Is there a way to specify a Unicode output encoding and one that deals with ligatures in the intended way?  (Note: It is important to distinguish output from input encodings. How to use different input encodings in LaTeX has been documented widely. My understanding is that this is best handled by the inputenx package, as it supersedes the inputenc package.)    Quick guide to the solutions: The information in the answers and answer threads is a bit distributed, so here the short summary: one approach is to use \input glyphtounicode together with \pdfgentounicode=1; the other approach is to use cmap/mmap.  Addendum: Sometimes one will need to load the package accsupp and enclose one's macro definition in \BeginAccSupp{method=hex,unicode,ActualText=<codepoint>}[...]\EndAccSupp{} to generate a specific code point. See the caveat about non-BMP code points  and the fix (starting from accsupp version v0.4, 2012/11/18) , which provides the new unichar package option.


Uncaught ReferenceError: lastn is not defined     at verify (index.js:63)     at HTMLButtonElement.onclick (index.html:12)  I wanted to know why I get an "undefined" error on the console? I am sure the variable has been defined . Take a look at my code.

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


Does there exists a group $G$ and $H$ subgroup of $G$ such that there   exists $g\in G$ with $gHg^{-1} \subseteq H$ but $gHg^{-1} \neq H$   I am unable to find an example and neither I am able to prove otherwise. Please help

Let $G$ be a group, $H\subseteq G$ a subgroup and $a\in G$ an element of the group. Is it possible that $aHa^{-1} \subset H$, but $aHa^{-1} \neq H$?   If $H$ has finite index or finite order, this is not possible.


I will be going to Switzerland soon, and will need Swiss Francs before I leave.  Where can I bet the best rate to buy Swiss Francs?  I live in SF Bay Area.

I am planning a trip to a conference in Switzerland, and my airfare will be reimbursed to me when I arrive there. They will be reimbursing me in Swiss Francs. I want to get a good exchange rate.  Is it better to exchange the Swiss Francs in Switzerland for USD? If so, where?  Or, is it better to exchange it for USD back in the US?


Are the following urls threated the same in SEO rank or is someone better than another? If, why?   language.example.com/page example.com/language/page

When I set up a site in multiple languages, how should I set up my URLs for search engines and usability?  Let's say my site is www.example.com, and I'm translating into French and Spanish. What is best for usability and SEO?  Directory option:  http://www.example.com/sample.html http://www.example.com/fr/sample.html http://www.example.com/es/sample.html   Subdomain option:  http://www.example.com/sample.html http://fr.example.com/sample.html http://es.example.com/sample.html   Filename option:  http://www.example.com/sample.html http://www.example.com/sample.fr.html http://www.example.com/sample.es.html   Accept-Language header:  Or should I simply parse the  header and generate content server-side to suit that header?  Is there another way to do this? If the different language versions don't have different urls, what do I do about the search engines?    UPDATE 2011-12-06  Google has new recommendations for meta tags for explicitly pointing to other language content: .  UPDATE 2012-05-25  Related but not precisely:   UPDATE 2013-06-12  includes discussion of several URL schemes directly relevant to the question.


Prove that $3^n>n^2$ for any positive integer n>2  Let $n=1$ $$3^1>1^2$$ Let $n=2$ $$3^2>2^2$$ Assume P holds for n=k $$3^k>k^2$$ Let $n=k+1$ $$ \begin{align} 3^{k+1}>(k+1)^2 \\3\times3^k>(k+1)^2 \end{align}$$ From here I can not find where to go to finish the proof.   The main part of the question is the proof, however; I would like to also know if using $n=k+1$ is always the way to go? I have only done a few proofs by induction and so far to my understanding is that the whole point is to prove the function, series or statement for all positive integers. Is there a special way to go about these types of problems when only given an inequality or a single statement? In comparison to being give a sequence and told what that sequence as a function is, i.e $1+2+3+...+n=\frac{n(n+1)}{2}$ as an example as an easy sequence to prove with $n=k+1$

How do I prove that $3^n > n^2$ with mathematical induction? I thought I had the correct answer but my teacher says its wrong.  I let $n=1$ for the initial case and it works. I then assumed $n=k$ works and went onto the $n=k+1$ case, but after that it goes a little awry. Thanks in advance!


man-db is already the newest version.   shopt can run,but no man shopt info.

What is the canonical way for accessing the local documentation on any available Shell Options builtin with shopt?  I'm using Ubuntu 12.04 and can run help shopt to get a description of what shopt does:  shopt: shopt [-pqsu] [-o] [optname ...]     Set and unset shell options.     ...   I can list the various Shell Options and their values (shopt or shopt -p). But how do I find out what each one actually does without leaving the comfort of my Linux box? I'm not looking for . Is there a man page or something I'm missing?


I have following 2 files:  file cd2vcaa (in path):  #! /bin/bash cd /var/cache/apt/archives   file test.sh (in current directory):  #! /bin/bash . cd2vcaa   From terminal, I am able to change directory with . cd2vcaa but not with ./test.sh  ~$ cd2vcaa                        <-- no effect ~$ . cd2vcaa                      <-- changes directory /var/cache/apt/archives$ cd       <-- back to home directory ~$ ./test.sh                      <-- does not change directory though no error - why? ~$   Why is . cd2vcaa working from terminal but from within another script? How can this problem be solved?

I'm trying to write a small script to change the current directory to my project directory:  #!/bin/bash cd /home/tree/projects/java   I saved this file as proj, added execute permission with chmod, and copied it to /usr/bin. When I call it by: proj, it does nothing. What am I doing wrong?


Essentially, I am wondering if you can represent a repeating decimal and have a number. For example, perhaps 0.9 repeating with an 8 at the end, the largest decimal less than one (because 0.9 repeating is equal to one.) Logic would dictate that you would have 0.98 with a bar only above the 9. However, I do not know if a number like this exists and if so, how I can represent it. Sorry for my lack of formatting skills.

Does $1.0000000000\cdots 1$ (with  an infinite number of  $0$ in it) exist?


How to compute $$\lim_{n \to \infty}\frac{1}{n}\frac{2}{n}...\frac{n}{n} $$ ?  Thanks,

Let $a_n=\frac{n!}{n^n}$ be a sequence. Prove that $\limsup(a_n)=0$.  I know that the series $\sum^{\infty}_{n=1} \frac{n!}{n^n}$ converges, so the nth term must converge to 0. But I cannot use the convergence of series to prove this.   Basically what I have is: The sequence $a_n$ is decrescent and bounded by 0 $(a_n>0 \; \forall n)$, therefore is convergent and it's limit is the $\limsup(a_n)$.   So I must show that $\lim\frac{n!}{n^n}=0$  Let $\epsilon>0$, prove that exists $n_0 \in \mathbb{N}$ such that, if $n>n_0$  $$\left|\frac{n!}{n^n}-0\right|<\epsilon \Rightarrow -\epsilon<\frac{n!}{n^n}<\epsilon$$  I know that $\frac{n!}{n^n}>=-\epsilon$ because $\frac{n!}{n^n}>0$.  How can I prove that $\frac{n!}{n^n}<\epsilon$?


Prove that if $x$ is odd, then $x^8 \equiv 1 \pmod{32}$.   I tried using the expansion $$(2k+1)^8 = 256 k^8+1024 k^7+1792 k^6+1792 k^5+1120 k^4+448 k^3+112 k^2+16 k+1,$$ but I don't see how that helps. Is there an easier way?  How would we prove in general that $x^{{2^k}} \equiv 1 \pmod{2^{k+2}}$ if $x$ is odd?

I would like to prove that  $$a^{2^n}\equiv 1 \pmod {2^{n+2}}$$  I tried induction but could not get it.  Thank you very much!


I have a feeling that this question has been asked before, but I was wanting to know if anyone has installed Ubuntu on an SSD and have their /home folder on an HDD?  The reason I ask is I have a MacBook Pro that I recently upgraded to an SSD, I have my /Users folder on a separate hard drive from tips I have learned from watching YouTube videos.  I want to know if it can be done on Ubuntu as well, if it can, please provide easy to follow instructions for me to follow so when I get another SSD for a computer I built, I can do it and show my inner geek. LOL!  Remember, I want Ubuntu on the SSD and my /home folder on the HDD, this is NOT a dual-boot setup.  Stay Awesome and Always Believe

I have 2 HDD drives in my computer. At the moment second drive is mounted as /media/storage.  How can I move my user data from /home to /media/storage/home?  Can I just move the data over there and then simply symlink it back?


In how many PS3 can I log in with my account of psn?   I would stay at my cousin place like for 2 weeks and I want to download some games from my account to play there.

I buy & download a game from PSN on my user account on PS3 #1. Then I switch to PS3 #2 and login with the same PSN account. Can I download the same game without paying twice?


I'm trying to solve the problem Sec. 2 - 1.16 in Shafarevich's book Basic Algebraic Geometry, vol. 1, second ed. My attempt is to use the previous exercise Sec. 2 - 1.12. So I only need to show that the polynomial $x_0^4+x_1^4+x_2^4+x_3^4 - a x_0x_1x_2x_3$ is irreducible for every value of $a \in \mathbb{C}$ and compute the common roots of the polynomial and the partial derivatives. My problem is to show that the polynomial is irreducible. I've found the following question in the MSE site related with the problem:  In an answer, a user says that the irreducibility of the polynomial follows from an expression given there. What is he referring to? I've never seen something similar to this while proving that a polynomial is irreducible. Thanks in advance!

I'm working through Shafarevich's Basic Algebraic Geometry book and in one of the exercises (number II.1.15 in my edition), he asks "for what values of $a$ does the surface $x_0^4+x_1^4+x_2^4+x_3^4-ax_1x_2x_3x_4=0$ have singular points?". From the definitions I'm working with, a surface is variety of dimension 2. (Note that Shafarevich's definition of a variety does not assume irreducibility.) If $X=V(F)\subseteq \mathbb P^4$, where $F$ is the polynomial above, why does $X$ have dimension 2? I feel like this is just not true: for example, if $a=0$ then $F$ is irreducible, so $X$ is an irreducible hypersurface, and therefore $X$ should have codimension 1 in $\mathbb P^4$ by Theorem 6.1.2 in Shafarevich ("every irreducible component of a hypersurface in $\mathbb P^n$ has codimension 1). Is Shafarevich just abusing the term "surface" here or am I making some mistake?


I know the $\sum_{n=1}^\infty \frac{1}{\text{Prime[$n$]}}$ does not converge, but what about the  following series? $$\sum_{n=1}^\infty\frac{1}{\text{Prime[Prime[$n$]]}}$$  (Where $\text{Prime[$n$]}$ is the $n$th prime number.)  I ran some calculation on Mathematica, but I am not sure in the answer gets very close to 1.  Can anyone help with that?  NB: I an not a professional mathematician. I am just an amateur.

What is the value of $\sum\limits_{i=1}^\infty\dfrac{1}{p_{p_i}}$ where $p_n$ is the nth prime (and so $p_{p_n}$ is the $k$th prime, where $k$ is the $n$th prime) ?  Thus $\frac{1}{3}+\frac{1}{5}+\frac{1}{11}+...=$ ??  How do I efficiently decide if $\sum_{i=1}^\infty\dfrac{1}{p_{p_i}}\gt1$ is true without using a computer ?  I assume this infinite sum is an irrational number. Has this already been proven ?


I have an wsp in Sharepoint2007 ,and I need to used in SharePoint2010. How can I upgrade the solution. beast regards

can anyone please provide steps to follow for migratng custom web parts which has code based .wsp file form sharepoint 2007 to sharepoint 2010.Thanks in advance


I cooked a pot of beef stew...I slow cook the roast and vegetables until 2am I fell a sleep and woke up around 9am is it safe to eat?

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


I am using a dual boot windows 7 64-bit with Ubuntu 16.04 64-bit. I am new to Ubuntu as well as Linux.  I am getting a warning as I log in on Ubuntu about low space in home. Here is my disk space when checking through gparted.    Now what I want to do is reallocate some space from / to /home, since as you can see I have 59.66 GB space free in /. I want to know how to do this - the articles I read suggest it can be risky, and since I'm new I need detailed help.  I am also confused about the warning as in gparted I see that I have 1.75GB unused space in home but the warning says your home has just some 600+MB remaining. Why is that?

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I purchased, DELL Vostro-3558-Latop series with i3 5th Gen, 1TB HDD, 2G nVidia Graphics, 4GB DDR3 RAM and Ubuntu 14.04 pre-installed. I am totally at mercy of DELL Support. During software update the laptop got hanged and corrupted the installed operating system.  DELL Support raised their hands and said they do not support in UBUNTU.  Now somehow i managed to install the UBUNTU 16.04, but i am not able to see the appropriate driver for nVidia 920m graphics.  Please help me in getting the same restored back the nVidia Settings for enabling/disabling the graphics.  By any way like GUI, command etc.

Is there a package of Ubuntu drivers as driver pack solution? I tried to search for it, but I did not find it. If there is, how can I easily get it?


I need to add a CSS class to a views row depending on a field. So far this is easy going if I use Fields as Content (add class via replacement patterns then).  But I find it far more difficult to do this when using Row style "Content" and a custom view mode (e. g. Teaser).  I found the following code to work for me if I use Row style "Content":  function mytheme_preprocess_views_view_unformatted(&$vars) { foreach($vars['view']->result as $rkey => $rval) {     $node = node_load($rval->nid);     if(isset($node->field_breite) && !(empty($node->field_breite)))     {         $vars['classes_array'][$rkey] .= $vars['classes_array'][$rkey] . " " . $node->field_breite[LANGUAGE_NONE][0]['value'];     } }   }  I like to ask if this is a suitable approach or am I maybe wasting resources by loading each node and can I grab the node data easier somewhere else?  PS: It is not a option for me here to use Fields in the View as content because I want to use different content types in the view with different fields.  Settings:

I have a view with a page display showing a list of events. I'd like to add a class to the rows of those events that are in the past.  The problem I have is that views-view-list.tpl.php doesn't have access to the values of fields within the rows.   And I can use views-view-fields.tpl.php to check the date field of one row, and wrap each field in that row with a div or span based on whether or not the date field is in the past.  I just can't figure out how to use the value of a field within a row to wrap the whole row in something with a class.


There are a few thing that can run directly off of AC power like incandescent light bulbs and and electric motors but it stops there. Most electronics need power converted to DC before it can be applied to a circuit. Is there a fundamental reason why logic circuits that use AC power directly haven't been developed or is it just a lack of ingenuity?

Why are home appliances not designed to work on ac?why cant we just stepdown the incoming 230V and design the systems to operate at low ac voltages,instead of converting ac to dc?


I know that the Elastic net takes care of the limitations of Lasso by adding an L 2 penalty term. In the attached picture has been mentioned that the two formulas are equivalent. I tried to show this, but I failed.  Could you please help me to see how these two equations are equivariant?

According to Hastie's , the elastic net has two equivalent formulations:  $$\hat{\beta} = \underset{\beta}{\operatorname{argmin}} \left\{ \sum_{i=1}^N\left(y_i-\sum_{j=1}^p x_{ij} \beta_j\right)^2  + \lambda_1 \sum_{j=1}^p |\beta_j|+ \lambda_2 \sum_{j=1}^p \beta_j^2 \right\}$$  and  $$\hat{\beta} = \underset{\beta}{\operatorname{argmin}} \left\{ \sum_{i=1}^N\left(y_i - \sum_{j=1}^p x_{ij} \beta_j\right)^2\right\} \;\text{ s.t. } \;(1-\alpha)\sum_{j=1}^p |\beta_j| + \alpha\sum_{j=1}^p \beta_j^2 \leq t$$  where $\alpha = \frac{\lambda_2}{\lambda_1 + \lambda_2}$  My question is how to prove this equivalence formally. Ridge regression and the lasso also have these two possible formulations, but I could not find any reference where this equivalence is proven. A similar question I found in CrossValidated is this one     but I'm unable to understand Tristan's explanation. I have some understanding of Lagrange optimization theory, and I guess the answer is around those lines, but since all the papers treat the equivalence as obvious I would like to find a proper reference where this is explicitly demonstrated.


EDIT (No duplicate of ): This question is centered on asking how to combine values from Euclidean and Cosine distances obtained from not-normalized vectors. Being not normalized the distances are not equivalent, as clarified by @ttnphns in comments below. Also I have cosine distance (1- similarity), not cosine similarity.  Short question: How can I combine Euclidean and Cosine/Angular distances between multivariate vectors successfully? Are there special considerations regarding to the objective of the comparison? (for example: to take more into consideration magnitude over orientation)  Background:   I'm using Dynamic Time Warping (DTW) for matching short time series and building a similarity matrix, with the intention of clustering the different time series and get insights from the clusters.  I'm using physical performance features of athletes, but instead of using the overall magnitude of each measure, I use the number of standard deviations that an athlete from the group mean. So the time series (multivariate) is conformed by successive points indicating the deviation from the mean an athlete has over time.  My main objective is to cluster together windowed-sections of the time series that reflect remarkable similar behavior in the up-and-down of values.  So, for DTW I need a distance measure to be used to find the warping path, and then compute the overall distance between pairwise time series. I will like to take into account both the magnitude of the vectors (each point in the time series) and the orientation. It seems then that Euclidean distance can work well for the first one and Cosine/Angular distance for the second one.  How can I combine both distances in order to keep their properties?

In Random forest algorithm, Breiman (author) constructs similarity matrix as follows:   Send all learning examples down each tree in the forest If two examples land in the same leaf increment corresponding element in similarity matrix by 1 Normalize the matrix with number of trees   He says:     The proximities between cases n and k form a matrix {prox(n,k)}. From their definition, it is easy to show that this matrix is symmetric, positive definite and bounded above by 1, with the diagonal elements equal to 1. It follows that the values 1-prox(n,k) are squared distances in a Euclidean space of dimension not greater than the number of cases.    In his implementation, he uses sqrt(1-prox), where prox is a similarity matrix, to convert it to distance matrix. I guess it has something to do with the "sqaured distances in a Euclidean space"-quoted above.  Can somebody shine a little light on why it follows that 1-prox are squared distances in a Euclidean space and why he uses squared root to get distance matrix?


When working on a LaTeX project I like to create an .sty file (say mymacros.sty) where all my custom macros are defined. I then simply call \usepackage{mymacros} in the main .tex file preamble. I also update mymacros.sty while working when I need to define a new macro.  The drawback is that most LaTeX editors I have tried can auto-complete commands directly in the preamble of the main .tex file but cannot auto-complete commands from mymacros.sty.  TeXStudio autogenerates a .cwl file corresponding to mymacros.sty but marks all commands with #S (i.e. do not show in completer at all). Okay, I could simply replace these with #n for example and everything would be fine. However, when updating mymacros.sty for a new command, the .cwl file is not updated correspondingly. I would have to manually insert the new command to the .cwl file.  Kile does auto-complete commands for mymacros.sty but, for some reason, only some of them. I haven't been able to find out why.  My question:   Is there an editor which would provide the described functionality out-of-the-box? That would be able automatically parse the used packages and offer auto-completion of its commands even when the package is regularly updated?   Specifically:   I do not want to be editing any .cwl files.  I'm fine with all the commands being classified as #n as long as they appear in the auto-complete pop-up window.

What editors/IDEs are available for easing the process of writing TeX/LaTeX documents? Please state some useful features like code completion, spell checking, building final DVI or PDF files, etc.  This question is undergoing a systematic refurbishment, see  on Meta. If you’d like to see another editor feature covered here or to take care of an editor that’s not covered yet, share your ideas in that meta question.  List of editors Links to answers.


I have a few questions about double slit experiment.   In order to get an interference pattern with electromagnetic waves, what is the relationship between widths and separation of slits with the wavelength of the wave? What about if we want to get an interference pattern for electrons? What is the wavelength of electrons when they behave as waves? What about bigger objects? I've read that the interference pattern has been reproduced with big molecules. Is there any theoretical or practical limit on the size of particles for which an interference pattern is possible? This is my main question.

I have read "" which claims to observe diffraction patterns in objects of around 10'000 amu. What is the largest mass objects shown to have diffraction patterns and show wave-particle duality? I have heard a claims of this type have been shown for small amino acids, and possibly protein strands or even small viruses, but have struggled to find any references.


How to Find Folders (Directories) That are empty (Not Containing Any Files) and Delete Them By Using Terminal Command or Another Method.  Filtration (Finding Directories or Files) Less than 'N' bytes not Safe Because There are files which is only of 50 bytes but should be kept.  I Want to Find only Empty (sub)Directories in Prticular Folder.

Say I have a directory named foo/. This folder includes subdirectories. How can I delete all the empty directories in one command?


In SSB4, there is a challenge where the game wants you to get a combo of 100. Is there any way to  get combo tht high?

For the first two challenge panels, I just used my golden hammers on the "get a combo of x," but now I'm seeing on challenge panel 3, the game expects you to get a combo of 100! I can barely get past a combo of 9 without the counter resetting. What character / stage combination can get you a combo of 100? Are there multiple, so I can more easily get the "get a total combo of 400 across all characters" challenge?  Additionally, what exactly constitutes a combo? Sometimes my combos are cut short and sometimes they're longer, so I must not understand how they're tracked.


Is there a way to prevent the whole document to use word breaking?  I have seen some options such as \raggedright{} but that is not elegant for a book.

I can't find where I can remove any kind of hyphenation and just have LaTeX just do a line break.  edit: Honestly speaking I just don't like to read hyphenation anywhere and that's the only reason why I wanted to remove it. It is a matter of style, probably unexpected in LaTeX.  The document has only a summary in a different language and I used the language packages to hyphenate properly.


I'm using the below command but it is not working  find . PYRLLPS_GL_201610D2* -maxdepth 1 -mtime -30   I get the below error  find: bad option -maxdepth find: [-H | -L] path-list predicate-list

I noticed recently that  do not include the -maxdepth primary.  For those unfamiliar with it, the purpose of the -maxdepth primary is to restrict how many levels deep find will descend.  -maxdepth 0 results in only command line arguments being processed; -maxdepth 1 would only handle results directly within the command line arguments, etc.  How can I get the equivalent behavior to the non-POSIX -maxdepth primary using only POSIX-specified options and tools?  (Note: Of course I can get the equivalent of -maxdepth 0 by just using -prune as the first operand, but that doesn't extend to other depths.)


My son's just turning 8 this year and has just started to learn some of the basics of multiplications, including multiplication signs.    However, he's started asking me why a negative multiplied by another negative would make a positive. It's quite hard to explain to a kid and I'm not quite sure how to put it. I've seen the  but I fear the concepts within those answers are much too difficult for my son to wrap his head around.  What's the best way to explain to my kid why a negative × negative = positive?  For reference, I'm looking for simple concepts to explain to a child to understand this.  At this point he could care less about dot products, absolute values, multiplicative identities.  He's just getting started with multiplication for crying out loud.

Someone recently asked me why a negative $\times$ a negative is positive, and why a negative $\times$ a positive is negative, etc.  I went ahead and gave them a proof by contradiction like so:  Assume $(-x) \cdot (-y) = -xy$  Then divide both sides by $(-x)$ and you get $(-y) = y$  Since we have a contradiction, then our first assumption must be incorrect.  I'm guessing I did something wrong here. Since the conclusion of $(-x) \cdot (-y) = (xy)$ is hard to derive from what I wrote.  Is there a better way to explain this?  Is my proof incorrect?  Also, what would be an intuitive way to explain the negation concept, if there is one?


My textbook states that power is transmitted at high voltage and low current since $P=I^2R$ and as the current has a small magnitude, the heat dissipated across the transmission lines is less than when we carry it out at high current and low voltage. But $P=I^2R$ can also be written as $P=V^2/R$ and hence a discrepancy would occur. Where am I going wrong?

I've been having a bit of trouble understanding the High-Voltage powerlines. If I was sending power from $A \rightarrow B$, we have:  Ohm's law $V = IR$  Power lost in the form of heat $P = I^2 R$  Power delivered to $B$ is $P = VI$  But using Ohm's law on the power lost formula, we get $P = V I$ also.  Does this mean that the total amount of power $A$ loses is $P_A = 2 VI$, and the total amount of power delivered to $B$ is just $P_B = VI$? Will transferring energy always result in half of it being lost?


I wrote this three simple source files as an example to test class templates with modules.  main.cpp  #include "MyTemplateClass.hpp"  int main() {     MyTemplateClass<int> obj;      obj.func();      return 0; }   MyTemplateClass.hpp  template <typename T> class MyTemplateClass {   public:     void func(); };   MyTemplateClass.cpp  #include "MyTemplateClass.hpp" #include <iostream>  template <typename T> void MyTemplateClass<T>::func() {     std::cout << "MyTemplateClass" << std::endl; }   When I try to compile, I get this error.  > cl main.cpp MyTemplateClass.cpp /out:main.exe main.obj MyTemplateClass.obj main.obj : error LNK2019: unresolved external symbol "public: void __thiscall MyTemplateClass<int>::func(void)" (?func@?$MyTemplateClass@H@@QAEXXZ) referenced in function _main main.exe : fatal error LNK1120: 1 unresolved externals   How can I solve the problem? Thanks!

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I need a word that describes when you're trying to explain an idea to someone, but you just can't word it right. Like when the words are just on the tip of your tongue, but you simply don't know them, or they don't exist. I want the word to describe the feeling, or even the situation. The feeling is kind of like trying to describe the color blue to a blind person, but more about the speaker's incapability to communicate the idea, rather than the listener's incapability to understand.

I vaguely remember seeing this word years ago, it started with "log-". I want to know what this word is because I have this problem all the time (as many others do), where the word I am thinking of is right at the tip of my tongue but I just can't remember it.   It's a bit fitting for this situation, isn't it?


I bought a new HP notebook with pre-installed Win 8.1. I am trying to dual boot it with Ubuntu 14.04. I have followed the usual steps, and installed Ubuntu on my system. However, when I boot the system it goes to Win 8 and does not dual boot.  I was able to access ubuntu in the legacy mode, but had to manually intervene the boot process. To change the legacy mode I ran boot-repair, as advised on the forum here, with the recommended settings. This is the before and after bootinfo.       Now, when I try to boot into Ubuntu from the HDD it goes into grub rescue mode with the error '/boot/grub/ i386-pc/normal.mod not found.  Which I suppose is bound to happen since grub-pc was replaced to grub-efi in the  boot repair.  The problem is that even after the boot repair the system boots into OS manager which by default boots Win 8. I read here    that HP notebooks might be hard-coded to boot only Win 8. Since I am new to linux I'm unable to figure out what to do next and how to work around this problem. Any help would be much appreciated. Thank you.

I have a Lenovo IdeaPad Y400 that came pre-installed with Windows 8. I would like to run Ubuntu alongside it in a dual-boot configuration. I've spent the past week fiddling around, re-installing both Windows and Linux in various configurations, and I've come awfully close to success, but seem to have hit a snag with Grub.  For my most recent attempt, I took the following steps:   Disabled Secure Boot Re-imaged Windows 8 from a hidden recovery partition, effectively restoring the machine to factory state Activated an option called Legacy Support in the BIOS (or is it UEFI now?) Booted Ubuntu 13.04 x64 from a USB stick, chose "install alongside Windows" and accepted all default options After a restart, found that I could boot Ubuntu, but could not boot Windows Once into Ubuntu, I ran Boot Repair with recommended settings and accepted all defaults. When Boot Repair finished, I was presented with the following message:      The boot files of [The OS now in use - Ubuntu 13.04] are far from the   start of the disk. Your BIOS may not detect them. You may want to   retry after creating a /boot partition (EXT4, >200MB, start of the   disk). This can be performed via tools such as gParted. Then select   this partition via the [Separate /boot partition:] option of [Boot   Repair]. ()    I followed the instructions at the url in the message, creating a 1GB EXT 4 partition near the start of the drive  when I tried to run Boot Repair again, the "Separate /boot partition" option on the "Grub Location" tab was disabled.  The new partition is /dev/sda11 and has the label GRUB. On restart, I get the following error message:      error: file '/boot/grub/i386-pc/normal.mod' not found.    grub rescue>    However, if I manually choose the boot partition by hitting F12, I can boot into Windows no problems. Selecting Ubuntu from the boot device menu gives me a Grub menu with the following options:      Ubuntu      Advanced options for Ubuntu       Windows UEFI recovery bootmgfw.efi      Windows Boot UEFI recovery       Windows UEFI recovery LrsBootmgr.efi      Windows Boot UEFI recovery bkpbootx64.efi       Windows Recovery Environment (loader) (on /dev/sda3)       Windows 8 (loader) (on /dev/sda5) System setup    Selecting Ubuntu from this menu allows me to get to my Ubuntu desktop. I haven't tried the other options yet for fear of losing the progress that I've made.   So it looks like I have successfully dual-booted the machine, but that Grub is broken for some reason or another.   My current partition scheme can be seen at:   Thanks in advance - Jonathan


As I'm about to finish my bachelor thesis, I'm at writing the acknowledgement section.  How far can I go here in terms of non-thesis-related stuff?  Is there room for humorous acknowledgements (like thanking my coworker for his great taste in music or bad puns), or is that rather something to be left out?

Can I add some music bands in the acknowledgement section of my bachelor thesis? I used to listen these bands during all my 3-year long studies and during all the writing of my thesis, so I think they helped me quite a lot.


External customers are registered via Self Registered page. I want to configure validation errors so that users have more understanding about mistakes they do on login page such as entering existing userID . so we want to custmise the user friendly erorr massage such as "User ID already exist, please enter another user ID"  User always get "Your request cannot be processed at this time. The site administrator has been alerted"   I already check in "LightningSelfRegisterController" to customize error massage, But there is no mention to error messages in the controller. If I know the page or controller these messages are generated I can customise them.

When a Community user tries to register using an email address that already exists in the system (using self-registration), they receive a very generic error message:     "Your request cannot be processed at this time. The site administrator has been alerted."   Does anyone know how we can customize this error message (via code or anything else) to rather display something like this:     "Oops! Looks like you're trying to register with an email address that is already associated with a User. Please go back to the login page and log in with the email address and your existing password."


i want to run the following command :  sudo apt-get -f install   all packages downloads fine expect 1 package because the contain "proxy" word in the link and my ISP block it  i can give him another link to download package from or i can use some VPN programs like Vidalia but i can't install anything!!     so how can i specify a link or install a software

I live in Ethiopia and the government blocks all urls with the word "proxy" in them. I couldn't use that word in the title above because that would make the url contain the word proxy.   When I apt-get upgrade I get errors because some packages like libproxy1, libproxy1-plugin-gsettings, libproxy1-plugin-networkmanager, python-libproxy all contain the p word.  Therefore, it is all blocked. I tried putting the urls into proxy sites, but they all just returned to their home page.   Are there any other solutions?


How to autostart a task at system start up i.e. myprogram.bin with admin rights?  Regards

I need to run a bash script at boot-time as superuser in Xubuntu. I don't know where to start. I have to do something described in a Arch Linux guide. That guide says exactly:     Add following at the end of the file : /etc/rc.sysinit   # Do my action /etc/rc.d/do_my_action  /bin/dmesg >| /var/log/dmesg.log   But I do not have /etc/rc.sysinit and /etc/rc.d/ in Xubuntu. I'm sure there are equivalent ones, right?


Prove $A \lor (A \land B) \Leftrightarrow A$ without using truth table.  The proof may involve expanding $B$ into $B \land B$ or possibly $B \lor B$. I am stuck after playing with distributive law several times. Thanks for any help.

I've done a truth table after reducing it to this and it seems to be equal to $\neg Q$:  $$\lnot Q \lor (\lnot Q \land R) = \lnot Q$$  But when I try to show it without a truth table (with just transformations), I end up in a loop between that and:  $$\lnot Q \land (\lnot Q \lor R)$$  Is there a way to show this is true without using a truth table? What am I missing?!  Thanks in advance!


A related question is in C, but this questions pertains to specifically C++. When I try to compile this code, it gives me the following error message:  In file included from main.cpp:5: ./Any.hpp:20:6: error: function 'any<std::__1::vector<double, std::__1::allocator<double> >, (lambda at main.cpp:12:23)>' is used but not defined in this translation unit, and       cannot be defined in any other translation unit because its type does not have linkage bool any(List &elements, Function callback);      ^ main.cpp:19:9: note: used here     if (any(doubleElements, doubleFunc)) {         ^ In file included from main.cpp:5: ./Any.hpp:20:6: error: function 'any<std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >, (lambda at main.cpp:15:23)>' is used but       not defined in this translation unit, and cannot be defined in any other translation unit because its type does not have linkage bool any(List &elements, Function callback);      ^ main.cpp:22:9: note: used here     if (any(stringElements, stringFunc)) {         ^ 2 errors generated.   Below are the source files:  Any.h  #ifndef ANY_HPP_INCLUDED #define ANY_HPP_INCLUDED  /**  * @author Ben Antonellis **/  #include <vector> #include <iostream>  /**  * Returns True if any of the elements meet the callback functions parameters.  *   * @param elements - A list of elements.  * @param callback - Callback function to invoke on each element.  *   * @return bool - True if parameters are met, False otherwise. **/ template <typename List, typename Function> bool any(List &elements, Function callback);  #endif   Any.cpp  /**  * @author Ben Antonellis **/  #include "Any.hpp"  template <typename List, typename Function> bool any(List &elements, Function callback) {     for (auto element : elements) {         if (callback(element)) {             return true;         }     }     return false; }   And here's how I'm calling this function:  main.cpp  /**  * @author Ben Antonellis **/  #include "Any.hpp"  int main() {      std::vector<double> doubleElements = {-1.0, -2.0, -3.0};     std::vector<std::string> stringElements = {"Hello", "Goodbye", "Testing 123"};      auto doubleFunc = [] (double number) {         return number < 0;     };     auto stringFunc = [] (std::string string) {         return string.length() > 5;     };      if (any(doubleElements, doubleFunc)) {         std::cout << "Double Success." << std::endl;     }     if (any(stringElements, stringFunc)) {         std::cout << "String Success." << std::endl;     }      return 0; }   This is the current way I am compiling my code:  g++ -std=gnu++2a -c main.cpp Any.cpp   Any help is appreciated, I've been stuck on this for a long time.


Here is the content of the directory:  λ dir /b "..\src\" main.c main.c_ main.c2 main.cpp main.cpp_ main.cpp2   This works as expected:  λ dir /b "..\src\*.c" main.c   This doesn't:  λ dir /b "..\src\*.cpp" main.cpp main.cpp_ main.cpp2   Why does this wildcard match main.cpp_ and main.cpp2?  What is a working solution to list only *.cpp files in a directory?  EDIT: it is not a duplicate of

Files in folder:  a.j ab.jp abc.jpg abcd.jpeg   dir command results:  Command       Result (Files shown) ----------    -------------------- dir ?.*       a.j dir ??.*      a.j, ab.jp dir ???.*     a.j, ab.jp, abc.jpg dir ????.*    a.j, ab.jp, abc.jpg, abcd.jpeg   So we can see single ? it means "0 or 1 letter".  Now more dir command results:  Command       Result (Files shown) ----------    -------------------- dir *.?       a.j dir *.??      a.j, ab.jp dir *.???     a.j, ab.jp, abc.jpg, abcd.jpeg --> What is this?! dir *.????    a.j, ab.jp, abc.jpg, abcd.jpeg   In 3rd command why ??? is showing jpeg? Can you explain? Is this bug in cmd?


Show that $$Q[x]/(x^2-2)$$ is not isomorphic to $$Q[x]/(x^2-3)$$  I was practicing some exercises in Hungerford's abstract algebra book, I could make them all but this one. I think I have to verify if it is irreducible and thus be able to say if it is isomorphic, but I do not know how. I hope you can help me understand.

In this  we saw isomorphism of vector spaces over $\mathbb{Q}$. Just came across this question:   Is $\mathbb{Q}(\sqrt{2}) \cong \mathbb{Q}(\sqrt{3})$?   I know these as $\mathbb{Q}$-Vector spaces, are isomorphic from the  linked post. But as fields are they isomorphic? I neither know how to prove it nor how to disprove it.


Let $A$ be a Hermitian square complex matrix of size $n$ then $\langle Ax,x\rangle=0$ for all $x \in \Bbb C^n$. Then $A=0$   I need a hint to prove it, if possible  Thank you

Let $A$ be a Hermitian square complex matrix of size $n$ then $\langle Ax,x \rangle=0$,   $\forall x \in \Bbb C^n$ if and only if $A=0$   I want to know if the condition that $A$ is Hermitian is required for the statement to still hold, please?  Thank you


The official MySQL documentation the the MEMORY storage engine covers maximum table size (in MB) but the maximum number of columns that can be defined on a table is not specified.  This question is specifically about the MEMORY storage engine - not InnoDB or MySQL in general.

I have a table with 1699 columns and when I'm trying to insert more columns I get,     Error Code: 1117. Too many columns   In this table I have only 1000 rows. For me the most important thing is the number of columns. Are there any limitations on the table? I want to create 2000 columns. Is that possible?


cd / && du -sh . told me that the filesystem used 2.1G spaces of disk:  root@ubuntu:/# cd / &&  du -sh . du: cannot access './proc/3874/task/3874/fd/3': No such file or directory du: cannot access './proc/3874/task/3874/fdinfo/3': No such file or directory du: cannot access './proc/3874/fd/4': No such file or directory du: cannot access './proc/3874/fdinfo/4': No such file or directory 2.1G    .   However, df -h told me that all spaces had been used:  root@ubuntu:/# df -h Filesystem      Size  Used Avail Use% Mounted on /dev/root       7.2G  6.8G     0 100% / devtmpfs        3.6G     0  3.6G   0% /dev tmpfs           3.9G     0  3.9G   0% /dev/shm tmpfs           3.9G   17M  3.9G   1% /run tmpfs           5.0M     0  5.0M   0% /run/lock tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup   Here is the output of fdisk -l:  Disk /dev/mmcblk1: 7.4 GiB, 7948206080 bytes, 15523840 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000  Device         Boot Start      End  Sectors  Size Id Type /dev/mmcblk1p1       2048 15523839 15521792  7.4G 83 Linux   I don't why I have 6.8G spaces used, also, I don't know why df -h showed me the /dev/root instead of /dev/mmcblk1p1. ls /dev/root even showed me No such file or directory error.

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many different figures for the total size of my files? Can't computers add?  Speaking of adding: when I add the “Used” and “Available” columns of df, I don't get the total figure. And that total figure is smaller than the size of my partition. And if I add up my partition sizes I don't get my disk size! What gives?