trigger DuplicateEmailsInLead on Lead (before insert, before update) {     map&lt;String,Contact&gt;  mapOfContact = new map&lt;String, Contact&gt;();     list&lt;Contact&gt; con = [select id,email from contact];     for (contact c:con) {         mapofcontact.put(c.email,c);     }     for(lead l : trigger.new) {         if((l.email != null) &amp;&amp; (trigger.isInsert || (l.email != trigger.oldmap.get(l.id).email))) {             if(mapofContact.containsKey(l.email)){                 l.Email.addError('Email already exists');             }         }                    } }  How to write trigger &amp; handler Class for this /////////////////////// This is what i tried /////////////////////// Handler: public class Handler_checkiftheemail {     public static void TriggerHandler(List&lt;Lead&gt; newLeadList,map&lt;string,contact&gt; oldmapcontacts){         map&lt;String,Contact&gt;  mapOfContact = new map&lt;String, Contact&gt;();         list&lt;Contact&gt; con = [select id,email from contact];         for (contact c:con){             mapOfContact.put(c.email,c);         }         for(lead l :newLeadList){             if((l.email != null) &amp;&amp; (trigger.isInsert || (l.email != oldmapcontacts.get(l.id).email))){                 if(mapofContact.containsKey(l.email)){                     l.Email.addError('Email already exists');                 }                               }                        }     } }  Trigger: trigger checkiftheemail on Lead (before insert,before update) {            if(trigger.isinsert &amp;&amp; trigger.isupdate){         Handler_checkiftheemail.TriggerHandler(Trigger.new,Trigger.oldMap);     } }
I have an existing trigger which converts leads into peron accounts if the company name is blank.  Trigger AutoConvert on Lead (after insert) {      LeadStatus convertStatus = [           select MasterLabel           from LeadStatus           where IsConverted = true           limit 1      ];      List&lt;Database.LeadConvert&gt; leadConverts = new List&lt;Database.LeadConvert&gt;();       for (Lead lead: Trigger.new) {           if (!lead.isConverted &amp;&amp; lead.Company == null) {                Database.LeadConvert lc = new Database.LeadConvert();                String oppName = lead.Name;                 lc.setLeadId(lead.Id);                lc.setDoNotCreateOpportunity(true);                lc.setConvertedStatus(convertStatus.MasterLabel);                 leadConverts.add(lc);           }      }       if (!leadConverts.isEmpty()) {           List&lt;Database.LeadConvertResult&gt; lcr = Database.convertLead(leadConverts);      } }   I need to also write a trigger that stops records from coming into Salesforce if that email already exisits in a contact or an account (we use person accounts).  The issue is how do I get it working with the existing trigger (I need it to run before the trigger that converts it into a person account is run).   Is there a way to combine the two or add the functionality to create the record only if the email address doesn't already exist as a contact in the org?
Ubuntu installation is slow, why? I am currently installing Ubuntu 12.04.3. Everything was going fine until I came across this...     Installing System   It is sssooooooo close to being finished! Like 1/6 of the way there! I just wanted to know if this is normal or if something is wrong. I'm installing it through a flash drive if that helps   Also,what will happen if I press the skip button that pops up when I click Installing System? Adobe Reader and xcolor within a table breaks the line render I'm using the xcolor package to colour the top row in a table. This is displayed properly using PDF viewers such as Preview or Skim (Mac). But using Adobe Reader 10.1.3 (either Windows or Mac) doesn't display the table line properly.   But removing the colouring for the table fixes it. Here is the example that works as expected:  \begin{table} \caption{Table showing Feature 5's Functional Tests} \hspace*{-0.5in} \begin{tabular}[h!]{|p{0.6cm}|p{4cm}|p{5cm}|p{4cm}|p{1.5cm}|} \hline {\bf Test ID } &amp; {\bf Task } &amp; {\bf Expected} &amp; {\bf Actual} &amp; {\bf Outcome} \\ \hline    5.1 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline    5.2 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline    5.3 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline    5.4 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline \end{tabular}  \end{table}   And here is the example with a coloured row:  \begin{table} \caption{Table showing Feature 5's Functional Tests} \hspace*{-0.5in} \begin{tabular}[h!]{|p{0.6cm}|p{4cm}|p{5cm}|p{4cm}|p{1.5cm}|} \hline \rowcolor{gray!25} {\bf Test ID } &amp; {\bf Task } &amp; {\bf Expected} &amp; {\bf Actual} &amp; {\bf Outcome} \\ \hline    5.1 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline    5.2 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline    5.3 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline    5.4 &amp; Something &amp;  Something &amp; Something &amp;  Success \\ \hline \end{tabular}  \end{table}   Removing the \rowcolor{} command replacing it with \cellcolor{} creates the same view. Any idea how to fix this?  I've tried printing it out of Adobe and the lines print fine, but as this will be read on as a soft copy it's pretty important. .  Any idea how to fix this? Using modulo operation to draw graph I was reading a blogpost here:  () One thing that threw me off was that after the first four large displayed equations, there is the statement &quot;it is sufficient to prove that if the theorem holds for $n=m+1$, then it holds for $n=m$.&quot; How is this type of induction valid? I browsed around for things like backward induction, reverse induction, and Cauchy induction, but couldn't find a justification for how this is valid. With the usual forward induction of verifying a base case and proving $P(n)\implies P(n+1)$, it's easy to intuitively understand how induction will show a property holds for all natural numbers (or at least starting at the base case). But with this reverse induction, it seems to me that if you prove $P(m+1)\implies P(m)$, then if you were able to verify a specific case like $P(15)$, then you would only know it's true for numbers up to $15$. How does it actually prove the property for all naturals? My Logitech G5 Laser mouse has 9 buttons but it's SetPoint software only allows 5 of them to be used as "mouse buttons" and the remaining 4 can only be assigned special windows functions (Forward, Back, Cruise Up, etc) or Keystroke Assignments.  Many of the games I play will take up to 10 "MOUSE BUTTON" inputs for in-game actions but wont recognize the remaining 4 buttons even when assigned keystroke assignments.  Is there a way to make these last 4 buttons "Generic Buttons" as well as buttons 3,4,and 5? (1 is left click and 2 is right click).  My other question is if the above is not possible, maybe I can use AutoHotkey to remap keystrokes as assigned by my SetPoint software to mouse button commands?  If so how? What font is "z" in "z-score"? Proof of one inequality $a+b+c\leq\frac{a^3}{bc}+\frac{b^3}{ca}+\frac{c^3}{ab}$ How to prove this for positive real numbers? $$a+b+c\leq\frac{a^3}{bc}+\frac{b^3}{ca}+\frac{c^3}{ab}$$  I tried AM-GM, CS inequality but all failed. Does a gluon have mass or not? I was under the impression that gluons had no mass. Then Wikipedia throws this curveball:  Mass: 0 (theoretical value) &lt; 0.0002 eV/c2 (experimental limit)  Which one should a poor soul go by? If the theoretical value just the one that people &quot;thought&quot; was right, until they found out the truth, or is the experimental limit(?) an impossibility that still has not been explained? Or something third? I almost always want the profile correct applied, but it's an extra step. Any ideas on how to apply these automatically? How to show that when the linear transformation $\Phi =\psi \circ \phi : E \rightarrow G$ is injective, then $\phi$ is also injective? How to show that when the linear transformation $\Phi =\psi \circ \phi : E \rightarrow G$  (where $\phi : E \rightarrow F$ and $\psi : F \rightarrow G$) is (1) injective, then $\phi$ is injective and when (2) $\Phi$ is surjective, then $\psi$ is also surjective ?  I've tried to prove it by the definition of injection and surjection, but I'm not convinced myself by it.  For example, in the first case :  If $\Phi$ is injective, $\forall g \in G$, we have $0$ or $1$ $e \in E$ such as $\Phi(e)=g$.  $\Rightarrow \Phi(e) = \psi(\phi(e)) = \psi(f) =g$.   So $\forall f \in F$, we also have $0$ or $1$ $e \in E$ such as $\phi(e)=f \in F$.   $\Rightarrow \phi$ is injective.  Is this right or did I prove nothing at all ? I think it is easier to convince myself/ to understand with surjectivity but still.. I have just installed 12.04 LTS on my laptop and I'm kinda new in this. I am required to write some program in Fortran 77 and I need a Fortran 77 compiler. I have tried installing g77 as described in the Ubuntu website but was unable to do so. I have typed in the following in terminal:  sudo apt-get install g77   and get the following:  Reading package lists... Done Building dependency tree        Reading state information... Done Package g77 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'g77' has no installation candidate   May I know what is the problem? I have tried searching g77 in the software center but apparently it is not there. Does this mean it is not available for 12.04?  I'm currently using an Asus K43S laptop with Intel Core i5-2450M processor and my Ubuntu is installed alongside Windows. How do I remove log out, reboot, and shut down from GNOME shell application list? I’m new to Ubuntu. I don't know where the log out, reboot and shut down icons in my application list came from. I just need to remove this from here. I want to keep Ubuntu but remove Windows. How can I pass a class member function as a callback? I'm using an API that requires me to pass a function pointer as a callback. I'm trying to use this API from my class but I'm getting compilation errors.   Here is what I did from my constructor:  m_cRedundencyManager-&gt;Init(this-&gt;RedundencyManagerCallBack);   This doesn't compile - I get the following error:      Error  8 error C3867: 'CLoggersInfra::RedundencyManagerCallBack': function call missing argument list; use '&amp;CLoggersInfra::RedundencyManagerCallBack' to create a pointer to member   I tried the suggestion to use &amp;CLoggersInfra::RedundencyManagerCallBack - didn't work for me.   Any suggestions/explanation for this??  I'm using VS2008.  Thanks!! Subscribe to tags I am interested in? How do I subscribe to the tags that I am interested in?  I like to get notified via email or so, when someone asks new questions or if someone responds to my questions. If the electric field is the gradient of the potential, then can we say that whenever potential is zero, the electric field is zero? For example, in a dipole, at the center of the two charges making up the dipole, the potential is zero but the electric field is non-zero. But if $E = -\operatorname{grad}V$, then why is $E$ not zero?  Another example: In the case of two positive charges, the electric field is zero at the mid-point of line joining them, but potential is non-zero. What am I misunderstanding here? How can I make calls related to a case display in its Chatter feed? I am using the Service Console in Lightning Experience, and using the Chatter Feed component on the Case layout to display updates to the Case.  If I use the "Log a Call" Quick Action from the Chatter publisher, these calls are displayed in the Chatter feed.  This is the desired behaviour.  However, if I insert a Log a Call record related to the Case any other way - e.g. using the Developer Console, or my CTI system's custom components - the call does not display in the feed.  If I query the record, it looks exactly the same as the record that is created with the Quick Action.  It just seems that the Chatter post is never made in this situation.  I have checked my Feed Tracking settings:   Task has Enable Feed Tracking and Subject checked Case has All Related Objects checked   How can I enable calls created with a custom component (part of a CTI system) to display in the case feed? I'm fitting a multiple linear regression model between 4 categorical variables (with 4 levels each) and a numerical output. My dataset has 43 observations.  Regression gives me the following $p$-values from the $t$-test for every slope coefficient: $.15, .67, .27, .02$. Thus, the coefficient for the 4th predictor is significant at $\alpha = .05$ confidence level.  On the other hand, the regression gives me a $p$-value from an overall $F$-test of the null hypothesis that all my slope coefficients are equal to zero. For my dataset, this $p$-value is $.11$.  My question: how should I interpret these results? Which $p$-value should I use and why? Is the coefficient for the 4th variable significantly different from $0$ at the $\alpha = .05$ confidence level?  I've seen a related question, , but there was an opposite situation: high $t$-test $p$-values and low $F$-test $p$-value. Honestly, I don't quite understand why we would need an $F$-test in addition to a $t$-test to see if linear regression coefficients are significantly different from zero. Building a version of ubuntu without any USB functionality let $\gamma$ be a closed continuosly differentiable path in the upper half plane  not passing through $i$. What are the possible values of the integral $$\frac{1}{2\pi i}\int_{\gamma}\frac{2i}{z^2+1}dz$$ well the integral can be broken like  $$\frac{1}{2\pi i}\int_{\gamma}\frac{2i}{(z+i)(z-i)}dz=$$  $$\frac{1}{2\pi i}\int_{\gamma}\frac{dz}{z-i}dz-\frac{1}{2\pi i}\int_{\gamma}\frac{dz}{z+i}dz=$$ by Cauchy Integral Formuale $$f(i)-f(-i)$$,so the second integral is $0$ as it is analytic in the upper half plane, but the first integral iss just $n(\gamma,i)$, which iss the windding number of $\gamma$ around $i$ what more I can say? Thank you.