Array displaying weird info [I@63376afa I'm trying to randomly select 6 numbers for a lottery application. Then add the numbers to an array. When I try to display the information contained within the array, it returns [I@63376afa. If I display randomInt outside of an array it displays correctly, but that isn't added to an array. If I try to add randomInt to an array after the for loop has been processed I get an error Type mismatch can't convert int to int[] which makes sense.  import java.util.Random; public class PracRandom1  {     public static void main(String[] args)      {         int randomInt=0;         int[] numArray = new int[randomInt];         int[] array = new int[5];         Random randomNum = new Random();{             for (int i = 0; i &lt;= array.length; ++i){             randomInt = 1+randomNum.nextInt(6);                          System.out.println("Array Random numbers: " + numArray);             } }}}
What's the simplest way to print a Java array? In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]
Asking days badges A couple of months ago, I suggested a set of badges for . The responses were... mixed. The  can be summarized:  In practice, all this would do is encourage people to ask yet more stupid, worthless questions and we have quite enough of that as it is.  We believe that one of the main things holding back many of our beta sites is that when people have questions they aren't in the habit of asking on the site. Even our flagship site, Stack Overflow, doesn't get many questions from its most knowledgeable users. Perhaps they don't have questions, but far more likely they find answers without needing to ask. Our subtle bias against asking (questions =&gt; clueless) means we lose out on what might be our best source of excellent questions. So we went back to the drawing board and designed a badge set that should not encourage worthless questions:  Asked a well-received question on X separate days, and maintained a positive question record.  In order to award badges, we need to define our terms:  positive question record   (total questions - negative questions - closed - deleted)/total questions &gt;= 0.5  It triple counts a question that is downvoted, closed, and deleted. If you ask one that hits that trifecta, you'll need to ask three better questions to dig yourself out. My own record of asking does not meet the criteria:   (44 - 0 - 12 - 12)/44 = 0.4545...  My  looks a lot better; I had a bunch of questions from the beta period that have been subsequently (and rightfully) deleted. With care, I could bring my record into positive territory with 4 questions. The takeaway is that people can't sweep past indiscretions under the rug by deleting them. And they can recover from a bad start as long as they don't ask more bad questions.  well-received question on X separate days A well-received question is one that's open, not deleted, and has a score &gt; 0. If you ask at least one well-received question in a  and none of your questions that day are deleted, downvoted, or closed, you get one more day of credit toward the badge. Whenever the badge criteria is checked, previous asking days are re-evaluated so that there's an incentive to fix downvoted and/or closed questions. The no-deleted-questions criteria is to prevent people from asking several questions at once and deleting any that aren't upvoted or answered to ask another day. (Though this is a losing strategy in the long run.)   My proposed badge names and levels:  Asked a well-received question on 5 separate days, and maintained a positive question record.  Asked a well-received question on 30 separate days, and maintained a positive question record.  Asked a well-received question on 100 separate days, and maintained a positive question record. In addition, since some outstanding individuals ask on more than 100 days, the gold badge may be awarded multiple times. Over on English, Oishi-sama (now a ) would have a remarkable . Bronze and silver badges are only awarded once. We've decided to hold off on multiple awards for now. See the . Neither the names nor the levels nor even the descriptions are set in stone. Please play around with  to get an idea of how the badge works using our public data. Since the query does not account for deleted questions, it's a bit more generous than the actual badges would be. This version of the badge set should encourage a habit of well-received questions over time and encourage people to fix poorly received questions.  I'd like to express my gratitude to the Parenting community for participating in our . Is Poly1305 an information-theoretically secure MAC? Finding $\int \frac{dx}{a+b \cos x}$ without Weierstrass substitution. I saw somewhere on Math Stack that there was a way of finding integrals in the form $$\int \frac{dx}{a+b \cos x}$$ without using Weierstrass substitution, which is the usual technique.   When $a,b=1$ we can just multiply the numerator and denominator by $1-\cos x$ and that solves the problem nicely.   But I remember that the technique I saw was a nice way of evaluating these even when $a,b\neq 1$. It is not unusual for an Ubuntu (or other distro with apt package management) user to encounter the error: user@box ~ $ sudo apt install x [sudo] password for user:  Reading package lists... Done Building dependency tree        Reading state information... Done Package x is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'x' has no installation candidate  There have been several questions asked concerning this on various StackExchange sites,for example  on AskUbuntu, but these are generally about how to obtain the specific package despite the error. I have found no package that is not found simply (though not always easily) by determining if it is still distributed, and under which repository if so, and ensuring that repository is in apt.sources, or the worst comes to the worst downloading a .deb or source to compile. So my question is more general, and although I am guessing it has a rather simple and therefore non-exciting answer I cannot think how to find it by conventional search engine methods, so I turn to AskUbuntu: Is there a command or option I can use to determine what package / which packages reference the missing package? Area of intersection of two Annulus Given two separate annulus with centers $[C_1,C_2]$ and their corresponding radii being $[R_1,r_1]$ and $[R_2,r_2]$ respectively, larger radius being $R$. There are methods to look at whether they are overlapping or not. If they overlap how to find the overlapping area. Is there any close form expression for it?  equation of first annulus   $r_1^2&lt;(x-x_{c1})^2 + (y-y_{c1})^2 &lt;R_1^2$   equation of second annulus  $r_2^2&lt;(x-x_{c2})^2 + (y-y_{c2})^2 &lt;R_2^2$  If there are three circles overlapping, we get overlapping area as solution to set of 4 in-equations by least squares approach(Though we don't end up getting total area but, area within tangents of circles ). The possessive 's in time expressions Which is the correct answer?         I'll be there in a _____ time.       A) day or two   B) day or two's   C) day's or two's I tried to find this question somewhere else on here, and found a couple that were similar to it -- but all the answers seemed pretty convoluted, and I think it was surprising to me because I just imagined that SQL would have a way easier way to do this.  Essentially, I'm using a GROUP BY to group two values on top of each other. The coding is simple and works well, where I get these results using WITH ROLLUP at the end:  Type    Person  Count Type A  Person 1    10 Type A  Person 2    91 Type A  Person 3    13 Type A  Person 4    10 Type A  Person 5    2 Type A  NULL        126 Type B  Person 6    16 Type B  Person 7    63 Type B  Person 8    15 Type B  Person 9    22 Type B  Person 10   16 Type B  Person 11   3 Type B  Person 12   20 Type B  Person 13   44 Type B  NULL        198 NULL    NULL        360   Is there an easy way to substitute something saying if "NULL" is in the "Person" column, then make NULL AS "Subtotal" and if "NULL" is in the "Type" column, NULL AS "Grand Total?"  And if that's weirdly complicated, I'd be totally fine with just calling all of them "Total."  Thanks! I am pretty sure that this is such a stupid, stupid question, but how do you prove that $d_2(x,y)={|x-y|\over {1+|x-y|}}$ satisfying the third condition to be a metric, which is the triangle inequality.   I know that I should really be able to do this, but I just can't, I keep seeing a contradiction. Please help me. I have some doubts regarding net run rate in the ongoing ICC world twenty 20 2014 event.It takes a while to read so please don't hesitate and give me a solution regarding this.    My doubt is that in match 12 of world twenty 20 2014(In Group Stage Last Match on march 21 2014) () Wesley Barresi of Netherlands hit a six when the team score was 187 while chasing Ireland score of 189, That take Netherlands score to 193.  If that is the case in match 17 between India and West Indies in match of super10 group (in ICC world twenty 20 2014 on march 23 2014) () while Suresh Raina (India) hit a four when the team score was 129 while chasing West Indies score of 129,That takes India Only To 130. why Only One run is added to the score in this match(match 17 on march 23 2014) while 6 runs are added to the score in match 12 on march 21 2014.  I don't understand the strategy behind this.Because if India's Score is taken as 133 then India's net run rate as of now(24 march 2014) will be 0.442(Runs Scored For 264 in 38.1 overs ) But Now it is only 0.383(Runs Scored For 261 in 38.1 overs ).As the net run rate plays an important role in the tournaments like this i am not very happy with this.  As being an Indian Fan now a days I look a lot in to net run rate as it has eliminated India in many tournaments including last ICC world twenty 20 2012.  Is There Any One who can clarify my doubts regarding the net run rate as i want to be sure of what was happening? I'm trying to recall a story I read in the 1960s or 1970s, but which I suspect was older than that.  It was about a quasi-immortal family in the twentieth century who lived in a rural area and kept a low profile. It was a stand-alone story and only the family, and perhaps distant relatives, had unusual powers. I don't think they were aliens, just some offshoot of humanity.   They were of varying ages, ranging from relatively young to thousands of years old. They had lived in Europe before immigrating to the American colonies. Each person had a distinctive set of psi powers, ranging from the grandpa, pa, ma and son. I believe the youngest, just called Baby, was the most powerful and least human looking, and lived in the attic. He slept most of the time.  Nothing remains in my memory of the plot.  As I recall, the story had a Theodore Sturgeon feeling to it, with a humorous, ironic touch, but it probably wasn't his. I haven't been able to identify it from looking at a list of his works.  I probably read it in an anthology, but I might have seen it in an old magazine. I'm just not sure.  If anyone can help me identify it, I'd be grateful. Then I can scratch that mental itch. How can I convert String to Int? What HTML tags are allowed on Stack Exchange sites? This has come up    : migrating old questions causes problems.   The most popular solution to this to date has been to . This is do-able, but frankly it feels like treating a symptom, and doing so in a way that penalizes folks who answer what are by all appearances valid, on-topic questions.   Migration works best as a way to salvage good but off-topic questions and give them new life on a site where they can thrive. But shuffling old, answered, on-topic questions around for the hell of it is a waste of everyone's time.   Therefore, I think the real solution is much simpler: just disable the migration of old questions. They're rarely welcomed or heavily improved post-migration, often overtly disliked by folks on the destination site, and can end up causing a rather bad experience for folks who were participating in good faith on the original.   I suggest that questions older than 601 days should not be eligible for migration, either by normal user close-votes or by moderators. In extreme cases, we can perhaps provide an alternate means of moving old questions, but under normal circumstances these should be done quickly or not at all.   1 60 days is actually based on a  introduced this past spring: migrated and then rejected questions older than 60 days cause the authors to suddenly gain (permanent) reputation on the destination. Number of total possibilities for an equation I need to find the number of possibilities for which the following equation exists:  $$x_1 + x_2 + x_3 + \cdots + x_{10} \leq 70$$  Each variable is a non-negative integer.  I tried simplifying the question to the point of finding the number of possible solutions to each equation seperatly:  $$x_1 + x_2 + x_3 + \cdots + x_{10} = 70,$$ which is ${79}\choose{10}$.  $$x_1 + x_2 + x_3 \cdots + x_{10} = 69,$$ which is ${78}\choose{10}$.  $$x_1 + x_2 + x_3 + \cdots + x_{10} = 68,$$ which is ${77}\choose{10}$, and so forth.  Then I thought about adding all of these together. This seems a bit too much work considering that the textbook solution is: ${80}\choose{10}$, and I can't seem to figure out the idiomatic way of approaching these kind of questions.   Any help is greatly appreciated. I prefer light windows with dark menu bar as in High Sierra. However, it seems I can only choose all-dark or all-light in Mojave now. Are there any way to hybrid or customize it? I want to get the following:    I tried the following  \[    a(i,k) \leftarrow     \min\Big\{0, r(k,k) + \sum_{i^{'} | i^{'}\notin \{i,k\}}\max\{0, r(i{'},k)\}\Big\} \]   and got    How can I make the part under the summation extend to left and right without making a space between plus and max as in the first figure? How to put legend below the chart? I have the following code that produces a line chart:  \begin{figure}[p]     \centering \begin{tikzpicture}     \begin{axis}[     use units,     cycle list name=exotic, %This defines the color. It produces nicer colors         width=15cm, height=8cm,     % size of the image         grid = major,         grid style={dashed, gray!30},         %xmode=log,log basis x=10,         %ymode=log,log basis y=10,         xmin=0,     % start the diagram at this x-coordinate         ymin=0,     % start the diagram at this y-coordinate         %/pgfplots/xtick={0,5,...,60}, % make steps of length 5         %extra x ticks={23},         %extra y ticks={0.507297},         axis background/.style={fill=white},         ylabel=Time,         xlabel=Number of Datapoints (n),         y unit=s,y unit prefix=m,         tick align=outside]        % import the correct data from a CSV file       \addplot table [col sep=comma,trim cells=true,y=Best Case (Ascending)] {datasets/time_mergesort.txt};           \addplot table [col sep=comma,trim cells=true,y=Average Case (Random)] {datasets/time_mergesort.txt};                     \addplot table [col sep=comma,trim cells=true,y=Worst Case (Descending)] {datasets/time_mergesort.txt};                      \legend{Ascending,Random,Descending}     \end{axis}  \end{tikzpicture}     \caption{Mergesort Run Time for Sorting Random Data}     \label{fig:merge_sort_from_csv} \end{figure}   And at the moment the legend appears on the chart on the upper right corner. I need to move that below the chart, or even to leave that on the chart but to move that on the upper left corner.   I have tried the solution mentioned at , but it did not work for me.  How can I move the axis in a different position? How to make sure one understands each and every detail while reading a textbook/research paper without leaving any gaps? I am a physics Master's student.  I have good grades, with CGPA above 9(/10)(However, all courses in my university are graded on a curve so the actual marks are significantly lower than 90%). This has been my marks throughout my undergraduate and graduate courses and I was happy because this was above average. Also, my summer projects in UG were usually computational and any difficulty I had in theoretical aspects I attributed it to my inexperience in advanced Physics.   However, recently I have started to work on pure theoretical project and while reading for the project I realized that I consistently miss some details from each topic. I understand the general idea, can re-derive most of the equations(with some effort) however when I discuss things with my professor or when I read further topics I realize that I have missed certain key-details. This is exactly similar to the case of me missing a few key questions in my exams and getting that 9 grade point instead of 10(or at-least I think so). I was not worried about this before but now I realize that there is some flaw in the way I study (but I do not know what).   Since I want to apply for Physics PhD I realized that I will need to have solid concepts and it would be best to correct my mistakes but I do not know how or even what could be the reason for my imperfect understanding.  Any direct suggestion would help or even certain general guidelines on what I can do.    Things I've tried recently -   1) I've started to written down almost everything I read. This is slightly laborious but is certainly helping. It also helps me to gloss over the things I read previously when I come back the next day.  2) I completely avoid smartphone when I'm library/study room so that I won't get distracted. Not sure if it helps me solve the above problem but certainly helps me study better in general.  3) I've tried to read the topics from several sources. The books I am reading is somewhat like a collection of research papers and hence does not have a exercises. So I though reading from various sources might help get better ideas but it's not really helping because most other sources are too high level as an introductory text. But this will probably help me in cases where it's practical to do this.  4) Somewhat similar to point (1)- I am trying reread, whenever I can, what I've done until that point. But not sure how much this will help me in filling the gaps. I need to simulate the warning:  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!  @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!   I have two Linux machines and when I do ssh from Linux1 to Linux2, ssh accepted and reports no problem.  But because some of testing, I want to simulate the - Identification Has Changed error  So what I need to edit on the remote server in order to create the problem?  what I did until now is to change the knpwn_hosts on both machine but its not creating the problem.  I get this:   key_read: uudecode AAAAB3NzaC1y3jrzG62xyHrb3qxc9eYpg1Cp1PrRElTFfYbEHsRfTZU21S8kO5/Tq+ED8=  failed  key_read: uudecode AAAAB3NzaC1y3jrzG62xyHrb3qxc9eYpg1Cp1PrRElTFfYbEHsRfTZU21S8kO5/Tq+ED8=  failed  The authenticity of host 'ste1 (10.106.164.111)' can't be established.  RSA key fingerprint is 84:82:2b:80:ca:3f:57:c7:8c:14:44:dd:b9:70:e5:d8.  Are you sure you want to continue connecting (yes/no)? Primes dividing a polynomial Let $g(x)\in \mathbb{Z}[x]$, a nonconstant polynomial. Show that the set of primes $p$ such that $p\mid g(n)$ for some $n\in \mathbb{Z}$ is infinite.  I don't know how to start. I have tried asuming that the set is finite but i haven't reached any contradiction.