Get only part of an Array in Java?
How to create a sub array from another array in Java?
When should a Test Case be marked as "No Apply"? Notes:  Answers will occasionally be moved to the  when there are too many of them. When using them to report bugs, keep an eye on the post.    This site, Meta Stack Exchange, is usually used as a &quot;test bed&quot; for pending changes happening to the way text is rendered on all network sites. Changes to text rendering that are going to be rolled out to the network are usually deployed here first to test them out and fix any potential glitches. Currently, there are no such changes pending, but if there were, keep in mind that text posted here may render differently from the other sites until the changes roll out to them as well.    As per Jeff's suggestion in : You can use this question as a formatting sandbox. You can:  edit  itself ( questions such as this one require only 100 reputation to edit instead of 2,000) post answers to this question (This question might be , requiring earning 10 reputation on this site to answer) post comments to this question or its answers test suspected bugs with the editor or the rendering post ponies (only when mods are asleep)   Beware that since the  in December 2010, and  added in March 2011, no syntax highlighting is applied unless the question's tags or an inline hint enable it. So, to test highlighting here in the sandbox:  , you can use GitHub-flavor fenced code blocks in your posts, specifying the language after the opening fence: ```html While not hinted otherwise: &lt;html&gt;&lt;/html&gt; source &lt;b&gt;goes&lt;/b&gt; &quot;here&quot;. ```  ```js var a = 3; while (not (a &gt; 0)) {     alert(&quot;JavaScript code &lt;b&gt;goes&lt;/b&gt; here.&quot;); } ```   Or:  Create code blocks in any way (using the fence notation above, the four-space indent form, or using HTML &lt;pre&gt;&lt;code&gt; tags).  Save your post.  Use your browser's developer tools to edit the resulting HTML. To open developer tools, press F12, or ⌥⌘ I on Mac.  Find the &lt;pre&gt; element and add the attribute class=&quot;prettyprint&quot;, or change it into one of the valid syntax hints linked above, like class=&quot;lang-vb prettyprint&quot;.  Run the following in the location bar: javascript:prettyPrint(); or prettyPrint() in the console.     Answers that are considered annoying or obnoxious, or that cause breakage for users, will be deleted. This is . What is a single word for a person who, as a habit, exaggerates a lot when relating information? Number of sigma algebras for set with 4 elements Why does water take a "wet" path? Allow me to explain what I mean... ((I am asking this question in the physics section in hopes of finding a "physics" argument))  I shall make it clear what I mean by demonstrating an experiment...  Hold your hand upright with your index finger pointing up towards the sky. Now drop about 2-3 drops of water right on top of your finger. Water drop should (theoretically) stay there. Now tilt your hand ever so slightly towards one side. The water drop rolls down your finger down your wrist leaving a trail towards the tilted side right?  Now's here comes my question. Now if you bring your finger and the hand to the initial upright state and place another water drop on the same finger. Now we see that the water drop takes the same trail! Why does it happen?  My argument: The water trail which was previously left off reduced the friction in that path by filling the gaps between the molecules. Hence the new drop tends to slide more on that path and hence ends up travelling in it.  ((This "effect" is also observed when tear drops keep rolling down in the same path. But that could just be because that path is the steepest.)) I’ve recently purchased a new Mac Mini, and I’ve been importing my old pictures into the Photos app.  I want to have these photos backed up to iCloud, along with the photos currently on my iPad. I then want everything synced to my Mac Mini, but not to my iPad, which has limited storage capacity.  Is it possible to have the Mac Mini and iPad set up to backup to iCloud, but only download backed-up photos to the desktop? I need to parse  strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type.  I have found  in the Python standard library, but it is not very convenient.  What is the best way to do this? Why can't the indefinite integral $\int\frac{\sin(x)}{x}\mathrm dx$ be found? I came across a list of functions in my calculus textbook whose indefinite integral cannot be found. It was written that the integral $$\int \frac{\sin(x)}{x} dx$$ cannot be evaluated without any explanation as to why.  I did some research over the internet and found out that the definite integral $$\int_{0}^{\infty} \frac{\sin(x)}{x} dx$$ can be evaluated using Laplace transformation and is equal to $\pi /2$. But I still couldn't find answer to my original question. I read somewhere that the integral cannot be expressed using 'elementary functions'. A little help is appreciated, I'm in Calc 1 going advanced than my course but I am sorry if my post shows lack of research. Thank you! How can I calculate sensor size (width and height) from focus length, vertical, and horizontal angle of view? How do I prevent directories mounted with 'bind' from appearing on 'Devices' on nautilus? I have these lines in the fstab   # binds /media/DataNtfs/Music           /home/can/Music                  none    rw,bind  /media/DataNtfs/Pictures        /home/can/Pictures               none    rw,bind  /media/DataNtfs/Downloads       /home/can/Downloads              none    rw,bind  /media/DataNtfs/Documents       /home/can/Documents              none    rw,bind  /media/DataNtfs/Backups         /home/can/Backups                none    rw,bind  /media/DataNtfs/Notes           /home/can/Notes                  none    rw,bind  /media/DataNtfs/Other           /home/can/Other                  none    rw,bind  /media/DataNtfs/Packages        /home/can/Packages               none    rw,bind  /media/DataNtfs/Photos          /home/can/Photos                 none    rw,bind  /media/DataNtfs/Videos          /home/can/Videos                 none    rw,bind  /media/DataNtfs/WorkSpace       /home/can/WorkSpace              none    rw,bind Java: how do I check if a Date is within a certain range? Updating a chart dynamically in Numbers Background: I've been having some sleep issues so I have started tracking my sleep habits along with some other data but so far, they are just entries in Evernote and as such it is not possible to see any patterns. Obviously I need a spreadsheet app with charting capabilities (doh!). I've been using a great iPhone app called  for data collection for sleep times and then enter those into Evernote.  I have the iWork set so I have been looking at Numbers and going through some tutorials but I still can't tell if it will do what I want. Given that my data set will increase daily, I'd like to be able to "page through" a chart/data set, so it shows say the last 30 data entries. With all the tutorials I have seen, the charts are of fixed size and adding more data to a linked table just causes the chart to cram more stuff in.  Can Numbers do this sort of "paging" of data? I would like to have this sort of "on the fly" charting rather than having to explicitly build a chart each time I want to visualize the data.   (sorry the question is rather garbled: I don't know really anything about using a spreadsheet type app) Why is this trigger finding a null value despite the field being populated? I'm trying to work with  in Java.   I want to implement arithmetic functions.  For this, I will first require a way to normalize the functions.  I know I can't add 1/6 and 1/2 until I have a common denominator. I will have to add 1/6 and 3/6.  A naive approach would have me add 2/12 and 6/12 and then reduce.  How can I achieve a common denominator with the least performance penalty?  What algorithm is best for this?    Version 8 (thanks to ):     Improvements include:         the equals() method is now consistent with the compareTo() method      final class Fraction extends Number {     private int numerator;     private int denominator;      public Fraction(int numerator, int denominator) {         if(denominator == 0) {             throw new IllegalArgumentException("denominator is zero");         }         if(denominator &lt; 0) {             numerator *= -1;             denominator *= -1;         }         this.numerator = numerator;         this.denominator = denominator;     }      public Fraction(int numerator) {         this.numerator = numerator;         this.denominator = 1;     }      public int getNumerator() {         return this.numerator;     }      public int getDenominator() {         return this.denominator;     }      public byte byteValue() {         return (byte) this.doubleValue();     }      public double doubleValue() {         return ((double) numerator)/((double) denominator);     }      public float floatValue() {         return (float) this.doubleValue();     }      public int intValue() {         return (int) this.doubleValue();     }      public long longValue() {         return (long) this.doubleValue();     }      public short shortValue() {         return (short) this.doubleValue();     }      public boolean equals(Fraction frac) {         return this.compareTo(frac) == 0;     }      public int compareTo(Fraction frac) {         long t = this.getNumerator() * frac.getDenominator();         long f = frac.getNumerator() * this.getDenominator();         int result = 0;         if(t&gt;f) {             result = 1;         }         else if(f&gt;t) {             result = -1;         }         return result;     } }     I have removed all previous versions.  My thanks to: How to deal with upvoted yet clearly wrong answers Why isn't there a potential difference across a disconnected diode? I know this question sounds silly, as if there was a potential difference a current would be created when the terminals are connected together and this would mean energy has come from somewhere.  The reason I ask this though is that from my understanding of the depletion region and built in potential of a diode it seems like if you connected a voltmeter across the whole diode it would show the value of the built in potential.  This is explained in the image below:    At first, electrons flow from the n type to the p type because there are a higher concentration in the n type, and holes do vise versa. This is called the diffusion current. The first electrons and holes to cross the pn boundary are the ones which are closest to it; these carriers recombine when they meet each other and are then no longer a carrier. This means there is a depletion region of no carriers near the pn boundary. because electrons have left the n type material, and holes have left the p type material, there is a surplus of positive and negative charge on the n and p side of the pn boundary respectively. This causes an electric field that opposes the diffusion current, and so no more electrons or holes cross the boundary and combine. In short, only the electrons and holes near the boundary combine, because after they have done that an electric field is formed that prevents any more carriers from crossing. The current due to this electric field is called drift current, and when in equilibrium this will equal the diffusion current. Because there is an electric field at the boundary (pointing from the positive charge to the negative charge) there is an associated voltage. This is called the built in potential.  If you sample the electric field at each point along the diode from left to right, you would start with 0 in the p region because there are an equal number of protons and electrons. As you approach the depletion region you would see a small electric field pointing back towards the p region, caused by acceptor impurities which now have an extra electron (due to recombination) and therefore now have a net negative charge. This electric field would increase in strength as you get closer to the boundary, and then die away as you get further away.  This electric field means there is a voltage, as shown in graph (d). The p side is at an arbitrary potential, and the n side is at a potential higher than this because there is an electric field between them. This means there is a potential difference across the depletion region; this is known as the built-in potential.  But why when I connect a volt-meter across the whole diode will I not see this built in potential? To friend vs. to befriend I am trying to host some static content in an Amazon S3 bucket and to have that content available through my own domain.  The bucket in question is called "e.tl-dr.org" and I have "index.html" set as the index document. I can visit  and I see the contents of index.html (just "test"). This works fine.  I also have added the CNAME entry for "e.tl-dr.org" pointing to "s3.amazonaws.com" from within my registrar's site. (I am not using the AWS Route 53 DNS services, which is what most tutorials about this seemed to be geared at.) So now "" correctly shows the file, but just the bare domain only gives me S3's standard 403 message.  Is there anything else I need to set up to get this working? Nouns can modify nouns: cat food, coffee cup, gold ring, laser surgery, flood insurance. It seems to me there are even cases where a noun sounds better than the corresponding adjective: sociology papers sounds a bit better than sociological papers.  Some noun-noun combinations don&rsquo;t work. You wouldn't say America gangsters or measurement spoons or greed crimes. If you spilled water on your keyboard you probably wouldn't call it a keyboard spill or even a water spill.  Are there rules that tell which combinations are acceptable? In "Tasksel" how do I select a package?