Heres the error that I'm getting:  Execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment to SObject ()  I believe the issue is with the following lines, which aims to retain the current account owner when a lead is converted automatically by the trigger:  Account a = [SELECT OwnerId FROM Account WHERE Id=:accountId LIMIT 1];  lc.setOwnerId(a.OwnerId);  trigger autoconversion on Lead (after update) {   Lead ld=Trigger.new[0];    if( ld.Ready_to_Convert__c == TRUE &amp;&amp; ld.IsConverted == FALSE) {       Database.LeadConvert lc = new database.LeadConvert();       lc.setLeadId(ld.id);       lc.setAccountId(ld.Linked_AccountId__c);       lc.setDoNotCreateOpportunity(TRUE);       String accountId = ld.Linked_AccountId__c;        //Account a = [SELECT OwnerId FROM Account WHERE Id=:accountId LIMIT 1];        List&lt;Account&gt; accs = [SELECT OwnerId FROM Account WHERE Id=:accountId LIMIT 1];       Account a = null;        if (!accs.isEmpty()) {           a = accs[0];           lc.setOwnerId(a.OwnerId);       }else {           a = null;           }        LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];       lc.setConvertedStatus(convertStatus.MasterLabel);       Database.LeadConvertResult lcr = Database.convertLead(lc);   } }
I am getting FATAL_ERROR|System.QueryException: List has no rows for assignment to SObject. I know that it is because it is not returning any rows in the SOQL query but what I want is that if it returns any row, it should update ALO field on contact object, if it is null then ALO field should be set to null.  Here is my code:  ziptoLOD = [SELECT Id, Name, LOD__c             FROM Zip_3_to_LOD__c             WHERE Name =: contact.Extract_Zipcode__c ];  Zip_3_to_LOD__c ziptoLOD2 = (ziptoLOD != null) ? ziptoLOD : null;  if (ziptoLOD2 == null) {     contact.ALO__c = ' ';    } else {     System.debug(System.LoggingLevel.ERROR, 'Zip to LOD' + ziptoLOD2);     contact.ALO__c = ziptoLOD2.LOD__c; }   My code gets stuck at the SOQL query and gives me the list has no rows error.
I am looking to display my iPad screen wirelessly to an external display to demo applications.  I found  showing exactly what I want to do with an iPhone but no explanation as to what the hardware dongle used was.  The main thing is that there isn't a wire tethering the user to the external display. Get path to application? How can a user determine the path to an application being showed in launcher?  This is meant for non-programmers or experts, so terminal commands are not really suited for them. Why: we need to make our users able to drag files/folders on our applications, a standard OS feature entirely missing in Ubuntu. How to capture all std outputs Shutdown button only logs out ubuntu 15.04 I'm code reviewing a change one of my co-workers just did, and he added a bunch of calls to Date.toMonth(), Date.toYear() and other deprecated Date methods.  All these methods were deprecated in JDK 1.1, but he insists that it's ok to use them because they haven't gone away yet (we're using JDK 1.5) and I'm saying they might go away any day now and he should use Calendar methods.  Has Sun/Oracle actually said when these things are going away, or does @deprecated just mean you lose style points? I got the following problem: Right now I am checking my equations, which are usually written in align. This looks great in most of the cases, but sometimes the pagebreaks are weird, ie there is a lot of vertical whitespace left (like 2.5cm) at the end of a page. I made the following MWE to illustrate this.  \documentclass[a4paper, 12pt, headsepline]{scrreprt} \usepackage[onehalfspacing]{setspace} \usepackage{amsmath, amssymb, mathtools} \usepackage{mathptmx} \usepackage[a4paper]{geometry} \geometry{left=2cm,right=5cm,top=2cm,bottom=2cm} % \usepackage{lipsum} %\lipsum \usepackage[pangram]{blindtext}  \begin{document} \Blindtext[1][3]%1 paragraph, 3 pangrams \begin{align} X_{t+1} &amp;=  \frac{X_{t+1}+X_{t+1}}{Y_t}  \label{eq:1}  \intertext{Solving...:} \notag  X_{t}  &amp;=  \frac{X_{t+1}+X_{t+1}}{Y_{t+1}} \notag \\ \intertext{Solving further...:} \notag  % ===PAGEBREAK HERE: 2nd page begins=== &amp;= \frac{X_{t+1}+X_{t+1}}{Y_t} +  \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag \\ &amp;= \frac{X_{t+1}+X_{t+1}}{Y_t}...  \notag \\ \intertext{Solving further...:} &amp; = \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag \end{align}  \end{document}   In the MWE, the first 'Solving further' should be on the first page instead (to save space and it would also look better I guess?). The position where I would like the pagebreak to be is also marked as a comment in the MWE.  My question is first on a general basis: Which is the best environment to achieve multiple line equations, which can be aligned as in align, and to save space at the same time? Or to be more precise: If possible, I'd like to stick with align and adapt the pagebreaks only if necessary.  Thanks! How to send and receive data from Salesforce to a FTP server My question is how I can intergrate Salesforce with different FTP servers in real time. I have read some articles about it, but to be absolutely sure I thought it would be a good idea to post a question here.  I want to be able to send and receive data from Salesforce as a csv file to a ftp server. How I'm thinking about doing this is listed below.  Send the data:  Create a apex class which query the necessary data in Salesforce and create a csv file. I guess this is trivial? Then send the file to a web service created in Salesforce, just by calling it in the apex code. Create a web service in Salesforce which receives the data from the apex code. This web service should in some way send the data to the appropriate ftp server. I guess I can simply modify some of the code provided by Salesforce to make this work? The file is sent. Receive the data  This one is a bit trickier. I guess I have to pull the data from the FTP server by using my web service, which then send the file collected to the appropriate apex class. Or, the FTP server could send the data to the SFDC web service, I don't know if this is possible? The web services on the other side that sends the data to the ftp server, could send it directly to the SFDC web service, which then again forward it to the apex class. I guess the web service will use the remote site url to connect to the SFDC web service? What is the importance of eigenvalues/eigenvectors? $\delta$ differential notation Various textbooks that I am currently consulting (including Spacecraft Dynamics and Control An Introduction - Anton H.J. De Ruiter | Christopher J. Damaren | James R. Forbes Section 1.4, page 32) use $\delta$, not $d$ or $\partial$ to express an infinitesimal quantity. In the context of the reference text above, the symbol is used as part of a general definition for the derivative of a vector. Specifically, given   $$\mathbf{\vec{r}}=\mathcal{\vec{F^{T}_{1}}}\mathbf{\vec{r_{1}}}$$   where   $$\mathcal{\vec{F^{T}_{1}}}$$   is a vectrix   $$[\mathbf{\vec{x_1}} \phantom{s} \mathbf{\vec{y_1}} \phantom{s} \mathbf{\vec{z_1}}].$$  The time derivative of the vector is defined as   $$\dot{\mathbf{\vec{r}}}\triangleq \lim_{\delta t\to 0}\frac{\delta\mathbf{\vec{r}}}{\delta t}.$$  In this context, what is the difference between $\frac{\delta\mathbf{\vec{r}}}{\delta t}$ and $\frac{d \mathbf{\vec{r}}}{d t}$ ?  Note about thermodynamic use of $\delta$: My understanding is that $\delta$ is used in thermodynamic equations to express path dependence of a scalar quantity such as heat or work. What does it mean in the context of an abstract physical vector? Do Fortnite V-Bucks Purchases Save on All Platforms? So I'm thinking of buying some V-Bucks on Fortnite, Battle Royale mobile. Do the purchases save cross platform? Prove $$\int _0^\infty f^2(x) dx \leq \frac{2}{3}\cdot  \max_{x \in \mathbb R^+} f(x) \cdot  \int _0^\infty f(x) dx$$ for $f(x) \geq 0$ and convex.   I know via Holder's we can get without the constant $\frac{2}{3}$ but that should also be true for $f$ not convex. I tried some approaches using convexity but didn't get the desired result.   A hint or reference would also help. Also, it would be interesting to know when equality holds. traceroute TCP equivalent for Windows Increase the visibility of the association bonus by documenting it with the other privileges What kind of edits contribute to the editor badges? The descriptions for the editing badges are:     Editor:    Strunk &amp; White:    Copy Editor:    Does "posts" include your own questions/answers, or are these badges just for edits to other people's stuff?  Other questions about how editor badge works:   What if I edit only a question's tags, but not its body? What if I edit both a question's tags and its body? Do edits to Community Wiki posts count? Do edits to answers count? Do edits to tag wiki pages count? Do edits to comments count? (Moderators can edit other users' comments, even outside of the usual five minute window.) There are two checkboxes for Run As Administrator in the Properties dialog for a shortcut in Windows 7. One is under the Shortcut tab in the Advanced Properties dialog, and the other is under the Compatibility tab.  I've seen this under Windows 7 and Windows Server 2008. It might be in Vista and other versions, but I'm not sure.  What is the difference between these two settings? Get index of each capture in a JavaScript regex Flowchart using Tikz I'm trying to create a fine flowchart that is a bit complicated. Therefore I need a block for a predefined process and a connector block as well as a data block. Can someone help me? In comment is what I'd like to see in my code to keep my code nicely arranged. The rest of the code is a simple example for the Tikz site.  \documentclass{article}  \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \pagestyle{empty}   % Define block styles \tikzstyle{decision} = [diamond, draw, fill=blue!20,      text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, fill=blue!20,      text width=5em, text centered, rounded corners, minimum height=4em] \tikzstyle{line} = [draw, -latex'] \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,     minimum height=2em]  %\tikzstyle{subroutine} = [draw,rectangle split, rectangle split         horizontal,rectangle split parts=3,minimum height=1cm]  %\tikzstyle{connector} = [draw,circle,...] %\tikzstyle{data} = [draw, trapezium, ...]  \begin{tikzpicture}[node distance = 2cm, auto]     % Place nodes     \node [block] (init) {initialize model};     \node [cloud, left of=init] (expert) {expert};     \node [cloud, right of=init] (system) {system};     \node [block, below of=init] (identify) {identify candidate models};     \node [block, below of=identify] (evaluate) {evaluate candidate models};     \node [block, left of=evaluate, node distance=3cm] (update) {update     model};     \node [decision, below of=evaluate] (decide) {is best candidate     better?};     \node [block, below of=decide, node distance=3cm] (stop) {stop};     % Draw edges     \path [line] (init) -- (identify);     \path [line] (identify) -- (evaluate);     \path [line] (evaluate) -- (decide);     \path [line] (decide) -| node [near start] {yes} (update);     \path [line] (update) |- (identify);     \path [line] (decide) -- node {no}(stop);     \path [line,dashed] (expert) -- (init);     \path [line,dashed] (system) -- (init);     \path [line,dashed] (system) |- (evaluate); \end{tikzpicture}   \end{document} How to pass an ArrayList to a varargs method parameter? For example, the square can be described with the equation $|x| + |y| = 1$. So is there a general equation that can describe a regular polygon (in the 2D Cartesian plane?), given the number of sides required?  Using the Wolfram Alpha site, this input gave an almost-square: PolarPlot(0.75 + ArcSin(Sin(2x+Pi/2))/(Sin(2x+Pi/2)*(Pi/4))) (x from 0 to 2Pi)  This input gave an almost-octagon: PolarPlot(0.75 + ArcSin(Sin(4x+Pi/2))/(Sin(4x+Pi/2)*Pi^2)) (x from 0 to 2Pi)  The idea is that as the number of sides in a regular polygon goes to infinity, the regular polygon approaches a circle. Since a circle can be described by an equation, can a regular polygon be described by one too? For our purposes, this is a regular convex polygon (triangle, square, pentagon, hexagon and so on).  It can be assumed that the centre of the regular polygon is at the origin $(0,0)$, and the radius is $1$ unit.  If there's no such equation, can the non-existence be proven? If there are equations, but only for certain polygons (for example, only for $n &lt; 7$ or something), can those equations be provided? It is easy to find the minimum of $\|Ax-b\|_2$, when $A$ has full column rank. But how is the case when we add the constraint $\|x\|_2=1$? Or, to be explicit,  $$\min_{\|x\|_2=1}\|Ax-b\|_2=?$$  My idea is to construct the corresponding Lagrange function  $$L(x,\lambda) = (Ax-b)^T(Ax-b) + \lambda(x^T x - 1)$$  Differentiate the function with respect to $x,\lambda$, we have  $$A^T A x - A^T b + \lambda x = 0$$  $$x^T x=1$$  However, I find it hard to move forward to get the answer. Could anyone help me? Thanks a lot!