I'm basically trying implement merge sort in Java. For doing so, I've created a class called Array, which has an integer array a[]. The class also has a method called slice(int left, int right) that produces the slice of array and returns the object. Henceforth , there is a sort() method that recursively calls itself and breaks down the array and returns an Array object at the end.  import java.util.*; class Array {     int a[];      public Array()     {         a = null;     }      public Array(int x)     {         a = new int[x];     }        public void input()     {         Scanner sc = new Scanner(System.in);         for(int i = 0; i &lt; a.length; i++)         {             System.out.print("Enter a No. = ");             a[i] = sc.nextInt();          }     }      public void display()     {         for(int i = 0; i &lt; a.length; i++)             System.out.print(a[i] + "\t");         System.out.println();     }      public Array slice(int left, int right)     {         Array ob = new Array(left + right + 1);         for(int i = left; i &lt;= right; i++)             ob.a[i] = this.a[i];         return ob;     }      public static Array merge(Array A, Array B)     {         Array C = new Array(A.a.length + B.a.length);         int i, j, k;         i = j = k = 0;          while(i &lt; A.a.length &amp;&amp; j &lt; B.a.length)         {             if(A.a[i] &lt; B.a[j])                 C.a[k++] = A.a[i++];             else if(A.a[i] &gt; B.a[j])                 C.a[k++] = B.a[j++];             else             {                 C.a[k++] = A.a[i++]; j++;             }         }          while(i &lt; A.a.length)             C.a[k++] = A.a[i++];          while(j &lt; B.a.length)             C.a[k++] = B.a[j++];          return C;     }      public Array sort()     {         if(this.a.length == 1)             return this;         else         {             return merge(this.slice(0, (this.a.length - 1) / 2).sort(), this.slice(1 + (this.a.length - 1) / 2, this.a.length - 1).sort());         }     }      public static void main()     {                 Array x;         Scanner sc = new Scanner(System.in);         System.out.print("Enter the No. of Elements = ");         Array ob = new Array(sc.nextInt());         ob.input();         System.out.println("\n ORIGINAL ARRAY");         ob.display();         System.out.println("\n SORTED ARRAY");         x = ob.sort();         x.display();     } }   Suppose if I have an object A, which has an integer array a[], then on calling A.sort() must return an object in which all the array elements will be sorted in ascending order.  Error(s) I Got: java.lang.StackOverflowError: null
What is a StackOverflowError, what causes it, and how should I deal with them?
Randomly selecting elements without repetition Stop setInterval call in JavaScript I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event?   I want the user to be able to stop the repeated refresh of data. Does Java have buffer overflows? Temporal Table that doesn't use system time We want to implement temporal tables in SQL Server 2016. We are creating a Datawarehouse and developing Type 2 Slowly changing Dimension Tables.  For the BeginDate, we want it to be dependent on transaction date and not the current getdate time. We are reprocessing a history of transactions. Example below, customer has gym or bank status, and goes from inactive, to active, or pending, dependent on transaction date.  We currently have this.  CREATE TABLE dbo.Department (     CustomerId int primary key,     MembershipStatus int,     TransactionDate datetime  );   We we would like to create a table like this.  CREATE TABLE dbo.DepartmentHistory (     CustomerId int primary key,     MembershipStatus int,     TransactionDate datetime,     BeginDatetime datetime,     EndDatettime datetime  );   Example usage would be:   first Customer Transaction on 3/5/2018 as Pending P        +------------+--------+-----------+---------+     | CustomerId | Status | BeginDate | EndDate |     +------------+--------+-----------+---------+     | 1          | P      | 3/5/2018  | NULL    |     +------------+--------+-----------+---------+    second transaction is 4/21/2018 is Active A        +------------+--------+-----------+-----------+     | CustomerId | Status | BeginDate | EndDate   |     +------------+--------+-----------+-----------+     | 1          | P      | 3/5/2018  | 4/21/2018 |     | 1          | A      | 4/21/2018 | NULL      |     +------------+--------+-----------+-----------+ Is "logicalising" a valid word? Is logicalising a valid word, if the meaning was to make something supposedly 'illogical', logical? How can I re install the APT Tool? Setting width/height as percentage minus pixels On the mobile web after new privilege is earned, reputation block contains some design issues:   no margins poor text color inside bar         By tapping on "track the next one" link, page have been refreshed:   no margins empty block in the middle obscure content         Only after manual refreshing, page looks fine again:        It is hard to reproduce because you need to earn next privilege which takes a lot of time. But I believe it's no too hard for developers :) Why does parameter expansion with spaces without quotes work inside double brackets "[[" but not inside single brackets "["? I'm confused with using single or double brackets. Look at this code:  dir="/home/mazimi/VirtualBox VMs"  if [[ -d ${dir} ]]; then     echo "yep" fi   It works perfectly although the string contains a space. But when I change it to single bracket:  dir="/home/mazimi/VirtualBox VMs"  if [ -d ${dir} ]; then     echo "yep" fi   It says:  ./script.sh: line 5: [: /home/mazimi/VirtualBox: binary operator expected   When I change it to:  dir="/home/mazimi/VirtualBox VMs"  if [ -d "${dir}" ]; then     echo "yep" fi   It works fine. Can someone explain what is happening? When should I assign double quotes around variables like "${var}" to prevent problems caused by spaces? biblatex: separator for citing multiple sources, some of them with page, some not I'm using biblatex for my references.  Normally, if I use \cite{source1, source2, source3}, I get a citation like  [3, 45, 98]   If I now want to give a page number for one of them, it looks confusing imho, as I should get (did not try it out up to now, honestly)   [3, 45, 78, p. 23f, 98]   So imho it would make sense to change one of the separator from a comma to e. g. a semicolon like:  [3; 45; 78, p. 23f; 98]   Question 1: Does that make sense, or are there other conventions for citing sources with and without page numbers together?  (Up to now I collected the citations without page number in one cite command and added singular \cite[][p. xy]{} commands for those with page numbers., so I'd get:   [3, 45, 98][78, p. 23f]   )  the \cites[]{}[]{}[]{} could also do that, but it also uses the same separators for entries and postnotes.  Question 2: How could I change the separator globally for those number-citations from comma to semicolon in biblatex? What does it mean when Git says 'rewrite' or 'rename' in a commit message? Retrieving Wikipedia's coordinate information? I'd like to add icons to my map showing locations which have Wikipedia entries.  The  is a great resource for determining Wiki entries near an XY location, but it has limitations (20km radius, 50 points only) which make it unsuitable for my purposes.  Ideally I need the map to show ALL locations with Wiki entries, so I guess I'll need to download the Wikipedia dump file and parse it for geocoded entries.  Where is this information found in the Wikipedia dump files?  The Wiki database may be downloaded from  but I can't see which file(s) I need to search for the coordinates.  For example, the  includes:  Coordinates:    33°51′35.9″S 151°12′40″E   Where is this found in the dump files? Another way to phrase the question is "how can I determine which Wiki entries are geo-coded?" What to look for in a wide angle lens? Proof concerning Stirling numbers of the first kind How do I show that   $${ n\brack 2} = \frac{n!}{2} \sum_{m=1}^{n-1} \frac{1}{m(n-m)}$$  using a combinatorial argument?  My definition of ${n \brack 2}$ is "the number of elements of $S_n$ which can be decomposed as the product of exactly $2$ disjoint cycles". Fighting Spam - What can I do as an: Email Administrator, Domain Owner, or User? This is a  about Fighting Spam.   Also related:                    There are so many techniques and so much to know about fighting SPAM. What widely used techniques and technologies are available to Administrator, Domain Owners, and End Users to help keep the junk out of our inboxes?  We're looking for an answer that covers different tech from various angles. The accepted answer should include a variety of technologies (eg SPF/SenderID, DomainKeys/DKIM, Graylisting, DNS RBLs, Reputation Services, Filtering Software [SpamAssassin, etc]); best practices (eg mail on Port 25 should never be allowed to relay, Port 587 should be used; etc), terminology (eg, Open Relay, Backscatter, MSA/MTA/MUA, Spam/Ham), and possibly other techniques. Now that experience does something besides render regions of a server uninhabitable due to  orb lag, what's the most efficient and safe way to get those excellent enchants?  A mob farmer may rank highly, but what about without tons of setup? Extending the User model with custom fields in Django What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes).  I've already seen a   to do it, but can't decide on which one is the best. Clipping image with Basic (ArcView) level license of ArcGIS Desktop? Is there a way to trim a geo-referenced air photo to an irregularly shaped boundary?    I tried the clip tool shown in my attachment, but it didn't work.  It looks as though the output extent field requires a rectangularly shaped polygon as the clipping feature.    Can I even do this in ArcView?    I've never had a request to do anything like this before.        I do use Photoshop and other similar software packages.  I could just go in to an environment like this &amp; start painting everything outside of my boundary in white, but then I would have to come back in and geo-reference the image again, and it just strikes me that there must be a faster and easier way (even though I only have ArcView 9.3). I have an Asus N76VB notebook with Ubuntu 14.04 and TLP for power managment. However, the fan is always on. It's not really loud, but it's annoying. My CPU usage is around 1-2%. It's clocked at 1.20 GHz.  I've added acpi=force to my boot parameters but it doesn't change anything.  /proc/acpi/fan: No such file or directory /proc/acpi/thermal_zone: No such file or directory   I've loaded all Asus ACPI modules.  lsmod | grep asus:  asus_nb_wmi            16990  0  asus_wmi               24191  1 asus_nb_wmi sparse_keymap          13948  1 asus_wmi video                  19476  2 i915,asus_wmi wmi                    19177  2 mxm_wmi,asus_wmi   Somehow, it can read the temperatures.  sensors:  acpitz-virtual-0 Adapter: Virtual device temp1:        +43.0°C  (crit = +108.0°C)  coretemp-isa-0000 Adapter: ISA adapter Physical id 0:  +44.0°C  (high = +87.0°C, crit = +105.0°C) Core 0:         +44.0°C  (high = +87.0°C, crit = +105.0°C) Core 1:         +42.0°C  (high = +87.0°C, crit = +105.0°C) Core 2:         +39.0°C  (high = +87.0°C, crit = +105.0°C) Core 3:         +39.0°C  (high = +87.0°C, crit = +105.0°C)  asus-isa-0000 Adapter: ISA adapter temp1:        +43.0°C     I really hope someone knows how to solve this. Almost all information I could find was about saving power to create less heat.    I got Intel and NVIDIA (GeForce 740M) graphics but I'm almost anytime on Intel.  $ sudo lshw -c display   *-display                       description: VGA compatible controller        product: 3rd Gen Core processor Graphics Controller        vendor: Intel Corporation        physical id: 2        bus info: pci@0000:00:02.0        version: 09        width: 64 bits        clock: 33MHz        capabilities: msi pm vga_controller bus_master cap_list rom        configuration: driver=i915 latency=0        resources: irq:43 memory:f7400000-f77fffff memory:d0000000-dfffffff ioport:f000(size=64)     fwts fan: Reason for the current trend to use «she» as the gender-neutral pronoun?