Java "NullPointerException" while trying to print array elements
What is a NullPointerException, and how do I fix it?
How to delete a non-empty directory in Terminal? How do I delete the following directory?  I typed:  rmdir lampp   This error comes up:  rmdir: failed to remove `lampp': Directory not empty   Is there a command to delete all the files in the directory and delete the directory folder? I have a Laars gas boiler that has 3 heating zones. I want to replace the old mercury honeywell tstat on the 1st floor (heat only) with a newer honeywell RTH9580 wifi model. I've taken pictures of my entire system, labeled the wires in the pics to indicate the associated connections, and included the Laars wiring diagram.  There is a transformer mounted on the wall near the boiler that is wired in-line to the system (power from the panel --> into the emergency boiler switch --> into the wall transformer --> then to the boiler (low water cut off and boiler circuitry).  There is also a transformer within the boiler circuitry itself.  Can someone tell me the best method (proper preferred, not necessarily easiest) to connect the C wire? Where Android apps store data? A secant inequality for convex functions Why is my Wi-Fi connection speed much slower than a wired connection? When I plug my laptop via LAN cable and check speed on speedtest.net I have over 32 Mb/sec. When I unplug the cable and connect to the same router I have less than 15 Mb/sec. I tried to change channels already but this didn't help. I'm sitting just near the router.   What can it be? The router is a Dlink 400. Number Theory: which primes are a sum of two squares? Problem: show that if the prime $p = a^2 + 5b^2$ then $p \equiv 1 \textrm{ or } 9 \pmod{20}$.  Is there any other way to prove this other than to check each case $p = 1, \ldots, 19 \pmod{20}$ and show that only 1 and 9 work? Size of VARBINARY field in SQL Server 2005 I am trying to determine the size in bytes of the contents in a VARBINARY(MAX) field in SQL Server 2005, using SQL. As I doubt there is native support for this, could it be done using CLR integration? Any ideas would be greatly appreciated. How can I safely create a nested directory in Python? integral of $\int_{0}^{1}\frac{\ln(x^{2}+1)}{x+1}dx$ using contour integration? I have an interest in contour integration. I am not that good at it, but I enjoy learning what I can about it.  Here is a version of a rational log integral rarely encountered.  $\displaystyle \int_{0}^{1}\frac{\ln(x^{2}+1)}{x+1}dx=\frac{3}{4}\ln^{2}(2)-\frac{{\pi}^{2}}{48}$  I can do this using real methods (via double integral and substitution). I can post my workings if anyone would be interested.  My question is, can this be evaluated using contour integration due to the limits being $[0,1]$ instead of $[0,\infty)$?.  Contours may not be the most efficient way to go about it, but what is the course of action when the limits are 0 to 1 instead of 0 to infinity?. Android and getting a view with id cast as a string There's more gravitational force in our galaxy (and others) than can be explained by counting stars made of ordinary matter. So why not lots of dark planetary systems (i.e., without stars) made of ordinary matter? Why must we assume some undiscovered and unexplained form of matter? Payment from Apple for developer In the first book, Harry sees his Gringotts vault for the first time.  (Quotes thanks to Slytherincess!)     Griphook unlocked the door. A lot of green smoke came billowing out, and as it cleared, Harry gasped. Inside were mounds of gold coins. Columns of silver. Heaps of little bronze Knuts.      "All yours," smiled Hagrid.      All Harry's -- it was incredible. The Dursleys couldn't have known about this or they'd have had it from him faster than blinking. How often had they complained how much Harry cost them to keep? And all the time there had been a small fortune belonging to him, buried deep under London.      Hagrid helped Harry pile some of it into a bag. "The gold ones are Galleons," he explained. "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enough. Right, that should be enough fer a couple o' terms, we'll keep the rest safe for yeh."      Harry Potter and the Sorcerer's Stone - pages 58-59 - US Hardcover Edition   Jk Rowling posts in the Harry Potter Lexicon      JKR has stated in an interview (Comic Relief 2001) that she estimates the value of one Galleon to be "about five pounds," which works out to around US$9.75 (the exchange rate at the time of the interview was US$7.33). In the introduction to both QA and FB, US$250-million is stated to be the equivelent of 34 million Galleons. That also works out to a value of £5 to the Galleon, at the exchange rate of the time. The price listed on the back of the books, however, is not correct, since US$3.99 would equal less than half a British pound, or 8 sickles and 15 knuts. The book instead incorrectly lists US$3.99 as being equal to 14 sickles and 3 knuts. (Unfortunately, CNN.com uses this incorrect value for their Knuts-to-dollars converter.)      This gives us approximate values as follows:      1 bronze Knut = £0.01 (US about 2 cents)      1 silver Sickle = £0.29 (about US$0.57)      1 Galleon = £5.00 (more or less US$9.75)      These rates vary as the exchange rate fluctuates - see the Wizarding World Currency Converter for the current rate.   Now looking at the quote      Hagrid helped Harry pile some of it into a bag.   and     Right, that should be enough fer a couple o' terms, we'll keep the rest safe for yeh.   Obviously "some" is unspecified, but presuming the costs of ...     Typical elementary-school textbooks cost more than $100 each   He would be carrying at least 10 galleons for each school book, and going by the list of books just for his first year,  (Thanks Ibid!)     COURSE BOOKS      All students should have a copy of each of the following:         The Standard Book of Spells (Grade 1) by Miranda Goshawk   A History of Magic by Bathilda Bagshot   Magical Theory by Adalbert Waffling   A Beginners’ Guide to Transfiguration by Emeric Switch   One Thousand Magical Herbs and Fungi by Phyllida Spore   Magical Drafts and Potions by Arsenius Jigger   Fantastic Beasts and Where to Find Them by Newt Scamander   The Dark Forces: A Guide to Self-Protection by Quentin Trimble         (Harry Potter and Philospher's Stone, Chapter 5)   That's 80 Galleons just for books. This does not include the list of other expenses Harry has for his school years (wand, potion reagents, etc.)  How many Galleons is "some" or is Diagon Alley selling supplies for third world prices?  Sidenote, is this just a case of bad JK maths? How do I remotely wake my Mac over Wi-Fi? In a couple weeks, I will have a long layover in Cairo on a trip from Mumbai to Toronto. I get to Cairo on Sunday at noon and leave for Toronto on Monday at about 1 AM.  I am travelling on EgyptAir business class. While browsing for people who have experiences with a similar itinerary, some people seemed to have said they they were put up ina  hotel by the airline. However, I did not see anything about this when I booked my ticket.   allows me to enter my status (i.e. citizenship etc.) which results in a .  It doesn't appear like I need a transit visa- however it specifies that:     Leaving the airport is permitted for passengers with transit time   between 6 and 12 hours   My transit time 13.5 hours.  Now for my questions:   Is it an issue that my transit time is longer than 12 hours? Can I still leave the airport? What are my options with regards to airport hotels, etc.? Any other recommendations about how I could best utilize my time while in Cairo? What are the differences between executing shell scripts using "source file.sh", "./file.sh", "sh file.sh", ". ./file.sh"? Automatically open ICS files in Google Calendar Does anyone know if there is an API to get the current monitor state (on or off) in Windows (XP/Vista/2000/2003)?  All of my searches seem to indicate there is no real way of doing this.    tries to use  which according to Microsoft's docs does not work for display devices.   In Vista I can listen to  but I do not seem to get events when the monitor is turned off manually.   In XP I can hook into WM_SYSCOMMAND SC_MONITORPOWER, looking for status 2. This only works for situations where the system triggers the power off.   The WMI Win32_DesktopMonitor class does not seem to help out as well.   Edit: Here is  on comp.os.ms-windows.programmer.win32 indicating there is no reliable way of doing this.   Anyone else have any other ideas? How to prove the existence of $b$ in $Q$ such that $a<b^2<c$ in $Q$? Flagging a deleted answer results in a message saying I am flagging too quickly