I am using SingleEmailMessage api for sending emails. I want to know the email limit quota usage, so that I can prevent further exceptions. Is there any way to know the quota usage in apex, so that I can handle exception with ease.
my email limit is exceeded after sending 10-12 emails..what could be the problem..as i have seen the limit is 1000 emails/day.i am not able to find out what could be the problem..Can some give me some suggestions. As i also know we can send 10 emails in a single transaction.I am sending emails in a batch class.  I am calling this batch class on button click and filling emailList with emailsId's.                      String query='Select id from Lead';//No use of this query                     Batch_send_emails bse=new Batch_send_emails();                     bse.query=query;                                                         bse.resendEmails=emailList;                     database.executebatch(bse);           **Batch Class**           if(!resendEmails.isEmpty())           {               for(String s:resendEmails)                {                   emailsLeads.add(s);                }           }           Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();         mail.setToAddresses(emailsLeads);        // mail.setCcAddresses(ccAddresses);         String subject='GoToMeeting Invitation Details for '+subject;         String body='test';          mail.setHtmlBody(body);          mail.setSubject(subject);         Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });          }
Why my DAC works without GND and VCC? This is the most interesting thing I have seen! I have built a  that sends data (D0-D7) to a DAC (ADV2175). The design worked fine and I just have a low frequency alias noise (). This noise was present on all my ground planes (This is in prototyping stage and that's not unexpected from the test PCB).  I started tracing the noise path by disconnecting wires to see when the noise is gone. Surprisingly even after disconnecting all VCC and GND connections (+ all VREF and logics gone to 0 or 1) the noise was present yet. The more unexpected behavior is when the DAC is just connected to DATA port+ CLK pin (all coming from the source FPGA, NO VCC or GND), it continues working and a sine wave is produced (but with the same noise)!!!  First I thought it may receive its VCC/GND form the logic 1/0 fed into it but if it was correct, it should not have produce 0x00 and 0xFF levels, but it makes those levels correctly (I changed 0xFF data stage to another level and a notch appeared on top of the waves. this shows it can build oxFF correctly).    This is a big challenge for my PCB design, as if this device really takes its GND from the data port, instead of the dedicated pins, I will have a hard time for designing a reliable ground plane for it (the return voltage should go back to a logic noisy environment and analog-digital ground plane isolation may be impossible).  Can anyone explain what is happening there? So I was taught that:  Kinetic Energy (of electron) = Energy (of photon) - Ionization Energy  If E(photon) = IE, then KE=0 of the electron.   What does this physically/theoretically mean?   My current thoughts/interpretation is that enough energy/force is applied to ionize the electron so it is 'sufficiently far' from the atom, and then I guess it just moves with whatever speed it is moving at with natural kinetic laws, since no more energy/force is being applied....?  Any clarifications would be greatly appreciated, thanks in advance. Where can I find good ConTeXt documentation Fitting a plane to a set of points in 3D using PCA I am trying to estimate a midplane of a 3D model using the midpoints of paired landmarks, in order to reconstruct missing data (midplane refers here to the middle/saggital plane of the cranium which cuts the skull into two symmetrical halves, left and right).  I therefore need to estimate a plane from 27 points in 3D. I need to get the equation of the plane as $$ax+by+cz=d.$$  I have looked into orthogonal regression and principal component analysis (PCA) as methods, however I didn't take maths past A-levels and am struggling. I know I can supposedly use the eigenvectors to get the equation of the plane of best fit, but need someone to explain exactly how. I am using R for the PCA but am not great at R either.  Alternatively, if there's a better way to estimate the plane I would be glad to hear it! Question Close Updates This week we rolled out a series of changes to  of the question close workflow.  You can read more about the details of these changes .    For context, the overall effort to improve the question close experience will be optimized for Stack Overflow. Given Stack Overflow’s scale, many of the pain points we hear about with question closing and reopening are unique to Stack Overflow and won’t make sense for other network sites. However some  changes are general improvements that should improve usability and guidance overall. Wherever possible, we plan to roll these changes out network wide as well. Any time we roll out a change network wide, we’ll make sure to cross-post here. This first phase is being rolled out to the network and is why I’m posting today.  Let us know if you run into any issues or have questions regarding the network here. Add/Delete table rows dynamically using JavaScript In the current era of cricket, we see batsmen using switch hits to play a ball. That is, while playing a ball they change their batting side (left to right handed and vice versa) just before the ball comes to them.  My question is, can a bowler bowl a switch ball? Meaning, can a left hand bowler bowl right handed to a batsman? If it is not permitted, then is it not unfair to the bowlers that batsmen can change their batting style but not the bowlers? Or are there are any rules against a switch hit? Can we clarify to the OP that their question is not yet closed and the duplicates are only suggestions? I keep seeing custom flags in the queue from question askers who are incredibly irritated because there is a big, prominent box at the top of their question. It's just a list of other questions which may have the answer they desire, and is only even displayed to them because the question is not closed yet.  This question may already have an answer here: [list]  But to an ordinary user, it is not at all clear that the box is only shown to them, or that it will go away on its own if their question never actually gets closed. Could the text for this notice be altered to make it more clear that:  They are just suggestions for the person to view. Potentially if they agree with one, they should vote to close their own question as a duplicate of it.  Their question is not closed yet. If they disagree with the duplicates suggested, they should clarify their question and explain why it's not a duplicate.   I was thinking of an altered wording such as:  You might be able to find an answer to your question here: [list] If those answers do not fully address your question, please [edit your question] to clarify your exact problem.  I went with a more direct wording for the bolded title. Since the notice is only displayed to the asker, it makes more sense to talk directly to them in the message rather than making it feel like it's supposed to be addressing the entire audience of the site. Emphasize that only that person is seeing it by talking to them. It would also be helpful to append a &quot;More info&quot; link at the end of the message that links them to some further documentation about duplicates, and explains how the notice works - particularly that it will go away eventually or change to a proper duplicate notice if the question does get closed. Probability that a k digit number does not contain certain digits Can you enter the Schengen area with a UK visa? A word for someone who you share a half-sibling with This is probably best explained with an example.  Alice and Bob have a child, Erin. Bob and Carol have a child, Frank. Carol and Dan have a child, Grace. Clearly, Erin and Frank are half-siblings, because of their father, Bob. Similarly, Grace and Frank share their mother, Carol.  Erin and Grace have no parents in common, and are thus not half-siblings. However, is there a term for their relation? How to make itemize/enumerate/description environment robust to missing \item elements? Is there any way to make LaTeX tolerate empty itemize/enumerate (i.e. no \item)?  Specifically, I would welcome any package/elegant hack that would gracefully "cancel" a list if no elements are found (instead of firing up a Latex Error).  Before jumping to the obvious answer (which I expect would be something along the lines of "don't use itemize if you don't have items to put in" ;)) please consider my use-case:   I want to format remotely stored elements (say, bibliographic items), which I can only access as an XML file.  &lt;elems&gt;   &lt;bibelem&gt;&lt;title&gt;Cool result 1&lt;/title&gt;&lt;author&gt;joe&lt;/author&gt;&lt;/bibelem&gt;   &lt;bibelem&gt;&lt;title&gt;Cool result 2&lt;/title&gt;&lt;author&gt;jim&lt;/author&gt;&lt;/bibelem&gt; &lt;/elems&gt;  I have a python script that downloads/parses the XML and outputs its content in a file bib.tex as a list of Latex macros-decorated data  \BibElem{Cool result 1}{joe} \BibElem{Cool result 2}{jim}  Now, I want to grant the end-user complete control over the styling of her/his produced document, so the intended usage within Latex is something like  \documentclass{article} \begin{document}   \newcommand{\BibElem}[2]{\item {\em #1} by {#2}}   \begin{itemize}     \input{bib.tex}   \end{itemize} \end{document}    The rationale behind this design choice is that the user should be restricted as little as possible in her/his styling choices. For instance, the user may either want to display the bibelems within a list as shown in the example, or may prefer a fancy-formatted tabular. On the other hand, the user should design the latex document once, and should be able to run it regardless of the amount of data produced by the source.  Therefore, the python script cannot make any assumption regarding the context in which its latex product will be included, and it should be up to the user to deal with empty bibliographies, i.e. with empty lists. How could one possibly do that?  Update: Werner proposed a nice solution that redefines the list environment to make Latex oblivious of the fact he is currently in a list. However, this only seems to work if the empty list is the last list in the document, as revealed by the following mwa:    \documentclass{article} \makeatletter \newenvironment{myitemize}   {\itemize}   {\@newlistfalse\enditemize} \makeatother \begin{document}   % Empty Itemize   \begin{myitemize}   \end{myitemize}   % Next non-nested itemize environment (can be itemize/enumerate/description)    \begin{myitemize}     \item Arghh!   \end{myitemize} \end{document} A financial planner treated us in a dismissive fashion and I want to say that he "gave us the back of his hand" but that phrase doesn't seem to have the meaning of dismissive. Does it or is there a similar idiom? User logout on browser / tab close How to modify Drupal user's cookie so the cookie is not available anymore after a predefined time or when the user close his web browser or close all of the websites pages open in tabs ?  After some online searches i found that by setting the cookie lifetime to 0 should create temporary cookies that would be deleted once the browser is closed:  I first tried by modifing some ini_set() values in the settings.php :  ini_set('session.cookie_lifetime',  0); ini_set('session.gc_maxlifetime',   0);   I created a php.ini file located at the drupal site root, containing:  session.cookie_lifetime = 0;   But it does not work on my test site. Any ideas? I am trying to integrate one Salesforce org to other org by using Oauth setup, I wanted to use  use consumer key and consumer secret key in my REST class to connect with the org, after connection part completion, I want to access Get(), Put(), Post(), etc. Including the ability to set Oauth and Authorization headers needed for Salesforce Rest API calls.  Actually I'm new in REST implementation so can you please explain me by using code samples. So in the first 5 or 6 books, it was very clear that the wand chooses the wizard and the power/level of the spells the wizard produces is based on the knowledge and skill of the wizard.  This is referenced by people constantly being telling Harry that he wasn't skilled enough to perform certain spells, or Bellatrix telling Harry that he needed to mean the Cruciatus curse for it to be effective.  However, in the 7th book, this entire idea is changed to the wand being the thing that's powerful and regardless of the wizard's/witch's skill or knowledge, he/she could still perform a very advanced spell if it's something the wand could handle.  Goyle accidentally creating a fire serpent is something that instantly comes to mind from the movies(I don't remember if that happened in the book).  So, my question is, what actually holds the power, the wizard/witch, or the wand? Apply the latest Service Pack and Cumulative Update What if the answers of a historical locked question become obsolete? Statements equivalent to the Axiom of Choice The Axiom of Choice reads:     The product of a collection of non-empty sets is non-empty.   As you know well, this axiom is equivalent to many other statements. A few examples (probably the most known) are the following:   Zorn's lemma: Let $(P,\ge)$ be a poset in which every chain has an upper bound. Then $P$ has a maximal element.   This is used in a number of different places to prove very powerful theorems. A couple of examples I can think of right now are: the proof that every ring has a maximal ideal (commutative algebra) and the  (functional analysis).   Well ordering theorem: Every set can be well-ordered (i.e. it admits a total order such that every subset has a least element). Tychonoff's theorem: Every product of compact topological spaces is compact.   This is used for example in the proof of  (again functional analysis).   gives various more. Among them:   Tarski's theorem: If $A$ is an infinite set, then there is a bijection $A\to A\times A$.   (As @Wicht dutifully commented, Tarski's theorem is the name given to the implication $|A|=A\times A \Rightarrow$ Axiom of Choice, while the other implication was known before the proof of this fact by Tarski.)   Every vector space has a basis.   My question is: what are other useful statements which are equivalent to the axiom of choice? Where are they used, and to prove what?  P.s.: By "useful statements" I mean either statements which are important theorems by themselves (as Tychonoff's theorem) or that are directly used in (simple versions of) the proof of important theorems (as Zorn's lemma). Ping faster than light I just discovered very strange thing while testing my internet connection. My ping is smaller than it should be. For example ping time to Arizona State University is about 14ms.  eryk@eryk-pc:~$ ping www.asu.edu PING www.asu.edu.cdn.cloudflare.net (104.16.51.14) 56(84) bytes of data. 64 bytes from 104.16.51.14: icmp_seq=1 ttl=60 time=13.8 ms   I'm living in Poznań in Poland so my distance to Arizona State University in a straight line (very optimistic assumption) is about 10000 km. Considering the fact that ping time is a time for two directions (to the target and back to home). So my ping packet have to cross 20000 km distance. Speed of light is 300 000 km per second that is 300km per millisecond. So the smallest possible time to ping Arizona State University with my packet travelling at a speed of light is  20000/300=67ms   I have noticed similar results for servers located in Australia and some other States of America. Is my internet connection five times faster than light?