During execution the problem is giving stack overflow problem, but what is this! Runtime Error (NZEC)  Exception in thread main java.lang.StackOverflowError at sun.nio.cs.US_ASCII$Encoder.encodeArrayLoop(US_ASCII.java:198) at sun.nio.cs.US_ASCII$Encoder.encodeLoop(US_ASCII.java:231) at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:579) at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:271) at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207) at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129) at java.io.PrintStream.write(PrintStream.java:526) at java.io.PrintStream.print(PrintStream.java:669) at Solution.solve(Solution.java:22) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:27) at Solution.solve(Solution.java:23) at Solution.solve(Solution.java:27) at Solution.solve(Solution.java:23)  import java.util.*; public class Solution {          public static void printIncreasingNumber(int n) {         /* Your class should be named Solution.          * Don't write main() function.         * Don't read input, it is passed as function argument.         * Print output as specified in the question         */         int k = 10;         int N = (int)Math.pow(10,n);//limit         solve((int)Math.pow(10,n-1),N);     }               static void solve(int j,int n){         if(j==n){             return;         }                  if(check(j)){             System.out.print(j+&quot; &quot;);             solve(j+1,n);         }         else{             j = increase(j,n);             solve(j,n);         }     }          static boolean check(int k){         ArrayList&lt;Integer&gt; arr = new ArrayList&lt;&gt;();         int temp = k;         while(temp&gt;0){             arr.add(temp%10);             temp = temp/10;         }         boolean ans = true;         for(int i=0;i&lt;arr.size()-1;i++){             if(arr.get(i)&lt;=arr.get(i+1)){                 ans = false;                 return ans;             }         }         return ans;     }          static int increase(int j,int n){         int ans = 0;         for(int i = j;i&lt;n;i++){             ArrayList&lt;Integer&gt; arr1 = new ArrayList&lt;&gt;();             int temp = i;             while(temp&gt;0){                 arr1.add(temp%10);                 temp = temp/10;             }             int count = 0;             for(int i1=0;i1&lt;arr1.size()-1;i1++){                 if(arr1.get(i1)&lt;=arr1.get(i1+1)){                     count++;                 }             }             if(count==0){                 ans = i;                 break;             }         }         return ans;     } }  My main function is, import java.util.Scanner;   public class Main {      public static void main(String[] args) {         int a;         Scanner s = new Scanner(System.in);         a = s.nextInt();         Solution.printIncreasingNumber(a);     }  }
What is a StackOverflowError, what causes it, and how should I deal with them?
Deseasonalizing count data I used stl() in R to decompose count data into trend, seasonal &amp; irregular components. The resulting trend values are not integers anymore. I have the following questions:   Is stl() an appropriate way to deseasonalize count data? Since the resulting trend is not interger valued anymore, can I use lm() to model the trend components? Why is James Bond less tech savvy in the Daniel Craig movies? Is there a regular expression to validate an email address in JavaScript? Seeking open source solution to access rasters in File Geodatabase? I'm looking for a way to access raster layers in an Esri File-GeoDatabase without using ArcObjects or ArcPy, specifically I would like to access the raster layers with GDAL. I understand that the GDAL FileGDB and OpenFileGDB give access to vector datasets within File-GeoDatabases, and that ESRI's own FileGDB C++ API does not support raster access.   Is anyone out there aware of any open source solutions? Find the last two digits of $9^{{9}^{9}}$ I have to find the last two decimal digits of the number $9^{{9}^{9}}$.  That's what I did:  $$m=100 , \phi(m)=40, a=9$$ $$(100,9)=1, \text{ so from Euler's theorem,we have :} 9^{40} \equiv 1 \pmod{100}$$  $$9^{{9}^{9}} \equiv 9^{9^{2+2+2+2+1}} \equiv 9^{9^2 \cdot 9^2 \cdot 9^2 \cdot 9^2 \cdot 9} \equiv 9^{81 \cdot 81 \cdot 81 \cdot 81 \cdot 9} \equiv 9^{(40+40+1) \cdot (40+40+1) \cdot (40+40+1) \cdot (40+40+1) \cdot 9} \equiv (9^{(40+40+1)})^{(40+40+1) \cdot (40+40+1) \cdot (40+40+1) \cdot 9} \equiv 9^9 \equiv 9^4 \cdot 9^4 \cdot 9 \equiv 6561 \cdot 6561 \cdot 9 \equiv 3721 \cdot 9 \\ \equiv 21 \cdot 9 \equiv 89 \pmod{100}$$  So,the last two digits are $8 \text{ and } 9$. $$$$But,is there also an other way two calculate the last two digits of $9^{{9}^{9}}$ or is the above the only one? Fixing the sucktastic merge UI (for tags) How to parse HTML with PHP? I am wondering what the difference between a definition and an axiom.  Isn't an axiom something what we define to be true?  For example, one of the axioms of Peano Arithmetic states that $\forall n:0\neq S(n)$, or in English, that zero isn't the successor of any natural number. Why can't we define 0 to be the natural number such that it isn't the successor of any natural number?  In general, why is an axiom not a definition?   Are there cases where we can formulate definitions as axioms or vice versa? How to escape  inside  tags I'm trying to write a blog post which includes a code segment inside a &lt;pre&gt; tag. The code segment includes a generic type and uses &lt;&gt; to define that type. This is what the segment looks like:  &lt;pre&gt;     PrimeCalc calc = new PrimeCalc();     Func&lt;int, int&gt; del = calc.GetNextPrime; &lt;/pre&gt;   The resulting HTML removes the &lt;&gt; and ends up like this:  PrimeCalc calc = new PrimeCalc(); Func del = calc.GetNextPrime;   How do I escape the &lt;&gt; so they show up in the HTML? Salesforce, Oracle and the Seven Dwarfs Over my time as a Salesforce developer, I've written some code which on occasion managed to surface Oracle plsql exceptions and curiously the error text contains the name of one of Disney's .  I've teased out Doc, Grumpy, Happy, Bashful and Sneezy. I'm sure the other two are not far away.   What is the underlying "thing" on the database platform that is named after a Dwarf? Why were these named after Dwarves?      java.sql.SQLException: ORA-30006: resource busy; acquire with WAIT   timeout expiredORA-06512: at "DOC.CAPEX", line 2200ORA-06512: at line   1: SQLException while executing plsql statement: {call   cApex.update_sysmodstamp(?)}([       java.sql.SQLException: ORA-30006: resource busy; acquire with WAIT   timeout expiredORA-06512: at "GRUMPY.CAPEX", line 2563ORA-06512: at   line 1: SQLException while executing plsql statement: {call   cApex.update_sysmodstamp(?)}([       java.sql.SQLException: ORA-30006: resource busy; acquire with WAIT   timeout expiredORA-06512: at "HAPPY.CAPEX", line 2715ORA-06512: at   line 1: SQLException while executing plsql statement: {call   cApex.update_sysmodstamp(?)}([       java.sql.SQLException: ORA-30006: resource busy; acquire with WAIT   timeout expiredORA-06512: at "BASHFUL.CAPEX", line 2715ORA-06512: at   line 1: SQLException while executing plsql statement: {call   cApex.update_sysmodstamp(?)}([       java.sql.SQLException: ORA-30006: resource busy; acquire with WAIT   timeout expiredORA-06512: at "SNEEZY.CAPEX", line 2718ORA-06512: at   line 1: SQLException while executing plsql statement: {call   cApex.invalidate_agc(?,?)}([      Error: ORA-20000: ORA-06512: at "SNEEZY.SIMPORTLOOKUP", line 850   ORA-06512: at "SNEEZY.SIMPORTLOOKUP", line 823 ORA-06512: at line 1 :   SQLException while executing plsql statement: {call   sImportLookup.get_by_ext_id_text(?,?,?,?,?,?,?)}([ What do Pentax and Sigma DSLRs offer that differs from Canon and Nikon? We have a question and answers outlining the . I'm interested in the other DSLR makers, and how the cameras they make compare in terms of significant features, system design philosophy, and unique or interesting photographic capabilities enabled or made easier by these cameras. Likewise, what such things are not handled as well?  Take "the big two have more market share" and the associated advantages of availability, accessibility, and third-party support and documentation .  I'm not interested here in compact cameras, interchangeable-lens cameras with electronic viewfinders, or in rangefinders. (If you're interested in that, though, see )  P.S.: Differences in lens lineups are covered at Beamer text and image on the same slide Return single column from a multi-dimensional array Reattach to lost X11 session I'm using X11 forwarding over ssh to run Linux apps on my Windows box, and when the network drops it loses everything that was running. Is there anything similar to screen for X11? I was very inspired by Michio Kaku's  on the possibilities of quantum computing and also listening to Talia Gershon's  on it.   As I come from a business &amp; analytics background, what materials can I begin exploring to prepare to learn more about the field of quantum computing? Eg. what would I need to study to understand Peter Shor's algorithm,  on physics, etc. My problem is we want to minimize $1/2 \cdot \text{Norm}(w)^2$ under suitable constraints $y(i){[w^Tx_i+b]-1}$.  We write the Lagrangian and get the above equations.  I have a problem in differentiating with respect to $w$ can somebody elaborate on that? How do we get first equation? What happens to a bounty question if it gets migrated? clearly belongs elsewhere, but the asker already put a bounty on the question.  If the question is migrated, does the rep get refunded? Does the question continue to be a bounty question on the target site if the user has enough rep? (The asker in the referenced question does not have any associated accounts, but I'm curious about what happens.)  Edit: I just tried to add my own close vote, but apparently you can't when there's an open bounty. However, a mod should still be able to close/migrate/etc. My daughter asked me to cosign on a car loan.  Somehow I ended up as the borrower and she a the cosigner.  Is that legal? Let $a_n$ be a sequence s.t $a_1 > 0 \land a_{n+1} = a_n + \dfrac{1}{a_n}$. Prove that $a_n$ is increasing and tends to infinity Let $a_n$ be a sequence s.t $a_1 &gt; 0 \land a_{n+1} = a_n + \frac{1}{a_n}$. Prove that $a_n$ is increasing and tends to infinity.  Proof:   Consider $a_{n+1} - a_n$:  $a_{n+1} - a_n = a_n + \frac{1}{a_n} - a_n = \frac{1}{a_n}$ This is greater than $0$. Thus, $a_n$ is increasing.  Now this is where I need some help. I would like to say that $a_n$ is unbounded and then conclude that monotone and unbounded implies tending to infinity.  Maybe by contradiction? How to get city name from latitude and longitude coordinates in Google Maps?