Here is my basic setup:  ArrayList&lt;String&gt; myList = new ArrayList&lt;&gt;(); myList.add("test"); String[] arr = myList.toArray(new String[myList.size()]); System.out.println(arr);   And i get the classic error: [Ljava.lang.String;@1540e19d  Can anyone explain and help me fix it?
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]
.NET - What's the best way to implement a "catch all exceptions handler" I'm wondering what the best way is to have a "if all else fails catch it".  I mean, you're handling as much exceptions as possible in your application, but still there are bound to be bugs, so I need to have something that catches all unhandled exceptions so I can collect information and store them in a database or submit them to a web service.  Does the AppDomain.CurrentDomain.UnhandledException event capture everything? Even if the application is multithreaded?  Side note: Windows Vista exposes native API functions that allow any application to recover itself after a crash... can't think of the name now... but I'd rather not use it, as many of our users are still using Windows XP. Question about probable fixed use of "what do you do?" and "how do you do?" Do we always have to use the question how do you do? fixed in greeting people? Can we ask it in other situations rather than greetings? Like when we are wondering how someone is doing the given task.  Do we always have to use the question what do you do? for asking about sojeone's job? Can we use it sonetimes instead of ** what are you doing?** How do I get my PCs to not be a bunch of murderous cretins? Most RPGs teach you that casual violence is the best solution to all your in-game problems. This is so well established a part of the vast majority of RPGs that there are entire satire RPGs like Greg Costikyan's  and John Tynes'  dedicated to showcasing the issue. Even now that the '80's anti-RPG hysteria is past, you see more sober critiques of endemic violence in RPGs in places like . In most RPGs, PCs become inured to murder and other antisocial activities very quickly, and enter the depths of depravity that wouldn't be appropriate in the worst parts of the world. Armed robbery, mass murder, and genocide become routine parts of an adventurer's day, something only stick-in-the-mud characters with the most extremely stated ethics object to. , even though it is not properly applied to just any conflict, is a PC's friend and they generally escalate any conflict in that direction. The sophistication of the gamer mindset towards introspection on this issue can be demonstrated in that the most meaningful question usually debated about in-game violence is some variant on &quot;but should we kill the noncombatant children&quot; or &quot;can we just murder people out of hand as long as they're from a typically evil race?&quot; In the real world, we generally a priori regard anyone having to have this discussion as a monster already. (P.S. The &quot;wipe out a given evil race&quot; thing isn't the point of this question; it is only mentioned to indicate that it's only &quot;that far&quot; that usually causes ethical handwringing from players, when that is a really quite extreme case and we should be uncomfortable with casual violence a lot sooner. ) What I'd like to have is a more realistic in-game treatment of conflict.  People getting wounded and giving up, taking and ransoming of prisoners, not always escalating a fistfight to weapons, not always escalating weapon combat to killing, etc.  Heck, as I write this, I'm watching an episode of Adventure Time with my daughter and the protagonists snuck in and rescued a princess kidnapped by the Ice King and then exit right next to his sleeping form. I thought, &quot;If this were D&amp;D they'd all be carefully coordinating a coup de grace to kill him in his sleep on the grounds that he inconvenienced them.&quot;  The problem isn't limited to D&amp;D of course, sci-fi PCs are happy to neutron bomb planets for convenience too, for example. I'm not part of the &quot;D&amp;D is Satanic&quot; crowd obviously, but I frankly do have compunctions about continually playing in games where the taught behavior is uncomfortably equivalent to the worst examples of human behavior we see on the nightly news. How can I give my PCs a newfound respect for human life? Beamer and pseudocode I just deleted a file on my Nexus S that I really need back. (It was actually part of an app using a sqlite database that did a drop table when upgrading to a new version.)  Presumably I need to root the phone first (which I hear is easy on Nexus phones) but am I in a catch-22 here? Namely, does rooting the phone mean wiping/overwriting the partition where the data lives?  If not, what do you recommend for data recovery tools? Presumably the file was just unlinked and not actively overwritten (per usual when "deleting" a file) so technically the data must be there... What is the population of the Star Wars Galaxy? How to add user to a group from Mac OS X command line? trying to add a user to a group from the command line but can't figure out how?   Specifically this is on Mac OS X Server 10.5.8  like to add user to 'admin' and 'wheel' groups Minimal Sufficient Statistic for location family In Casella &amp; Berger Statistical Inference,in exercise 6.8, we're asked to prove that, for any distribution belonging to the location family, the order statistics are minimal sufficient.  How does one prove this? I have no idea on how to tackle this exercise.  Any help would be appreciated. Why are the dineutron and diproton unbound? It is known that there are no diproton or dineutron nuclei.  Does this mean that two protons or neutrons are not actually attracted to each other? Even if the attraction was weak, wouldn't it cause bound states anyway?  Related: Regex for parsing directory and filename I'm trying to write a regex that will parse out the directory and filename of a fully qualified path using matching groups.  so...  /var/log/xyz/10032008.log   would recognize group 1 to be "/var/log/xyz" and group 2 to be "10032008.log"  Seems simple but I can't get the matching groups to work for the life of me.  NOTE:  As pointed out by some of the respondents this is probably not a good use of regular expressions.  Generally I'd prefer to use the file API of the language I was using.  What I'm actually trying to do is a little more complicated than this but would have been much more difficult to explain, so I chose a domain that everyone would be familiar with in order to most succinctly describe the root problem. What is the best way to filter a Java Collection? I want to filter a java.util.Collection based on a predicate. Who fired the shot and what is the symbolism in firing shot right next to Lucas at the end of the movie? At the end of , during the deer hunt, there’s a shot fired right next to Lucas (deliberately missing the shot).   Who fired the shot? Is it Theo's son? What is the meaning of that scene? Is someone warning Lucas that he made a mistake and definitely, Lucas will be punished in the future? This winter I am planning to track my downhill skiing/snowboarding using a GPS.  Most of my riding will occur at the same resort.  I would like to be able to create a sort of "heatmap" that shows the amount of runs that I have made in a given area.  As I add more and more GPS traces to my database, my goal would be to see a sort of linear heatmap of the most traveled areas.  Given the nature of downhill skiing, you would expect the uphill chairlift lines will be the "hottest" because it will be the only places visited over-and-over again.  Given that 1) my track will not be the same every time and 2) the area covered by following one "run" may be a few hundred feet wide, what might be the best way to analyze this "linear" data to create a sort of heatmap?  My thoughts were to buffer the lines, then intersect the polys to get a sort of Venn Diagram thing going.  My preference is to use open-source technologies.  I've got QGIS and PostGIS loaded and available.  UPDATE: In regards to @blah238's response, I was thinking of something that might be able to "collect" the number of passes ("runs") through an area, and then symbolize by the count.  Conceptually, this would be similar to ArcGIS "" (but for lines, not points) or  (but for multiple line in roughly the same area).  A more visual example of a similar concept might be a traffic-flow map, where highly-congested areas would equate to "highly-traveled" ski runs/areas:    I've read the following questions that may give some ideas, but they don't really address what I am trying to accomplish: Fantasy series with Celtic overtones, intermittent stone magic, and ongoing slow magic I checked this series out of the library during college, maybe 15 years ago now.    It was based around 'stone magic' – magical stones that granted their bearers enormous power.  Unfortunately, the power of these stones is intermittent, they'll fade out for a long time then fade back in.  The main characters dealt with a 'master' stone of some sort, the first to restore, last to die.  It's also the key to granting other people access to their own powers – I think seals had magic fish they swallowed, which keyed off the master stone, and in the last book I think the character created magic staves for another race. It also had 'slow magic' – longer to set up, less apparently potent than stone magic, but the slow magic, given time to work it, could still be powerful and dramatic.  It just took time and preparation instead of brute force. In one book, the main character faces off against the source (or something like that) of magic, and is about to win when it's discovered she's pregnant.  The source – a dragon? – isn't allowed to harm anyone who doesn't come to it freely, so the main character is forbidden to finish the trial.  In the sequel, her daughter repeats the trial, and becomes immensely powerful by winning, but there was a cost of some sort, something that transformed her A lot of the naming made me think it had a Celtic root. Problem with IMPORTRANGE function in Google Sheets I’m trying to get IMPORTRANGE to work for me with no success. I made two simple spreadsheets:  and . In the destination sheet I’m using the import range function:  =importrange(“1-5F1_zz0ZpGj7SfeQhewsCe0CsrA0eyPbjfmUrLBsyk”,”Sheet1!a1:a1”)   I tried already:   Replacing the , with ; Referencing just the key as well as the full URL in the first argument Switching from “ to ‘ With the sheet name and without it   Not sure what else to do.  Any ideas? What are the advantages and disadvantages of using ARC? Tweak showlabels/showkeys - wrap the label Can showlabels wrap the label in the margin? A very similar question is , but the solution of @DavidCarlisle does not solve the more general case. Consider the following MWE:  \documentclass{article} \begin{document} \begin{figure}[ht]   \centering   \rule{1cm}{1cm}   \caption{default}   \label{fig:a very very very long and detailed label} \end{figure} \end{document}   When adding the package showkeys the output is:    Similar problem occurs with the showlabels package (whether the hack of @DavidCarlisle is used or not):   So, is there a way to fix it? How to remove duplicate values from a multi-dimensional array in PHP How can I remove duplicate values from a multi-dimensional array in PHP?  Example array:  Array (     [0] =&gt; Array     (         [0] =&gt; abc         [1] =&gt; def     )      [1] =&gt; Array     (         [0] =&gt; ghi         [1] =&gt; jkl     )      [2] =&gt; Array     (         [0] =&gt; mno         [1] =&gt; pql     )      [3] =&gt; Array     (         [0] =&gt; abc         [1] =&gt; def     )      [4] =&gt; Array     (         [0] =&gt; ghi         [1] =&gt; jkl     )      [5] =&gt; Array     (         [0] =&gt; mno         [1] =&gt; pql     )  ) To whom was Yoda referring when he said, "There is another?" In the original trilogy Yoda refers to another hope:     Obi-Wan: "That boy is our last hope."   Yoda: "No...there is another..."   The assumption being after seeing Return of the Jedi (Episode VI) that the other was Leia.  If, however, you consider the prequel trilogy canon, then this assumption depends greatly on your point of view*. Obi Wan knows about Leia (and for unknown reasons has discounted her as a hope), so Yoda must be referring to someone or something else.  Is there any canonical source as to what Yoda meant, or was uncle George setting us up for Episode VII?  *as a wise man once said      you will find that many of the truths we cling to depend greatly on   our own point of view.   Just to add a bit of clarity: I was thinking about who Yoda was referring to when he was talking to Obi-Wan. When talking to Luke, it is obvious that Leia is the other (as he talks about a 'Skywalker'). It is not so obvious (after watching the prequel trilogy) that he means it when talking to Obi-Wan. I want to put a link to my SO profile on my homepage. I remember a codesnippet i saw somewhere that would basically display my Username and my reputation. Where was that?