I have requirement like to display related records related to leads with sic code starts with.So i filtered with using Like operator but i am getting exception 101 exception.But i am not able to bulkify below code.  how to handle in this case.      public class LeadController      {         public String CurrentId;         public List&lt;Opportunity&gt; newopplist{get;set;}         public List&lt;Opportunity&gt; listopp{get;set;}          public LeadController(ApexPages.StandardController controller) {          CurrentId=ApexPages.currentPage().getParameters().get('id');         }          public void search()         {             set&lt;String&gt; cityset=new set&lt;String&gt;();             Map&lt;String,String&gt; citymap=new Map&lt;String,String&gt;();             Map&lt;String,String&gt; statemap=new Map&lt;String,String&gt;();             Map&lt;String,String&gt; Siccodes=new Map&lt;String,String&gt;();             List&lt;Opportunity&gt; newopplist=new List&lt;Opportunity&gt;();             for(Lead ld:[Select Id,City,State,SIC_Code_1__c from Lead where Id=:CurrentId ])             {                 // cityset.add(ld.City);                 if(ld.City &lt;&gt; null)                 {                     citymap.put(ld.City,ld.City);                 }                 if(ld.state &lt;&gt; null)                 {                     statemap.put(ld.State,ld.State);                 }                 if(ld.SIC_Code_1__c &lt;&gt; null)                 {                 Siccodes.put(ld.SIC_Code_1__c, ld.SIC_Code_1__c);                 }             }             newopplist=[Select Id,Name,Account.name,Number_of_Units__c,StageName,account.SIC_Code__c,Type,                         Billing_City__c,Billing_State_Province__c,account.SIC_Industry_Name__c,                         account.No_of_active_units__c from Opportunity where StageName='Closed Won' ];             listopp=new List&lt;Opportunity&gt;();             for(Opportunity opp: newopplist)             {                           if(!Siccodes.isEmpty())                 {                     Set&lt;String&gt; codes = new Set&lt;String&gt;();                     for(String code:Siccodes.keySet())                     {                         codes.add(code + '%');                     }                     listopp=[Select Id,Name,StageName,Account.name,Number_of_Units__c,account.SIC_Code__c,Type,                              Billing_City__c,Billing_State_Province__c,account.SIC_Industry_Name__c,                              account.No_of_active_units__c from Opportunity where account.SIC_Code__c                               LIKE :codes and StageName='Closed Won' ORDER BY account.No_of_active_units__c Desc Limit 10];                                      }        } }   I am hitting limits because of this query as per debug logs.     Select   Id,Name,StageName,Account.name,Number_of_Units__c,account.SIC_Code__c,Type,                                    Billing_City__c,Billing_State_Province__c,account.SIC_Industry_Name__c,                                    account.No_of_active_units__c from Opportunity where account.SIC_Code__c                                     LIKE :codes and StageName='Closed Won' ORDER BY account.No_of_active_units__c Desc Limit 10
A general question asked from time to time on stack exchange is question of trigger bulkification.  Therefore I have 2 questions:   Which best practices are you using? What is the best way to handle updates of more than 200 records? (In case of more than 200 records the trigger is executed more than once.)
Which of the following two sentences is correct?  He must decide who to be. He must decide whom to be.  I can think of arguments for both sides, but I'm not sure. To elaborate, is who(m) the object of decide, the subject of be, or the object of be? Does the infinitive form of be have any bearing on the answer? And is there anything else to consider about the position or role of who(m) in this particular sentence that would inform the answer? The answers to the linked question  say to &quot;substitute he and him for who and whom.&quot; However, that doesn't give a clear answer in this context, because neither of those pronouns sounds right: &quot;He must decide to be he&quot;? &quot;He must decide to be him&quot;? Normally we'd use a reflexive pronoun here (&quot;He must decide to be himself&quot;) and it's not clear what case that corresponds to. dpkg: error processing package mysql-server (--configure) In MTG, what happens when a player loses in multiplayer? In Magic: The Gathering, the rules for a player losing in a multiplayer game are quite complex, so I'd like to try to understand them by example. I would be happy to ask each of these situations as a separate question if that is preferred, but they all seem related, and I would love to have one place to look up all of these answers.  Let's say I'm playing with two friends, Bob and Chloe, in a simple free for all. Unfortunately, I lose. When I lose, suppose the following:   I controlled an  which has exiled Bob's , does he get his bear back? I have a  on the stack targeting Chloe, does Chloe take the 2 damage still? Earlier in the turn I cast  to prevent damage to one of Bob's . If it later takes 3 damage, will that damage be prevented? Something I controlled gave Bob a 1/1 soldier token. What happens to the token? Something Chloe controlled gave me a 1/1 soldier token. What happens to the token? I had a  enchanting one of Bob's army of . What happens to the bear? I had also played  on Bob's final . What happens to the last bear? Chloe had  my . What happens to the Clone? Are there any other situations specifically addressed by the rules? I am using XeTeX and have the following short document:  \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amsthm} \usepackage[MnSymbol]{mathspec} \usepackage[no-sscript]{xltxtra} \defaultfontfeatures{Mapping=tex-text} \setallmainfonts{Minion Pro}  \begin{document}  $\phi, \varphi, \delta \ldots A \vee B$  \end{document}    Now no matter what font I am using the punctuation marks in math mode (commas, dots, \ldots etc.) come out in Computer Modern. Is there a way to change this? What is the difference between the two "worlds" when going thru the day/night wormhole at the altar? What formats supporting animation are suitable for the web? What formats supporting animation are suitable for the web and what are the pros and cons of each. Why can rm remove read-only files? If I create a file and then change its permissions to 444 (read-only), how come rm can remove it?  If I do this:  echo test &gt; test.txt chmod 444 test.txt rm test.txt   ...rm will ask if I want to remove the write-protected file test.txt. I would have expected that rm can not remove such a file and that I would have to do a chmod +w test.txt first. If I do rm -f test.txt then rm will remove the file without even asking, even though it's read-only.   Can anyone clarify? I'm using Ubuntu 12.04/bash. How do you debug PHP scripts? How do you debug PHP scripts?  I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful.  What is the best (in terms of fast and easy) way to debug in phpStorm or any other IDE? Embed data in a C++ program Differences among Doctoral Degrees/titles What is approximate error of Pythagorean Theorem vs. Haversine Formula in measuring distances on sphere at various scales? Many people when first trying to calculate distances between two longitude / latitude pairs  ask if Pythagorean theorem works as an appropriate distance function.  Most often people answer "no, the Pythagorean theorem only works on a 2D Euclidean plane." Rarely, however, do people mention the effect of scale and location on the sphere on how inaccurate the Pythagorean theorem is.  The basic idea being at very small scales, the surface of a sphere looks very much like a plane. At very large scales, it distances along the surface are more curved and therefore the difference between the incorrect Pythagorean Theorem and the correct Haversine Formula is greater.  Does anyone know a formula or rule of thumb that tells you the difference between the two distance measures based on the scale of the distance you are trying to measure?   I think having this explicitly would help in:   explaining why the Pythagorean Theorem isn't perfect; and in letting people who are looking for more "rough" distances know when Pythagoras actually will serve their purposes. Default class inheritance access Can infinitely many primes lie over a prime? Column and row padding in tables VMware Linux Server -- how can you tell if you are a vm or real hardware? An interesting question.  I have logged into a Linux (most likely SuSE) host.  Is there some way that I can tell programmatically that I am a VM host or not?    Also assume that the vmtools are not installed. Why are there $1 / 1.602176634 \times 10^{-19}$ electrons in a coulomb? Why that exact number of electrons in one coulomb? who decided it? there is nothing wrong with the number, it just seems slightly messy. Why didn't the scientific community just settle on an easier number, such as $1\times10^{-19}$ for example? Do all starred commands have anything in common? \section* produces an unnumbered section, align* , which is comparable in a way. \newcommand* , which is different.  Stefan Kottwitz :     Commonly, a star symbol * means a version of a command that behaves differently from the original. That often means suppressing numbering but could also refer to special features.   This might answer my question, but perhaps there's more to say (and it's nice to have it as a separate question).  Is there anything all starred commands have in common? Why would one define a starred command as opposed to another, differently named command indicating their semantic difference in the names? It seems that their definitions are usually entirely independent from each other.  Further reading: The meaning of imaginary time What is imaginary (or complex) time? I was reading about Hawking's wave function of the universe and this topic came up. If imaginary mass and similar imaginary quantities do not make sense in physics, why should imaginary (or complex) time make sense?    By imaginary I mean a multiple of $i$, and by complex I mean having a real and an imaginary part, i.e., $\alpha + i\beta$, where $\alpha, \beta \in {\mathbb R}$. How do I remove any Ubuntu brand and trademark from my Ubuntu install? I am running Ubuntu 17.10 and I would like to build a completely de-branded ISO of it. This means not just dropping the Ubuntu name from /etc/lsb_release but also deleting references in the text of the installation program, in the "about this computer" screen and so on.  I've already checked other questions but I do not consider them duplicate because:    is very old and it just turned into a bunch of "try this tool" suggestions  is also old and suggests a tool called relinux that hasn't seen updates in years  does mention APT packages (and I know how this works) but not trademarks   Therefore my questions are:   Starting from a stock Ubuntu 17.10 (or an official derivative), how can I remove references to the Ubuntu trademark and logo? What exact packages do I need to uninstall? Are there images I need to replace? Are there files I need to edit other than /etc/lsb_release?   Please note that I am not interested in removing other names such as Firefox. I am only interested in the name of the distro. Ignore folders/files when Directory.GetFiles() is denied access I am trying to display a list of all files found in the selected directory (and optionally any subdirectories). The problem I am having is that when the GetFiles() method comes across a folder that it cannot access, it throws an exception and the process stops.  How do I ignore this exception (and ignore the protected folder/file) and continue adding accessible files to the list?  try {     if (cbSubFolders.Checked == false)     {         string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath);         foreach (string fileName in files)             ProcessFile(fileName);     }     else     {         string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath, "*.*", SearchOption.AllDirectories);         foreach (string fileName in files)             ProcessFile(fileName);     }     lblNumberOfFilesDisplay.Enabled = true; } catch (UnauthorizedAccessException) { } finally {}