My trigger   trigger triggSendRebateData on RebateData_for_MC__c (before insert,before update) {    List&lt;RebateData_for_MC__c&gt; lstRebateData = new List&lt;RebateData_for_MC__c&gt;();     for(Integer i=0;i&lt;Trigger.new.size();i++){     system.debug('iiii'+i +Trigger.new.size());           lstRebateData.add(Trigger.new[i]);         }    if(!lstRebateData.isEmpty()){       ID jobID = System.enqueueJob(new RebateDataQueue(lstRebateData));   } }   My Class   public class RebateDataQueue implements Queueable, Database.AllowsCallouts {      private List&lt;RebateData_for_MC__c&gt; lstRebate;      public RebateDataQueue(List&lt;RebateData_for_MC__c&gt; lstRb){         this.lstRebate = lstRb;     }      public void execute(QueueableContext context) {         if(!lstRebate.isEmpty()){         for(RebateData_for_MC__c rbData:lstRebate){ TriggeredSendEmail.postMailtoET(rbData.name,rbData.address__c,rbData.BusinessUnit__c,rbData.ERp__c,rbData.ABN__c); } } }   TriggeredSendEmail Class   public class TriggeredSendEmail{   @future(callout=true)       public static void postMailtoET(string name,string addressLine1,string businessunit,string erp,string abn){ //some code here } }   I'm trying to insert around 250 records by calling the method in developer console and this is the error i'm getting. How to overcome this
Working on a future method to post values to external web service. But since there is a limit of 50 callouts per invocation, I am getting error "Too many future calls : 51". Cases are loaded into salesforce from external ETL in bulk. So is there a way to workaround this error.   Class  public with sharing class caseTrigger {      //method invoked by trigger after insert     public void CaseInsert(List&lt;Case&gt; caseIns){           list&lt;Id&gt; caseIds = new list&lt;id&gt;();             List&lt;Case&gt; caseList = [Select id from case WHERE Id IN :caseIds];                 for(Case c : caseList){                     if(c.Status != 'closed'){                         caseIds.add(c.id);                     }                          if(f.caseId_User.size()&gt;0){PostCases(caseIds);}      }     //postCases (future method)     @future(callout = true)     public static void PostCases(List&lt;Id&gt; Ids){         //prepare Json to post to webservice    } }
I am trying to install Wordpress on Lubuntu. I followed the instructions . Including PHP Apache and MySQL setups. Apache and MySQL appear to be running fine.  However, when I go to http://localhost/blog/, I get the following error:     Neither /etc/wordpress/config-localhost.php nor /etc/wordpress/config-localhost.php could be found.   Ensure one of them exists, is readable by the webserver and contains the right password/username. Hide some fields in the NewForm.aspx for a custom list I have 5 columns in the custom list. Out of which only 3 have to displayed in the NewForm.aspx page.  All of the 5 columns have to be displayed on the EditForm.aspx page. While googling, I have come across the following  :  When I implemented the code that was given on this page, I get an error which says that parentNode is not found. Please guide me how can I implement this requirement.  Any other alternatives other than this are also appreciated. mysql select distinct rows into a comma delimited list column Identity involving Euler's totient function: $\sum \limits_{k=1}^n \left\lfloor \frac{n}{k} \right\rfloor \varphi(k) = \frac{n(n+1)}{2}$ Let $\varphi(n)$ be Euler's totient function, the number of positive integers less than or equal to $n$ and relatively prime to $n$.    Challenge: Prove  $$\sum_{k=1}^n \left\lfloor \frac{n}{k} \right\rfloor \varphi(k) = \frac{n(n+1)}{2}.$$   I have two proofs, one of which is partially combinatorial.    I'm posing this problem partly because I think some folks on this site would be interested in working on it and partly because I would like to see a purely combinatorial proof.  (But please post any proofs; I would be interested in noncombinatorial ones, too.  I've learned a lot on this site by reading alternative proofs of results I already know.)  I'll wait a few days to give others a chance to respond before posting my proofs.  EDIT: The two proofs in full are now given among the answers. steam fatal error "steam needs to be online to update, but was set to offline movies." I tried re-installing  it but it simply keeps giving me this error in a little window. When I close it, an identical error pops up some 3 seconds later without any new provocation. How to search based on part of file name in Google Drive I'd like to be able to find all files in my Google drive that contain the string "_INSTRUCTION_" in the file name. Is there a way to do this?  EDIT 1: When I search for "RMA2013", I should get a dropdown with several options. As you can see, there are several Word and .pdf files with the phrase "RMA2013". Still I get no dropdown help:   And even if I click the search button, I get nothing: Question mark and colon in JavaScript How would I write the equivalent of C#'s  in JavaScript?  var haystack = 'hello world'; var needle = 'he';  haystack.startsWith(needle) == true   Note: This is an old question, and as pointed out in the comments ECMAScript 2015 (ES6) introduced the  method. However, at the time of writing this update (2015) . How do you override page.tpl.php in Omega 4? I am using the  base theme, and am trying to override page.tpl.php.    This file is in the base theme in sites/all/themes/omega/templates/system.  When I copy it into my theme, edit it, clear caches, I don't see my changes?  Why can't I override this template? Every Artinian ring is isomorphic to a direct product of Artinian local rings Proposition. Let $R$ be commutative ring with $1_R$. We assume that $R$ is an Artinian ring and $M_1,\dots,M_n$ its maximal ideals. Then         $R/\mathrm{Jac}(R)\cong (R/M_1)\times \dotsb \times (R/M_n)$.   The ring $R$ is isomorphic to the direct product of a finite number of Artinian local rings.      Proof. 1. It's obvious that $M_i+M_j=R,\ \forall 1\leq i \neq j \leq n$. So, from Chinese Remainder Theorem, we have  $$R/\bigcap_{i=1}^{n}M_i = R/\mathrm{Jac}(R) \cong (R/M_1)\times \dotsb \times (R/M_n),$$ as we wanted.    Since $R$ is an Artinian ring, we have $\mathrm{Jac}(R)^m=\{0_R\}$, for some $m\in \Bbb Z^+$. But,  $$\{0_R\}\subseteq M_1^m\dotsb M_n^m=(M_1\dotsb M_n)^m\subseteq (\bigcap_{i=1}^{n}M_i=\mathrm{Jac}(R))^m=\{0_R\}.$$ So, if we apply CRT we will take  $$R\cong R/\{0_R\}\cong R/M_1^m\dotsb M_n^m\cong (R/M_1^m)\times \dots \times (R/M_n^m).$$   Questions.   1) Are these thoughts complete and correct?  2) Why $R/M_i^m$ are artinian local rings?  3) Could you please elaborate some examples as an application? What is the solution to the Squirrel sequence of letters question? Getting user provided data out of a database and into R Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?  I tried to flatten such a list with a nested list comprehension, like this:  [image for image in menuitem for menuitem in list_of_menuitems]   But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined.  After googling and looking around on Stack Overflow, I got the desired results with a reduce statement:  reduce(list.__add__, map(lambda x: list(x), list_of_menuitems))   But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object.  Conclusion:   Thanks to everyone who contributed to this question.  Here is a summary of what I learned.  I'm also making this a community wiki in case others want to add to or correct these observations.  My original reduce statement is redundant and is better written this way:  &gt;&gt;&gt; reduce(list.__add__, (list(mi) for mi in list_of_menuitems))   This is the correct syntax for a nested list comprehension (Brilliant summary !):  &gt;&gt;&gt; [image for mi in list_of_menuitems for image in mi]   But neither of these methods are as efficient as using itertools.chain:  &gt;&gt;&gt; from itertools import chain &gt;&gt;&gt; list(chain(*list_of_menuitems))   And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so:  &gt;&gt;&gt; chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) &gt;&gt;&gt; print(list(chain)) &gt;&gt;&gt; [1, 2, 3, 5, 89, 6] I thought the way to undo a \def was to define it to \relax, but that does not appear to work.  Also, am not sure why this produces no output if I try to use \def instead of \let in my attempt to do an undef.  \documentclass{article}  \begin{document}  \def\CaseA{}%  \ifdefined\CaseA%     \def\ProcessCaseA{}%     % Do stuff that uses \ProcessCaseA     %\def\ProcessCaseA\relax% no output if use this, and comment next line     \let\ProcessCaseA\relax% no output if comment this, and use above line \fi  % Now do stuff that requires \ProcessCaseA NOT be defined \ifdefined\ProcessCaseA     ERROR: \textbackslash ProcessCaseA is still defined \else     SUCCESS: \textbackslash ProcessCaseA is not defined \fi  \end{document} Is it acceptable to say "fed up OF" - surely it should be "fed up WITH" or "bored WITH something" rather than "bored OF something"? How do I get jQuery to select elements with a . (period) in their ID? Given the following classes and controller action method:  public School {   public Int32 ID { get; set; }   publig String Name { get; set; }   public Address Address { get; set; } }  public class Address {   public string Street1 { get; set; }   public string City { get; set; }   public String ZipCode { get; set; }   public String State { get; set; }   public String Country { get; set; } }  [Authorize(Roles = "SchoolEditor")] [AcceptVerbs(HttpVerbs.Post)] public SchoolResponse Edit(Int32 id, FormCollection form) {   School school = GetSchoolFromRepository(id);    UpdateModel(school, form);    return new SchoolResponse() { School = school }; }   And the following form:  &lt;form method="post"&gt;   School: &lt;%= Html.TextBox("Name") %&gt;&lt;br /&gt;   Street: &lt;%= Html.TextBox("Address.Street") %&gt;&lt;br /&gt;   City:  &lt;%= Html.TextBox("Address.City") %&gt;&lt;br /&gt;   Zip Code: &lt;%= Html.TextBox("Address.ZipCode") %&gt;&lt;br /&gt;   Sate: &lt;select id="Address.State"&gt;&lt;/select&gt;&lt;br /&gt;   Country: &lt;select id="Address.Country"&gt;&lt;/select&gt;&lt;br /&gt; &lt;/form&gt;   I am able to update both the School instance and the Address member of the school.  This is quite nice!  Thank you ASP.NET MVC team!  However, how do I use jQuery to select the drop down list so that I can pre-fill it?  I realize that I could do this server side but there will be other dynamic elements on the page that affect the list.  The following is what I have so far, and it does not work as the selectors don't seem to match the IDs:  $(function() {   $.getJSON("/Location/GetCountryList", null, function(data) {     $("#Address.Country").fillSelect(data);   });   $("#Address.Country").change(function() {     $.getJSON("/Location/GetRegionsForCountry", { country: $(this).val() }, function(data) {       $("#Address.State").fillSelect(data);     });   }); }); Capitalization for a bullet list The summer training or (just) summer training Should we use the summer training or just summer training in the paragraph. As per me training is a noun and before singular noun we have to use an article and I am using the because I am talking about a specific training for engineers, I also know that before very common nouns we avoid articles, like bed, school, bus, university, so if you say we should use summer training then please give me a valid reason.     Company(name) has been providing the summer training for engineers   since 2010. We have been giving completely professional atmosphere for   engineers to complete the summer training with practical knowledge.   Our each faculty has a great experience in the education field. We   make sure you get all the important resources to make your summer   training a learning and an enjoyable summer training. You may call or   email us to get your confirmation about the training.   Thanks in advance. Replace unknown reference (?) with the tag from \ref or \cite While working on a document, it would be helpful if instead of a ? for unresolved references or citations the tag used in the \ref{thisthings} or \cite{Bloke1978} could appear instead.  Is there a package that turns on this behaviour? How do I know if an ability is magical? Often confusion arises when the  spell is used, an  is worn, or the 's anti-magic ray is employed, whether a given character's ability will still function.   The spell does give you some guidelines on how to adjudicate the effects of the loss of magic but says very little about how to determine what is affected.  In short, how do I tell if an ability is magical?