NullPointerException when trying to access ArrayList from other class
What is a NullPointerException, and how do I fix it?
iPhone asks 'Trust This Computer' again (I am on macOS 10.14.6 and iOS 12.4)   I am certain that I have trusted my Mac before. Without the latter trust, I can also access the phone in iTunes.   I have tried reset "Location and Privacy" on my phone. Then   When connecting the iPhone with iTunes running, it asks for the trust and I trust it.  Reboot my Mac and the phone asks for another trust.   Is there some known malware mimics system behavior and steal data from an iPhone?  (I do have installed some pir*ted software recently. That's my fault.) How do I install Adobe Air using "Ubuntu Software Centre" I tried:   Launching Ubuntu Software Centre I typed in "air" and found "adobe air" It says "available from the 'maverick-partner' source. and has a button "use this source" I clicked "use this source", I saw a "in progress (1)" icon come up in the side bar, and disappear, but nothing happened/changed.   I'm stuck.  I have actually already added the maverick-partner source to apt so I could install sun-java6-jdk. What was the purpose of banning use/development of cloaking technology in Treaty of Algeron? The  prohibited the development or use of cloaking technology by the Federation. This treaty was a peace treaty and use of cloaking technology in one's own space couldn't disturb peace. Plus, the Romulans already had cloaking technology, so banning it was unfair for the Federation. So, why was this ban introduced?  Another thing: There were many things to ban, but why cloaking technology? Why do we say the following?        I'll have an hour's wait at the airport      Today's lesson      Yesterday's programme    Two weeks' worth of groceries.      They are not possessive, or are they? Why is the possessive apostrophe used with time expressions and adverbs? How do we escape the cycle of bad college eating? Mouseover text: And yet I never stop thinking, 'sure, these ingredients cost more than a restaurant meal, but think how many meals I'll get out of them! Especially since each one will have leftovers!'    Randall Munroe really hit the nail on the head with this comic and especially the mouseover text. There's this sort of cycle that I seem to follow when I try cooking, and I need to get my way out of it. It goes like this:   Decide I should cook something. Thumb through my recipe books, find one or two recipes I like. Write down the ingredients for the recipes in a list. Go to the grocery store, stumble around for a while and eventually find exactly those ingredients. Go back home; at some point in time soon after, cook each recipe. Whew, that was a lot of work! Spend the next week or two eating junk again, until I decide I should cook something. (repeat)   Very similar to the comic; sometimes I too let the leftovers go bad (usually not). And every time I rack up a huge bill at the supermarket and think to myself it's justified because of the leftovers or the amount of food. Not to mention, that's a lot of work for just a couple of meals, and a long list of ingredients.  I love cooking fresh meals but that's just so much overhead and so time consuming! So I always resort back to Easy Mac, Ramen, frozen dinners and frozen pizza. Yuck.  How can I escape this cycle and cut down on the overhead? How can I focus on more than 2 recipes at a time without buying giant lists of ingredients and spending tons of money? Is it really worth the trouble or should I just chock it up to being a college student and wonder about the years ahead of me where I'll have much more time to spend cooking one meal at a time? How to diagnose computer lockups and freezes? I built a desktop computer a couple years back with the following specs:  CPU: Intel  Yorkfield 2.5GHz 6 MB L2 Cache LGA 775 95W Quad-Core Processor BX80580Q9300 Motherboard:  LGA 775 NVIDIA nForce 680i SLI ATX Intel Motherboard Video Card: Two  GeForce 8600GT SCC 256 MB 128-bit GDDR3 PCI Express x16 SLI Supported Video Card PSU: SeaSonic S12 Energy Plus  ATX12V V2.3 / EPS12V V2.91 SLI Certified CrossFire Ready 80 PLUS Certified Active PFC Power Supply Memory: Two G.SKILL 4 GB (2 x 2 GB) 240-Pin DDR2 SDRAM DDR2 800 (PC2 6400) Dual Channel Kit Desktop Memory   Since its inception, the machine has periodically locked up, the regularity having varied over the years from once a day to once a month. Typically, lockups happen once every few days. By &quot;lockup&quot; I mean my computer just freezes. The screen locks up, I can't move the mouse. Hitting keys on my keyboard that normally turn LEDs on or off on the keyboard (such as Caps Lock) no longer turn the LEDs on or off. If there was music playing at the time of the lockup, noise keeps coming out of the speakers, but it's just the current frequency/note that plays indefinitely. There is no BSOD. When such a lockup occurs I have to do a hard reboot by either turning off the computer or hitting the reset button. I have the most recent version of the NVIDIA hardware drivers, and update them semi-regularly, but that hasn't seemed to help. I am currently using Windows 7 x64, but was previously using Windows Server 2003 x64 and having the same lockup issues. My guess is that it's somehow video driver or motherboard related, but I don't know how to go about diagnosing this problem to narrow down which of the two is the culprit.  Additional information re: cooling Regarding cooling... I've not installed any after-market cooling systems aside from two regular fans I scavenged from an older computer. The fan atop the CPU is the one that shipped with it. One of the two scavenged fans I added it located at the bottom tower of the corner, in an attempt to create some airflow from front to back. The second fan is pointed directly at the two video cards.  SpeedFan installation and readings Per studiohack's suggestion, I installed , which provided the following temperature readings:  GPU: 63C GPU: 65C System: 76C CPU: 64C AUX: 36C Core 0: 78C Core 1: 76C Core 2: 79C Core 3: 79C   Update #3: Another Lockup :-( Well, I had another lockup last night. :-( SpeedFan reported the CPU temp at 38 C when it happened, and there was no spike in temperature leading up to the freeze. One thing I notice is that the freeze seems more likely to happen if I am watching a video. In fact, of the last 5 freezes over the past month, 4 of them have been while watching a video on Flickr. Not necessarily the same video, but a video nevertheless. I don't know if this is just coincidence or if it means anything. (As an aside, each night before bedtime my 2 year old daughter sits on my lap and watches some home videos on Flickr and, in the last month, has learned the phrase, &quot;Uh oh, computer broke.&quot;)  Update #4: MemTest86 and 3DMark06 Test Results: Per suggestions in the comments, I ran the MemTest86 overnight and it cycled through the 8 GB of memory 5 times without error. I also ran the 3DMark06 test without a problem (see my scores at ). So... what now? :-) Any further suggestions on what to check? Is there some way to get a stack trace or something when the computer locks like that? Resolution I have never did figure out the particular problems, but based on the suggestions here and elsewhere, I'm presuming it was a motherboard issue. In any event, I recently upgraded my system, buying a new motherbeard, PSU, CPU, and RAM, and that new rig has been working splendidly the past several weeks. I am using the same graphic cards as in the old setup, so I think it's safe to reason that they weren't the cause of the problem. Why "What's up"? Why's &quot;what's up&quot; used as greeting among young people? It sounds like asking &quot;what is up there&quot;?  A: What's up? B: The sky. Should I always use a comma after "e.g." or "i.e."? It seems that "e.g." is always followed by a comma but "i.e." is not. Why is that? Assume you have some objects which have several fields they can be compared by:  public class Person {      private String firstName;     private String lastName;     private String age;      /* Constructors */      /* Methods */  }   So in this example, when you ask if:  a.compareTo(b) &gt; 0   you might be asking if a's last name comes before b's, or if a is older than b, etc...  What is the cleanest way to enable multiple comparison between these kinds of objects without adding unnecessary clutter or overhead?   java.lang.Comparable interface allows comparison by one field only Adding numerous compare methods (i.e. compareByFirstName(), compareByAge(), etc...) is cluttered in my opinion.   So what is the best way to go about this? Is there a reason the British omit the article when they "go to hospital"? When I look at the definition given from the Mac OS X Dictionary (I have set American English as interface language, and the dictionary used is then the New Oxford American Dictionary), I read:     the /ði/ /ð(ə)/ /ði/ [called the definite article]   adjective   1. denoting one or more people or things already mentioned or assumed to be common knowledge: what's the matter? | call the doctor | the phone rang. Compare with a.   • used to refer to a person, place, or thing that is unique: the Queen | the Mona Lisa | the Nile.   • informal denoting a disease or affliction: I've got the flu.   • (with a unit of time) the present; the current: dish of the day | man of the moment.   • informal used instead of a possessive to refer to someone with whom the speaker or person addressed is associated: I'm meeting the boss | how's the family?   • used with a surname to refer to a family or married couple: the Johnsons were not wealthy.   • used before the surname of the chief of a Scottish or Irish clan: the O'Donoghue.   I have never thought of an article as adjective. Is normally an article defined as adjective? Is there a deb package to install Firefox ESR? I would like to have  on my system but I would like to install it via apt-get. Is there a special package to install this?  Download link would be: Rendering of Favorite/Ignored Tags in Firefox I have spotted a bug in rendering of Favorite Tags and Ignored Tags section in Firefox. This rendering issue is present on both stackoverflow.com and meta.stackoverflow.com sites.  I'm using Firefox 17.0.1 on Windows 7 x64. In Google Chrome page is rendered correctly.  Screenshots:  Firefox (please note cropped right part of both Add buttons)    Chrome (buttons are rendered correctly) Independence of points from same underlying function I have a function $y=sin(x)$  I sample the points $ x_i=\{0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1\}$ and $$ y_i=sin(x_i) + \epsilon \  \ \epsilon \sim iid\ Normal$$  Now given only the set $\{x_i,y_i\}$ I want to uncover the underlying functional form $f(x)$ given as  $$y=f(x)+\epsilon \ \ \ \ \epsilon \sim iid\ Normal  $$  My question is : ARE $y_i$'s independent ?  My intuition is that $y_1$ and $y_2$ are not independent. This is because given a new ${x}$ say ${x_\star}$ we can use $y_i$'s to learn some information about ${y_\star}$.   Does the fact that the input points come from the same underlying function make them somehow correlated or posses commonalities ? and if not why do most methods (ex: Non-parametric splines, Gaussian process) use the $y_i$'s to get information and learn ${y_\star}$ ? Isn't the fact that if samples are independent then they can't learn new information from each other ? Prove that if $ f\mathrm{(}z\mathrm{)} $ is analytic at the infinity  ,then :  $ {\lim}_{{z}\mathrm{\rightarrow}\mathrm{\infty}}{f}\prime{\mathrm{(}}{z}{\mathrm{)}}\mathrm{{=}}{0} $ $ a+b+c+d=6 , a^2+b^2+c^2+d^2=12$ $\implies$ $ 36 \leq 4(a^3+b^3+c^3+d^3)-(a^4+b^4+c^4+d^4) \leq48 $ Let $a , b, c, d$ be real numbers such that $$ a+b+c+d=6 \\ a^2+b^2+c^2+d^2=12$$  How do we prove that $$ 36 \space \leq\space 4(a^3+b^3+c^3+d^3)-(a^4+b^4+c^4+d^4) \space\leq48\space$$ ? I would like to know what would be the best way to do unit testing of a servlet.   Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use of session parameters?  Is there a way to do this simply using classical tools such as JUnit, or preferrably TestNG? Did I need to embed a tomcat server or something like that? When using complete sentences in parenthetical e.g. or i.e. situations, should the first word be capitalized? In a bulleted list of very technical sentences, where each bulleted item has one or two parenthetical examples or restatements which are complete sentences, should the first letter of each e.g. or i.e. sentence be capitalized or not?  Example:   Here is my technical sentence. (e.g., Should the first word of this e.g. be capitalized like this?) Here is another technical sentence.  (i.e., this really isn't a i.e. different example to highlight whether the first word should or should not be capitalized after a parenthetical i.e.) Prove that $1+\frac{1}{3}+\frac{1\cdot 3}{3\cdot 6}+\frac{1\cdot 3\cdot 5}{3\cdot 6 \cdot 9}+.........=\sqrt{3}$ Prove that $$1+\frac{1}{3}+\frac{1\cdot 3}{3\cdot 6}+\frac{1\cdot 3\cdot 5}{3\cdot 6 \cdot 9}+.........=\sqrt{3}$$   $\bf{My\; Try::}$ Using Binomial expansion of  $$(1-x)^{-n} = 1+nx+\frac{n(n+1)}{2}x^2+\frac{n(n+1)(n+2)}{6}x^3+.......$$  So we get $$nx=\frac{1}{3}$$ and $$\frac{nx(nx+x)}{2}=\frac{1}{3}\cdot \frac{3}{6}$$  We get $$\frac{1}{3}\left(\frac{1}{3}+x\right)=\frac{1}{3}\Rightarrow x=\frac{2}{3}$$  So we get $$n=\frac{1}{2}$$  So our series sum is $$(1-x)^{-n} = \left(1-\frac{2}{3}\right)^{-\frac{1}{2}} = \sqrt{3}$$  Although I know that this is the simplest proof, can we solve it any other way someting like defining $a_{n}$ and then use Telescopic sum.  Thanks. Profile Bug - Reputation Summary Not Displaying All Lines