int playerNum,cardNum; Cards card=null;           for(playerNum=0;playerNum&lt;=NUMPLAYERS-1;playerNum++) {      //some code...                  for(cardNum=1;cardNum&lt;=5;cardNum++)     {      card=( deckOfCards.deal() );       players[playerNum].setHand_1by1(card);//I get NullPointerException for using the method here                       //some code...                          } }   class Hand  {      private Cards[] hand=new Cards[5];      private int counter;            //no constructor, just a setter.      public void setHand_1by1(Cards card)      {          if(counter&gt;=hand.length)          {              System.out.printf(&quot;Hand is full&quot;);          }          else          {              hand[counter]=card;              counter++;          }               } //some code... }  I understand that you get a NullPointerException when you try to dereference something that's pointing to nothing(ie null). 1)But card of Cards type is pointing to something due to the method deckOfCards.deal() so that's not the problem, must be something in the method. 2)In the setHand_1by1(), hand[counter] is of Cards type.  All I did was make it point to valid memory containing data of Cards type in the else block. Why am I then getting a NullPointerException error? Edit: Just showing how I created my players: Hand[] players=new Hand[NUMPLAYERS];
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Do you have tips or a guide how to install Ubuntu in Microsoft Virtual PC?  I have found some (older) information, but I wonder if this is still valid. And it looks very "unfriendly". How do I find out which DOM element has the focus? I would like to find out, in JavaScript, which element currently has focus. I've been looking through the DOM and haven't found what I need, yet. Is there a way to do this, and how?  The reason I was looking for this:  I'm trying to make keys like the arrows and enter navigate through a table of input elements. Tab works now, but enter, and arrows do not by default it seems. I've got the key handling part set up but now I need to figure out how to move the focus over in the event handling functions. python: restarting a loop i have:  for i in range(2,n):     if(something):        do something     else:        do something else        i = 2 **restart the loop   But that doesn't seem to work. Is there a way to restart that loop?   Thanks $a\mid b,c\mid d\Rightarrow\,\gcd(a,c)\mid \gcd(b,d)$ So far I have that $a|b$ implies $b=ax$ for some x in the integers and $c|d$ implies that $d=cy$ for some y in the integers.  From here I can see that $gcd(a,c)|gcd(b,d)$ is logically equivalent to $gcd(a,c)|gcd(ax,cy)$ but I am not sure where to go from there. My lecturer has used some notation that I've never seen before: it is a (matrix) product symbol with a left-to-right arrow over the top. Does anybody know what this means?  Thanks in advance.  Edit: It looks like this: My question is how I can intergrate Salesforce with different FTP servers in real time. I have read some articles about it, but to be absolutely sure I thought it would be a good idea to post a question here.  I want to be able to send and receive data from Salesforce as a csv file to a ftp server. How I'm thinking about doing this is listed below.  Send the data:  Create a apex class which query the necessary data in Salesforce and create a csv file. I guess this is trivial? Then send the file to a web service created in Salesforce, just by calling it in the apex code. Create a web service in Salesforce which receives the data from the apex code. This web service should in some way send the data to the appropriate ftp server. I guess I can simply modify some of the code provided by Salesforce to make this work? The file is sent. Receive the data  This one is a bit trickier. I guess I have to pull the data from the FTP server by using my web service, which then send the file collected to the appropriate apex class. Or, the FTP server could send the data to the SFDC web service, I don't know if this is possible? The web services on the other side that sends the data to the ftp server, could send it directly to the SFDC web service, which then again forward it to the apex class. I guess the web service will use the remote site url to connect to the SFDC web service? Using 3rd party Python modules I'm currently developing a script for Blender to handle Mesh Frequency Decomposition.  The script is nearly complete, but i need one more thing: The SciPy library to compute eigenvalues and eigenvectors.  Following the installation instructions on , I'm able to install it as well as Numpy. Numpy works fine, but I can't even import SciPy:  Traceback (most recent call last): File "/CAF_FD.py", line 4, in &lt;module&gt; ImportError: No module named 'scipy' Error: Python script fail, look in the console for now...   By the way, I'm working on Linux 64 bit and I've installed SciPy and Numpy with my package manager.  Edit: When I try to use SciPy with a terminal prompt, it works. Reordering polygon shapefile permanently? I am a newbie in linux and I don't know how to open the Ubuntu Software Center via Terminal!! Please help Give each NodeJs Process a name in Windows TaskList Create UEFI bootable USB stick to install Windows AND Ubuntu from it I know how to make a UEFI bootable stick to install Ubuntu (explained ) and I know how to make one to install Windows 7 (, sorry). I guess for Win 8 the procedure would be similar, but I haven't looked into it.  I also know how to make a legacy bootable stick from which I can install Windows and Ubuntu using YUMI. I have failed so far though at creating a UEFI bootable stick that can do this. When I do a UEFI boot from my YUMI multiboot stick it gives me no option to choose between Ubuntu and Windows (hardly surprising I guess) and instead simply UEFI boots Windows (which I find kind of surprising to be honest but maybe this is due to the fact that I added the Windows image after the Ubuntu image and this simply replaced Ubuntu's EFI boot files).  So how would I proceed to create such a bootable stick? Duo of alien xenologists study couple of Terran explorers, later save them Skipping Iterations in Python I have a loop going, but there is the possibility for exceptions to be raised inside the loop. This of course would stop my program all together. To prevent that I catch the exceptions and handle them. But then the rest of the iteration runs even though an exception occurred. Is there a keyword to use in my except: clause to just skip the rest of the current iteration? If a series converges, then the sequence of terms converges to $0$. nginx open reverse proxy? Somehow, and I'm not sure how, we have configured an nginx reverse proxy that is acting as an open proxy.  The log files tells us the matching requests are going against the following conf file:  map $http_upgrade $connection_upgrade {         default upgrade;         ''      close; }  access_log      /var/log/nginx/access.p.log; error_log       /var/log/nginx/error.p.log;  proxy_next_upstream     error timeout invalid_header http_500 http_502 http_503 http_504; proxy_buffers           8 32k; proxy_buffer_size       64k; proxy_http_version      1.1; proxy_set_header        Host            $host; proxy_set_header        X-Real-IP       $remote_addr; proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect          off; proxy_set_header        Upgrade         $http_upgrade; proxy_set_header        Connection      $connection_upgrade;  server {         listen          80;         server_name     ~first.*\.second\.com;          location / {                 resolver                172.16.1.1 172.16.1.2;                 proxy_pass              http://$host;                 proxy_read_timeout      7200s;         } }  server {         listen          443;         server_name     ~first.*\.second\.com;         ssl             on;          location / {                 resolver                172.16.1.1 172.16.1.2;                 proxy_pass              https://$host;                 proxy_read_timeout      7200s;         } }   The top-level conf file looks like this:  user nginx; worker_processes 8; pid /var/run/nginx.pid;  events {         worker_connections 4096;         # multi_accept on; }  http {      ##     # Basic Settings     ##      sendfile on;     tcp_nopush on;     tcp_nodelay on;     keepalive_timeout 65;     types_hash_max_size 2048;     # server_tokens off;      # server_names_hash_bucket_size 64;     # server_name_in_redirect off;      include /etc/nginx/mime.types;     default_type application/octet-stream;      ##     # Logging Settings     ##      access_log /var/log/nginx/access.log;     error_log /var/log/nginx/error.log;      ##     # Gzip Settings     ##      gzip on;     gzip_disable "msie6";      # gzip_vary on;     # gzip_proxied any;     # gzip_comp_level 6;     # gzip_buffers 16 8k;     # gzip_http_version 1.1;     # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;      ##     # nginx-naxsi config     ##     # Uncomment it if you installed nginx-naxsi     ##      #include /etc/nginx/naxsi_core.rules;      ##     # nginx-passenger config     ##     # Uncomment it if you installed nginx-passenger     ##      #passenger_root /usr;     #passenger_ruby /usr/bin/ruby;      ##      include /etc/nginx/conf.d/*.conf;     #include /etc/nginx/sites-enabled/*;   }  what here is causing this? Name of a special matrix I have a matrix which is kind of symmetrical with the other diagonal, i.e., something like  $$A = \left[ \begin{array}{c c c c}    a &amp; b &amp; c &amp; d \\    e &amp; f &amp; g &amp; c \\    h &amp; i &amp; f &amp; b \\    j &amp; h &amp; e &amp; a  \end{array} \right]$$  Does this matrix have a special name in literature? What are it's properties?  And a matrix that is symmetrical by both diagonals   $$A = \left[ \begin{array}{c c c c}    a &amp; b &amp; c &amp; d \\    b &amp; e &amp; f &amp; c \\    c &amp; f &amp; e &amp; b \\    d &amp; c &amp; b &amp; a  \end{array} \right]$$  What's the name of it? Any interesting properties? I've taken multivariate calculus and am wondering if I can see a specific function where the order of taking the partial derivative matters. I've been told that there are some exceptions where $ \dfrac{\partial ^2 f}{\partial x \partial y} \ne \dfrac{\partial ^2 f}{\partial y \partial x} $, so I'm curious to see what this looks like.  EDIT: And why would this true? $\mathbb{R}P^4$ and $\mathbb{R}P^6$ do not admit fields of tangent $2$-planes See the related question . This is the second part of question 4-C in Milnor and Stasheff's book on characteristic classes. In the solution to the first part, we rely on the fact that having a field of tangent $1$-planes allows us to split the tangent bundle into a direct sum. It doesn't seem like this should be true for a field of tangent $2$-planes (otherwise the question wouldn't just be asking about $P^4$ and $P^6$), so I'm not sure exactly where to start.  edit: actually, since $P^n$ can be given a Riemannian metric, any subbundle should be a Whitney summand; this doesn't answer the question as to why they only ask for $P^4$ and $P^6$ though, so I'm still confused. Can one PC throw another? For example, if there is a lava river surrounding a castle. There is a drawbridge that can be lowered, but the lever is on the other side. PCs couldn't find a hidden passageway,either because PCs failed necessary check and couldn't find it or just because there isn't one. They don't have rope to try to pull the lever down. Or if PCs want to rob a house, but can't pick a lock, they see that window on the second floor is open. Can one PC use his Strength to throw another PC that is one size smaller, with other PC using his Dexterity or Strength to not fall down or lose balance? Chromium on Ubuntu 12.04. Youtube says:     This video is currently unavailable   I don't know why but this is the case for some videos, but not all. Well, most videos. And I don't know what's wrong.  Anyone help?