So I am having trouble trying to loop through an array list but i dont want to use a println statement to print the elements from the array list. Is it possible if i could store all the elements into a local variable through each loop and then return the local variable when i call the method later on?e Here is my code:  public String displayProperties() {         String property = null;         for (int i = 0; i &lt; properties.size(); i++) {             property = properties.get(i);         }         return property;          }
I have an ArrayList that I want to output completely as a String. Essentially I want to output it in order using the toString of each element separated by tabs. Is there any fast way to do this? You could loop through it (or remove each element) and concatenate it to a String but I think this will be very slow.
Binary search (bisection) in Python Is there a library function that performs binary search on a list/tuple and return the position of the item if found and 'False' (-1, None, etc.) if not?  I found the functions bisect_left/right in the , but they still return a position even if the item is not in the list. That's perfectly fine for their intended usage, but I just want to know if an item is in the list or not (don't want to insert anything).  I thought of using bisect_left and then checking if the item at that position is equal to what I'm searching, but that seems cumbersome (and I also need to do bounds checking if the number can be larger than the largest number in my list). If there is a nicer method I'd like to know about it.  Edit To clarify what I need this for: I'm aware that a dictionary would be very well suited for this, but I'm trying to keep the memory consumption as low as possible. My intended usage would be a sort of double-way look-up table. I have in the table a list of values and I need to be able to access the values based on their index. And also I want to be able to find the index of a particular value or None if the value is not in the list.  Using a dictionary for this would be the fastest way, but would (approximately) double the memory requirements.  I was asking this question thinking that I may have overlooked something in the Python libraries. It seems I'll have to write my own code, as Moe suggested. What's the difference between STDIN and arguments passed to command? Blaise Pascal's famous wager was that even if the existence of God cannot be determined through reason, a rational person should wager as though God exists, because living life accordingly has everything to gain, and nothing to lose.  What logical flaws and/or fallacies (if any) are committed in making this argument? I thought it was by Heinlein or Brown, but if it was I can't locate it online.    The plot was aboard a spaceship, or maybe a space station, when an accident sends the astronauts spinning out of control towards certain doom.  One part of the story I remember distinctly was the one of the guys started screaming inconsolably and the noise was driving everyone crazy.  One of the astronauts made his way over to the guy and smashed his helmet so the screaming stopped.  As I recall, the story ends with the narrator turning off his comm link so he can ponder the beauty of the universe in silence.  Sound familiar to anyone? Propagate all arguments in a bash shell script As a mod when should I vote to close content that is not flagged? How did this person gain possession of the Infinity Stones? Throughout the Star Wars saga, no matter the era, no matter who's broadcasting, blue holograms are exceedingly common.       Additionally, Snoke's hologram occasionally flashes blue.    However, multi- and full-color holograms do exist.      If these more advanced holograms exist, why aren't they more commonly used? And what exactly makes the holograms blue in the first place? Can one preserve food by periodically heating it? I get that keeping food temperature low will slow down chemical reactions and preserve food, but sometimes my sister preserves food by heating it every 6 hours or so (up to 1-2 days). Does this help preserving the food? If yes, how does it work?  If it matters, the food currently in question is , but I would appreciate a general explanation. In case anyone is wondering, she doesn't store it in the fridge because it is full. Windows 7 System process reading/writing like crazy I have a problem that my windows 7 computer sometimes starts accessing the disk like crazy for maybe 10 minutes at a time. The process in question is the "system" process. I have disabled superfetch and hibernation on my computer, if that makes any difference. I disabled those to see if they were the cause of the problems, but no change. I have 6 GB of RAM and only the web browser was started when I took the screenshot, so I don't think it was thrashing due to page faults.  Any ideas on how to find the cause of this? Adding boolean yes/no field in ArcGIS Desktop? How does one add a field to an ArcGIS feature class with a boolean data type? That is an attribute where the allowed value is only one of a pair such as 1/0, Yes/No, On/Off, Present/Not-present, etc.   A boolean data type is not available in the Data Type pick-list. Update SQL Server table with local data What should a main game loop do? Generally, what are the core things that one should do in the game loop, and what are some things that one shouldn't do in the game loop? How can I change xfce bottom panel to the top? I am using Xubuntu 12.10 and would like to change the panel which is currently on the bootm to the top.  This is the opposite of what most people using Unity want to do.    I have done this in the past but have forgotten how and could not find the info easily this time. Cheers, To show: $(\mathbb{Q},+)$ is not isomorphic to $(\mathbb{R},+)$  Now, the equation $x^{2} =3$ has a solution in $\mathbb{R}$, but not in $\mathbb{Q}$.  Hence they are not isomorphic to each other.  Is that right, or do I need to prove something else?  Thanks. I am trying to identify a sci-fi movie from the 80's or 90's, with the following parameters:  Setting:    Scenes of a red desert planet   Culture:    Either people roam fairly solo and try to acquire resources to survive, or you live in a weird society where if a stranger is captured he needs to play in a game of fight to the death.  Mobility:      One foil character has a giant battle-bot-looking tank as his form of transportation through the desert. Protagonist has a car that has a plastic half bubble on top to look out from.   Robot:      The protagonist runs around in the beginning of the film with a female robot/android whose face is melted off after it has acid touch its face.(This scene happens next to the protagonist's rover)  Love interest:      Somehow protagonist comes across female protagonist in desert. She smells really bad and is hungry. They sleep outside, and he tells her to sleep away from him. He uses a thermal blanket(the first I ever saw in my life). She wakes up next to him, smelling horrible. He bathes her in some water hole they find(as if water were not scarce and they could just waste water.)   Pupa monsters:      Scene where they are in a building and they are trying to get out. They come across a room that is white, in which multiple giant, white, snot, pupa are hanging securely from the ceiling. Through curiosity, they disturb them, and now they have to get out of that room fast.  Boss Antagonist:      Pervert bionic man, that is actually attached to a giant robotic arm, as only form of movement. He is in black and has a pale bald head as his most human looking part. How to create vector graphics In Photoshop? I know people prefer using CorelDraw or Adobe Illustrator, but I want to know if there is a technique I can follow to use Adobe Photoshop to make vector Images. Is there an English term for "L'esprit de l'escalier"? I want to exclude certain local folders with Google Drive but I *keep* them on the computer Using Google Drive on Windows (although I think the same question applies to OS/X) I want to exclude certain local folders but keep them on the computer.  When I go to Drive preferences and deselect specific folders, it wants to remove them from the local PC and keep them only in the cloud.  This doesn't work for me.  I feel like I could do this in earlier versions of the Google Drive client but I cannot recall for sure.  Is this possible? Proving an infinite number of primes of the form 6n+1