Lets say I have: Expression&lt;Func&lt;object, bool&gt;&gt; a; Expression&lt;Func&lt;object, bool&gt;&gt; b;  a = (x) =&gt; x.ToString() == &quot;hello&quot;; b = (x) =&gt; x.ToString() == &quot;world&quot;;  How can I AND this expressions? In other words I will like to implement this method: // I will like this method to return this expression: // (x) =&gt; x.ToString() == &quot;hello&quot; &amp;&amp; x.ToString() == &quot;world&quot;; Expression&lt;Func&lt;object, bool&gt;&gt; AndExpressions(Expression&lt;Func&lt;object, bool&gt;&gt; a, Expression&lt;Func&lt;object, bool&gt;&gt; b) {     // return a.Body &amp;&amp; b.Body  }    I do not plan to execute the expressions. I just want to join them so that I can build my mongodb query with c#.
I have two expressions of type Expression&lt;Func&lt;T, bool&gt;&gt; and I want to take to OR, AND or NOT of these and get a new expression of the same type  Expression&lt;Func&lt;T, bool&gt;&gt; expr1; Expression&lt;Func&lt;T, bool&gt;&gt; expr2;  ...  //how to do this (the code below will obviously not work) Expression&lt;Func&lt;T, bool&gt;&gt; andExpression = expr AND expr2
How to set system-wide environment variables on OS X Mavericks $$\lim_{x \to 0} \frac{f(x)}{|x|}=1$$ Then prove that $f$ is not differentiable at $0$. I was given this assignment and I'm not sure about my proof.. it feels like I'm assuming too much and not explaining with enough detail. Is there anything I need to add to make it sufficient? Assume toward contradiction that $f$ is differentiable at $0$. Then by definition we know that $f$ is continuous at $0$. Therefore $\lim _{x\to 0}f\left(x\right)=f\left(0\right)$ We know that $\lim _{x\to 0}\frac{\left(f\left(x\right)\right)}{\left|x\right|}=1$ Therefore we can conclude $\lim _{x\to 0}\frac{\left(f\left(x\right)\right)}{\left|x\right|}\cdot \left|x\right|=1\cdot 0=0$ But we can also rewrite this as $\lim _{x\to 0}\left(f\left(x\right)\right)\cdot \frac{\left|x\right|}{\left|x\right|}=f\left(0\right)\cdot 1=0$ Therefore $f(0) = 0$. Since $f$ is differentiable at $0$ we have $\lim _{x\to 0}\frac{\left(f\left(x\right)-f\left(0\right)\right)}{x-0}=\lim _{x\to 0}\frac{\left(f\left(x\right)-0\right)}{x}=\lim \:_{x\to \:0}\frac{\left(f\left(x\right)\right)}{x}\cdot \frac{\left|x\right|}{\left|x\right|}=\lim \:\:_{x\to 0}\frac{\left(f\left(x\right)\right)}{\left|x\right|}\cdot \:\frac{\left|x\right|}{x}$ Since the one sided limits of $\frac{f\left(x\right)}{\left|x\right|}$ exist, and are both equal to 1, we have $\lim \:_{x\to 0^+}\frac{\left(f\left(x\right)\right)}{\left|x\right|}\cdot \:\:\frac{\left|x\right|}{x}=\lim \:_{x\to \:0^+}\frac{\left(f\left(x\right)\right)}{x}\cdot \:\:\:\frac{x}{x}=1\cdot 1=1$ $\lim \:_{x\to 0^-}\frac{\left(f\left(x\right)\right)}{\left|x\right|}\cdot \:\:\frac{\left|x\right|}{x}=\lim \:_{x\to \:0^-}\frac{\left(f\left(x\right)\right)}{-x}\cdot \:\:\:\frac{-x}{x}=1\cdot -1=-1$ Since the limit doesn't exist, we have a contradiction to the fact $f$ is differentiable at $0$. Therefore $f$ is not differentiable at 0. Compton scattering vs. photoelectric effect Say a photon hits some atom.  What determines whether there will be a photoelectric effect (photon is absorbed, electron is released) or whether there will be a Compton scattering (the photon is  scattered at some angle, and the electron is released with another direction)? I unlocked the 'Files' button/icon from my unity launcher and now it disappearead and I cannot restore it or get it back I unlocked the 'Files' button for the Ubuntu file manager from the unity launcher and I cannot get it back.   When I run the file manager from the dash, the icon does not appear on the launcher like it does for all other applications while they are running. I wanted to have an empty launcher when no applications are running, and just have the icons of those I am actively using there.  Any idea why I don't see it in the launcher when its running or how to lock it back? What is the current URL to create a new Google Document please? Since Google last updated their Docs the old URL does not work. Much effort has been expended on a famous unsolved problem about the .  Not surprisingly, it's called the Riemann hypothesis, which asserts:  $$ \zeta(s) = 0 \Rightarrow \operatorname{Re} s = \frac1 2 \text{ or } \operatorname{Im} s = 0 .$$  Now there are numerical methods for approximating $\zeta(s)$, but as I understand, no one knows any exact values except at even integers, which include the trivial zeroes for which $\operatorname{Im} s = 0 $.  So I've always wondered:  For the rest, how does one prove $\operatorname{Re} s = 1/2$ exactly?  (All I know that seems vaguely useful is the argument principle, which I'm not sure helps here, but I'd be happy to learn about other techniques that aren't too far advanced.)  Edit:  Looking over this again, I found out I missed the closed-form values at .  This doesn't affect the question but seemed worth correcting.  Thanks to the people who contributed. I would like to highlight specific digits in a number. Since the number is large I would like to use \num{} from . Of course I can do it manually as in the MWE below, but was hoping that there might be an easy way to use the commented out syntax to accomplish this:  Code: \documentclass{article} \usepackage{xcolor} \usepackage{siunitx}  \newcommand*{\Color}[2][red]{\textcolor{#1}{#2}}%  \begin{document}  \num{99 976}  88\,9\Color{76} %\num{88 9\Color{76}}  77\,\Color{976} %\num{77 \Color{976}}  \end{document} Why does the natural ring homomorphism induce a surjective group homomorphism of units? I'm trying an old problem here:   Suppose $n\mid m$, and I have a natural ring homomorphism $\varphi\colon \mathbb{Z}/m\mathbb{Z}\to\mathbb{Z}/n\mathbb{Z}$ defined by $\varphi(j)=j\mod{n}$. I can verify that this is a ring homomorphism, but why does it induce a surjective group homomorphism on the unit groups $(\mathbb{Z}/m\mathbb{Z})^\times\to(\mathbb{Z}/n\mathbb{Z})^\times$?  My question in particular is why is it surjective? I take $k\in(\mathbb{Z}/n\mathbb{Z})^\times$. Then there exist integers $s,t$ such that $sn+tk=1$. Since $n\mid m$, I can also write $m=na$. So multiplying through I get $sm+tka=a$. I'm lost here. How can I find a unit in $(\mathbb{Z}/m\mathbb{Z})^\times$ which maps to $k$ to show surjectivity? I have been reading Men With Brooms for a few days. I read a sentence which did not make any sense to me, so I landed here to get some help on it. I have pasted the sentence from the novel. Please go through it and let me know your valuable feedback on it.  An excerpt from the novel (Men With Brooms: A Sweeping Epic, paperback 2002, a novelization by Diane Baker Mason):     Gordon was about to walk away from the Impala when he saw it stop and his son get out. So it was real the boy had come.   As per my opinion it should have been:     Gordon was about to walk away from the Impala when he saw it stopped and his son got out. So it was real the boy had come.   I have two questions here:   Why did the writer use stop and get instead of stopped and got? As she is telling us a story which happened in the past. Let's say the writer is telling us her mind's situation and she used the present tense for it but why did she use stop and get instead of stops and gets? Do I need swap space if I have more than enough amount of RAM? From what I understand, the purpose of a swap partition in Linux is to free up some "not as frequently accessed" information from RAM and move it to a specific partition on your harddrive (at the cost of making it slower to read from or write to), essentially allowing active applications more of the "high speed memory".  This is great for when you are on a machine with a small amount of RAM and don't want to run into problems if you run out. However, if your system has 16 GB or 32 GB of RAM, and assuming you aren't running a MySQL database for StackExchange or editing a 1080p full length movie in Linux, should a swap partition be used? Trim string in JavaScript? How do I trim a string in JavaScript? That is, how do I remove all whitespace from the beginning and the end of the string in JavaScript? How to install MATLAB on Ubuntu 14.04? The script works fine if I run it with sh filename, but it ignores all the --exclude parameters if its run by cron:  #!/bin/sh TIMESTAMP=$(date +%u)  WEEK=`date +"%V"` if [ $(($WEEK%2)) -eq 0 ]; then     echo "even";     BACKUP_DIR="/mnt/backup/2_$TIMESTAMP"     mkdir -p "$BACKUP_DIR/www"  else     echo "odd";     BACKUP_DIR="/mnt/backup/1_$TIMESTAMP"     mkdir -p "$BACKUP_DIR/www"   fi  if [ $(date +%u) -gt 6 ]; then     zip -r -y $BACKUP_DIR/www/web.zip /var/www/ --exclude='var/www/\.opcache/*' --exclude='var/www/utils/phpThumb/cache/*' else     zip -r -y $BACKUP_DIR/www/web.zip /var/www/ --exclude='var/www/mycompany/files/*' --exclude='var/www/\.opcache/*' --exclude='var/www/mycompany/szamlazz/xml_szamlak/*' --exclude='var/www/mycompany/files_admin/szamlazz/*' --exclude='var/www/mycompany/files_admin/chatFiles/*' --exclude='var/www/mycompany/utils/phpThumb/cache/*' --exclude='*/backup-guard/*' --exclude='var/www/mycompany/mailer/*' --exclude='var/www/mycompany/attachments/*' fi  exit 0   The above script should create a larger backup on sunday, and a partial on weekdays, but it just zips everything. I am interested in theoretical and practical considerations. Can I use a one time pad key twice with random plaintext? I understand the basics of OTP: $|\text{key space}| = |\text{plaintext space}|$ implies perfect security, key reuse destroys this.  Cryptanalysis on the $N$-Time Pad for $N &gt; 1$ involves finding patterns in the ciphertext; this, however, all seems based on the premise that patterns exist in the plaintext (e.g. English language).  My question is: if $m_1$ and $m_2$ are two truly random strings, and they are both encrypted with the same OTP key to yield $c_1$ and $c_2$, is it possible to recover $m_1$ and $m_2$ from $c_1$ and $c_2$?  In other words: while "perfect security" (aka perfect indistinguishability) is obviously lost (constructing a distinguisher for two messages is trivial), is the plaintext still safe? How can I make a message appears on my PC when my phone is ringing? When I'm at work, I usually have a headset on my head and I am listening to music. My phone is always on vibrate to respect co-workers.  However, I don't keep the phone in my pocket because of its size, so I don't feel it vibrating.  I miss a lot of calls.  I was wondering if it's possible to forward "phone is ringing" notifications to the PC, ideally via a Bluetooth connection.  I would not mind installing a 3rd-party app on the phone or software on the PC. Find the determinant of $I + A$ $_SERVER['QUERY_STRING']; not returning full query string I'm thinking about buying the new MacBook Pro with 4 USB-C ports.  I want to attach two screens, mouse and keyboard and ethernet to the MacBook Pro while using the fewest number of USB-C ports possible.  So what I need is an adaptor with:   two DP or HDMI ports (or one DP port with daisy chaining support) two or more USB ports an ethernet port   Best case would be a hub to which all devices are connected with a single connection to the MacBook Pro, including power supply. Worst case if attaching the MacBook Pro to the devices would require me to use all four of USB-C ports.  Given the answers up to far, I can tell that:   Daisy chaining might or might not work with the MacBook Pro (since it requires DP1.2 which is supported by the graphics chipset, but it's uncertain if it's supported by the MacBook Pro itself) I can attach the monitors with two cables as a last resort, leaving me with two ports for the remaining peripherals.   What I still don't know:   Would daisy chaining work with a hub or does it require the first monitor to be directly attached to the MacBook Pro? Does some kind of hub exist supporting attachment of all listed devices with a single upstream connection to the MacBook Pro? How come if $\ i\ $ not of the following form, then $12i + 5$ must be prime?