I have an account xyz and I need to calculate the sum of all related opporunities of this account and if the amount is less than 2000 rating should come '1' , if its less than 3000 rating should be '2' and less than 5000 rating should be '3'.. I am trying this way..  trigger OppoSum on Opportunity (after insert,after update)  {     Set&lt;Id&gt; accIdSet = new Set&lt;Id&gt;();      List&lt;opportunity&gt; oppList = new List&lt;opportunity&gt;();     for(opportunity o : trigger.new)     {         accIdSet.add(o.accountId);     }      map&lt;Id,Account&gt; mapAcc = new map&lt;Id,Account&gt;([Select id, name,                                                          (Select id From Opportunities)                                                     From Account Where Id IN : accIdSet]);      for(opportunity o : trigger.new)     {         Account acc = new Account();         acc.Id = mapAcc.get(o.accountId).id;         for(integer i =0;i&lt;acc.opportunities.size();i++)         {             acc.Oppo_Amount__c = Oppo_Amount__c + o.amount;         }         if(acc.Oppo_Amount__c&lt;2000)         {             acc.rating = '1';         }         else if(acc.Oppo_Amount__c&lt;3000)         {             acc.rating = '2';         }         else(acc.Oppo_Amount__c&lt;5000)         {             acc.rating = '3';         }     } }
I am not able to sum all the opportunities under the account ?  How will I do that?  What I have to use in this to run the trigger? Is it possible to create because opp. is child and account is parent ?  trigger sumAllopptyAmtAccount on Account(before insert) {     Set &lt; ID &gt; AccID = New Set &lt; ID &gt; ();     if (Trigger.isInsert)         for (Account oppAc: trigger.New) {             AccID.add(oppAc.AccountID);         }     List &lt; Account &gt; acc = [select id, SumAll_Opprty__c from Account where id in: a.AccID];     List &lt; Opportunity &gt; opp = [selece id from Opportunity where AccountID in: a.AccID];     for (Account a: acc) {         a.SumAll_Opprty__c = con.size();     } }
Extended support for Ubuntu 12 Not sure if there is a better communication mechanism for asking this question. Ubuntu 12 is EOL April 2017. Do corporations have any option to extend support on 12?  Thanks How do I add a notification for process completions How can I add a notification of some sort (like playing a .wav file or creating a pop-up on the status bar) when a process finishes. For example, I am compiling a program that takes a couple of hours to finish. I would like to hear/see some sort of message when it completes compiling. Is there a tool for doing this (like tying an alarm program to the pid of a process) or something like that? Evaluating $\int_{0}^{1}\frac{x-1}{(x+1)\ln x} dx $ Evaluate the following integral $$\displaystyle I=\int_{0}^{1}\frac{x-1}{(x+1)(\ln x)} \mathrm{d}x $$ My work: I tried it by letting $\displaystyle I(a)=\int_{0}^{1}\frac{(x-1)x^a}{(x+1)(\ln x)} \mathrm{d}x$ and then $\displaystyle I'(a)=\int_{0}^{1}\frac{(x-1)x^a}{x+1} \mathrm{d}x$. Now $\displaystyle I'(a)=\int_{0}^{1}x^a \mathrm{d}x-\int_{0}^{1}\frac{2x^a}{x+1} \mathrm{d}x$ Now if $\displaystyle J(a)=\int_{0}^{1}\frac{x^a}{x+1}\mathrm{d}x$ , then by applying integration by parts, we get the reccurence relation $J(a)+J(a-1)=\dfrac{1}{a}$ and we can solve it then, but the thing is, we neet to find $I(0)$ ,so even if we compute $J(a)$, it wouldn't be defined at $0$ and so would $I(a)$, then how do I find $I'(a)$ by other method? I also tried the substitution $x \to \frac{1}{x}$, which yields $\displaystyle I=\int_{1}^{\infty}\frac{(x-1)}{(x+1)(\ln x)} \mathrm{d}x$ and when I saw their graphs, it clearly doesn't seem that the area under the graph of this function from $0$ to $1$ and from $1$ to $\infty$ are equal. I would appreciate if someone could  continue from my method and other solutions are also welcomed... Selecting a front derailleur: parameters The spec sheet for the Shimano Alivio FD-M430 front derailleur contains a number of points that I don't understand.   What does "Maximum capacity: 22 teeth" mean? Why are "Top gear teeth" constrained to "44/48T"? Is there anything wrong with 46? What is "Cable Routing: dual-pull type"? And most puzzling, what is "Chain Stay Angle  63-66 / 66-69" and how do I measure mine? Body Diode of a MOSFET So for some MOSFETs, specially with Power MOSFETs, the body diode is a flyback diode that (as far as aI can tell) can be conveniently added to the MOSFET's bulk as there already PN junctions (correct me if I'm wrong).  I've looked at the datasheet of a Power P-MOSFET and it has parameters like "Internal Source Inductance" and "Internal Drain Inductance". So, is the build up of reverse voltage on the source and drain sides, when said MOSFET is suddenly turned off, a behavior intrinsic to (at least some) MOSFETs? Or are these from the rest of the circuit, say inductive loads? How to make files protected? How to make some file that contains crucial data protected? For instance, suppose I have some files that are important, is there any method or strategy to make these kind of file more protected on Ubuntu? I even want to make some files ask for a password whenever someone tries to open it. Does it affect the version of Ubuntu in terms of security policy? May I use any encryption algorithm externally? Regards. Does there currently exist a free online service that accepts a file, hashes it, takes an authoritatively chosen timestamp (from one or more time services), signs these and sends this signed message back? E.g. a digital notary, but only with regards to the timestamp and not the validity of the content as legal notaries might be obligated to guarantee.  Such a service might have an extremely simple API: Simply wget http://service/&lt;checksum&gt; and receive a signed message containing one or more timestamps and the checksum. The emphasis would be on the type of authority who might make such a service.  Edit: Although the original question did not emphasise the following, the Bitcoin-based timestamping services provided below do not rely on one authority, but rather the entire Bitcoin network. They can be seen as tamper-proof and verifiable without the help of the service that helped you sign it! Here's the context       "Her heart leaping into her throat, she tiptoed into the salon. Such was her astonishment at seeing Mike chatting with her boss that she leaned against the wall, incapable of making another move."   Is this a phrase or what? Could it be used in other forms as well? I started learning Bash a couple of days ago.  I'm trying to obtain an exit status of grep expression into a variable like this:  check=grep -ci 'text' file.sh   and the output that I got is   No command '-ic' found   Should I do it with a pipe command? Potentiometer for two 12V/1.1A fans in parallel Let $I$ and $J$ be ideals of a Noetherian ring $A$. If $JA_P\subseteq IA_P$ for every $P\in \operatorname{Ass}_A(A/I)$, then $J\subseteq I$.   I'm reading Matsumura's Commutative Ring Theory book on my own. This is exercise $6.4$ in that book, and I fail to prove it. Could you help me with this? Thanks in advance. A water pipe from sea level to beyond the atmosphere If a pipe extended from just above the ocean floor to outside the atmosphere, would water be sucked up it by the vacuum beyond the atmosphere? If a hole was made in the pipe, above sea level, how would that affect the flow of water? Would it stop it completely? I'm stuck on a question which asks to prove that any continuous integer-valued function of a real variable is constant. In my lecture notes we are told that a map is continuous if the preimage of any open set is open.  How do I use this to answer the question? A full answer would be greatly appreciated as I can't seem to figure out how to solve it in my  notes, in analysis books or anywhere online. Finding minimum bounding extent of given pixel value within raster? "Which" vs. "what" — what's the difference and when should you use one or the other? Most of the time one or the other feels better, but every so often, "which" vs. "what" trips me up.   So, what's the exact difference and when should you use one or the other? When is it appropriate to create an entity instead of a new content type? What is the benefit to creating new entity types over just building a new content type?    It seems a bit overkill to do all of the custom coding that is required to create a new entity when you have all of the CRUD and Views functionality already built into content types. Bind a key for multiple units to use the same spell Is there a way for me to bind a key that will allow multiple units in my control group to all use the same spell at once?  For example, if I have 3 centaurs as chen, and I have them all selected. Can I press one key to make them all warstomp at the same time?   Or if I have 3 familiars as Visage. When I have all three selected, is there a button I can press to have them all stun at the same time? Find the inverse of a Trig Matrix I don't have a clue of what's going on. We haven't learn this in class so I need all the help possible. The more detailed of an explanation, the better. Thanks in advance. The only info I have is that this matrix is Orthogonal. Which means I know the answer, just don't know how to get it.  \begin{bmatrix}        \cos\theta &amp; -\sin\theta \\        \sin\theta &amp; \cos\theta       \end{bmatrix} Texture is missing in Cycles? Because I am pretty new to blender I watched the tutorial  from BlenderCookie.com.  I loaded  onto a sphere but then in all views the texture is just some kind of blurry with no details. How to calulate mosfet response time with load? I would like to calculate the response time of a PMOS circuit and of the circuit  Could you tell me how to do it?    I'm using this transitor.   I tried to use the rise time of the PMOS to find it can switch (and i don't know if that's the good way), but I don't now the results with the load. CL en RL. I assume CL at t=0ms is equal to 0V. I tried to use dv/dt, but I failed VIN1 = 28V. VCMD is a command  Thanks.  edit: I made a mistake. The Zener is also connected to the source. Sorry