NullPointerException in Queue using Linear Linked List
What is a NullPointerException, and how do I fix it?
English questions and negation with *do* in syntax How to pass the output of one command as the command-line argument to another? So I have a script that, when I give it two addresses, will search two HTML links:  echo "http://maps.google.be/maps?saddr\=$1\&amp;daddr\=$2" | sed 's/ /%/g'   I want to send this to wget and then save the output in a file called temp.html. I tried this, but it doesn't work. Can someone explain why and/or give me a solution please?  #!/bin/bash url = echo "http://maps.google.be/maps?saddr\=$1\&amp;daddr\=$2" |  sed 's/ /%/g' wget $url As I understand these two statements:   An electromagnetic field gives particles charge A photon is a quantum of electromagnetic field   It must mean that a photon carries charge. But I guess it isn't true. Why not? Why marinade meat with acid or enzymes? TinyMCE disable escaping Installing Nvidia drivers on Red Hat My users are sending me point data that were digitized using Google Earth. How can I convert their KML to a shapefile and vice versa? Let $E=l^p=\left\{x=\left(x_n\right): x_n\in\mathbb{R}, \sum_{1}^{\infty}\left|x_n\right|^p&lt;\infty\right\}$ with $1\le p&lt;\infty$, $\left\|x\right\|_E=\left(\sum_{1}^{\infty}\left|x_n\right|^p\right)^{1/p}.$ Let $\left(\lambda_n\right)$ is a bounded sequence in $\mathbb{R}$ and consider the operator $T$ defined by $$T(x)=\left(\lambda_1x_x,\ldots,\lambda_nx_n,\ldots\right)$$ where $x\in l^p$. Prove that $T$ is a compact operator from $E$ to $E$ iff $\lambda_n\rightarrow 0$.  Can anyone give me some hints to solve this problem? Thank you! When to use an object pronoun or a possessive adjective before a gerund Using a web service is often an excellent architectural approach. And, with the advent of WCF in .Net, it's getting even better.  But, in my experience, some people seem to think that web services should always be used in the data access layer for calls to the database. I don't think that web services are the universal solution.  I am thinking of smaller intranet applications with a few dozen users. The web app and its web service are deployed to one web server, not a web farm. There isn't going to be another web app in the future that can use this particular web service. It seems to me that the cost of calling the web service unnecessarily increases the burden on the web server. There is a performance hit to inter-process calls. Maintaining and debugging the code for the web app and the web service is more complicated. So is deployment. I just don't see the advantages of using a web service here.  One could test this by creating two versions of the web app, with and without the web service, and do stress testing, but I haven't done it.  Do you have an opinion on using web services for small-scale web app's? Any other occasions when web services are not a good architectural choice? At the start of A New Hope, when the corvette is being attacked, C3PO says something to the effect of:     There'll be no escape for the princess this time.   But when Luke stumbles onto Leia's message in R2D2, C3PO seems to not know who the figure in the message is:     I'm afraid I'm not quite sure, sir. I think she was a passenger on our last voyage. A person of some importance, sir - I believe.   Is C3PO feigning ignorance to protect her, or does he really not recognize her? I was looking at coreutils and found this as one of the files included as part of coreutils:  /usr/bin/[. What is [ and what does it do? It is an executable. I just don't know what it does or how to use it. $ file /usr/bin/[   /usr/bin/[: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared  libs), for GNU/Linux 2.6.15, stripped    When I try to run it, I think it is defaulting to the bash built in line expansion. Instead of actually running the file. $ &quot;/usr/bin/[&quot; /usr/bin/[: missing ‘]’ $ /usr/bin/\[ /usr/bin/[: missing ‘]’ Headers Including Each Other in C++ I'm a C++ newbie, but I wasn't able to find the answer to this (most likely trivial) question online.  I am having some trouble compiling some code where two classes include each other.  To begin, should my #include statements go inside or outside of my macros?  In practice, this hasn't seemed to matter.  However, in this particular case, I am having trouble.  Putting the #include statements outside of the macros causes the compiler to recurse and gives me "#include nested too deeply" errors.  This seems to makes sense to me since neither class has been fully defined before #include has been invoked.  However, strangely, when I try to put them inside, I am unable to declare a type of one of the classes, for it is not recognized.  Here is, in essence, what I'm trying to compile:  A.h  #ifndef A_H_ #define A_H_  #include "B.h"  class A {     private:         B b;      public:         A() : b(*this) {} };  #endif /*A_H_*/   B.h  #ifndef B_H_ #define B_H_  #include "A.h"  class B {     private:             A&amp; a;      public:         B(A&amp; a) : a(a) {}  };  #endif /*B_H_*/   main.cpp  #include "A.h"  int main() {     A a; }   If it makes a difference, I am using g++ 4.3.2.  And just to be clear, in general, where should #include statements go?  I have always seen them go outside of the macros, but the scenario I described clearly seems to break this principle.  Thanks to any helpers in advance!  Please allow me to clarify my intent if I have made any silly mistakes! Man is sitting in his room and gets contradictory advice from two men from the future I am trying to install php curl like so:  sudo apt-get update sudo apt-get install php5-curl   But I keep getting an error.  Reading package lists... Done Building dependency tree        Reading state information... Done php5-curl is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up runit (2.1.2-3ubuntu1) ... start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused dpkg: error processing package runit (--configure):  subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of git-daemon-run:  git-daemon-run depends on runit; however:   Package runit is not configured yet.  dpkg: error processing package git-daemon-run (--configure):  dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure.                           Errors were encountered while processing:  runit  git-daemon-run E: Sub-process /usr/bin/dpkg returned an error code (1)   when I try sudo dpkg --configure -a I get:  dpkg: dependency problems prevent configuration of git-daemon-run:  git-daemon-run depends on runit; however:   Package runit is not configured yet.  dpkg: error processing package git-daemon-run (--configure):  dependency problems - leaving unconfigured Errors were encountered while processing:  git-daemon-run   when I try sudo apt-get install --reinstall runit I get:  Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 8 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. E: Internal Error, No file name for runit:amd64   when I try sudo apt-get install runit I get:  Reading package lists... Done Building dependency tree        Reading state information... Done runit is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up runit (2.1.2-3ubuntu1) ... start: Job is already running: runsvdir dpkg: error processing package runit (--configure):  subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of git-daemon-run:  git-daemon-run depends on runit; however:   Package runit is not configured yet.  dpkg: error processing package git-daemon-run (--configure):  dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure.                                                                                                           Errors were encountered while processing:  runit  git-daemon-run E: Sub-process /usr/bin/dpkg returned an error code (1)   when I try sudo apt-get install --reinstall git-daemon-run I get:  Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 8 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. E: Internal Error, No file name for git-daemon-run:amd64   How can I fix this?  System Specs:  Processor: Intel® Core™ i7-3630QM CPU @ 2.40GHz × 8 Graphics: Gallium 0.4 on AMD TURKS (DRM 2.43.0, LLVM 3.6.2) OS Type: Ubuntu 15.10 64-bit Train passport control from London to Paris I'm a non-EU citizen, I will be travelling from London to Paris next month, so I was wondering since most countries track entry and leave dates, if I use the train to switch these countries and they don't control it, my UK visa will seem like entry YES but no leaving. Same for the Schengen, I wouldn't have an entry date but I'll be leaving,  Will it be trouble later? Are they controlling this on trains? If not is there anything I should do before? Why is electric field of an infinite plate constant at all points? I know from Gauss law, it is $\vec{E}=\dfrac{\sigma}{2 \epsilon_0}(\hat{n})$ at all points. But it doesn't make sense because of the inverse square nature of electric field which suggests if you move further away from the plane, electric field must reduce.   Then why is electric field of an infinite plate constant at all points? "#include" a text file in a C program as a char[] I did a dumb thing and now need to undelete some files.  In fact, I have already recovered the files using , which has served me well on the other rare occasions where this has been necessary.  So I have the files.    The problem is that Glary and the  don't preserve the original folder structure.  In this case I have about 3,000 small files that I must match to their original locations in a complex nested folder hierarchy.  I could see the full folder paths in Glary before the restore, so I know the information is there; it's just not using that information and copying everything to root of my designated destination, rather than relative to the original location. The Royal Order of Adverbs I know that the pattern manner-place-time shouldn't be taken too seriously if one wants to speak natural English.   In real life, people rarely use a string of adverbs. Speakers will easily break the pattern for emphatic or stylistic reasons (usually placing the adverb at the beginning of the sentence). Other factors such as length and specificity will also override the arrangement.  But I'm constructing illustrative sentences that highlight (and stick to) the Royal Order of Adverbs.   What all the online sources are doing is mixing adverbs and prepositional phrases, but I can't have the concept of prepositional phrases in my examples just yet. This means I should include only one-word or two-word adverbs (without prepositions).   So, I have these:    He sat quietly upstairs all day. She waited impatiently outside this morning. They gather noisily downtown every Saturday night.   Are the sentences above still correct, as in natural-sounding? Somehow they started sounding a bit off to me. I guess I just need to test them with a second pair of ears.