Streams: Avoid NullPointerException
What is a NullPointerException, and how do I fix it?
Temporary locks on answers not showing lock duration Tested on Stack Overflow, Stack Overflow Meta and Pets.  Questions  Temporary locks on questions are showing the duration (mod only).  Stack Overflow.   Meta Stack Overflow.   Pets.   Answers  On answers they are not and there's no way to find the lock duration when we use timeline tools to examine the post.  Pets.   Stack Overflow.   Meta Stack Overflow.   Is this something that hasn't been implemented or is it a bug?  If it hasn't been implemented can we please have it implemented? Preloading images with jQuery How to calculate the following sum: How may one calculate  $$\lim_{n\to\infty} \ \left(\left(\sum_{k=1}^{n} \frac{1}{3k-1}\right) - \frac{\ln n}{3}\right) \ ?$$ I am writing a report in a 2 column page format. Now I want to insert a rather large picture that requires to use full width of the page and cut the columns horizontally. How can I achiveve this? Please see the images below for what I mean : I started by Time Series Analysis by Hamilton, but I am lost hopelessly. This book is really too theoretical for me to learn by myself.   Does anybody have a recommendation for a textbook on time series analysis that's suitable for self-study? What exactly does the *frequency* of a photon mean? 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 ‘]’ Are layer files compatible between ArcGIS 10 and 9.3? If I save layer files in ArcGIS 10, can they be opened and modified in ArcGIS 9.3? What is the difference between parseInt() and Number()? Usage of "second/third/fourth ... last" In German there is a pattern for counting items from the end of a list. The last item is "das letzte", the one before is "das vorletzte", the one before that is "das vorvorletzte" and for each other item there's just another "vor" added.  While searching for an English translation for the German word "vorvorvorletzte" I came across   and  but none of them showed any usage pattern. Furthermore I didn't find any indication of which variant ("to", "from", no preposition) is used most nor to what area of the world those translations apply.  So I am still wondering: When there are items 1, 2, 3, 4 and 5, how can/will item 2 be called?   third from last? fourth from last? anteantepenultimate? fourth-last? fourth to last? the last but three item? the last but four item?   Is this a question of dialect/local use? As homework, I have to prove that     $\forall n \in \mathbb{N}: n^3-n$ is divisible by 6   I used induction  1) basis: $A(0): 0^3-0 = 6x$ , $x \in \mathbb{N}_0$ // the 6x states that the result is a multiple of 6, right?  2) requirement: $A(n):n^3-n=6x$  3) statement: $A(n+1): (n+1)^3-(n+1)=6x$  4) step: $n^3-n+(n+1)^3-n=6x+(n+1)^3-n$  So when I resolve that I do get the equation: $n^3-n=6x$ so the statement is true for $\forall n \in \mathbb{N}$  Did I do something wrong or is it that simple? onClick to get the ID of the clicked button Crossfading Video AND Audio with ffmpeg This Super User answer  has got me so far, but now that I have tried many solutions and seen every SO link out there, it's time to ask you all for help.  I am trying to crossfade 2 videos that are 10 seconds each in ts format with audio and video at the same time.   The steps are:   Add complex filter black screen Fade out video 1 after 9 seconds, with 1 second fade duration Fade in video 2 at 9 seconds, with 1 second fade duration Trim black filter output to 19 seconds   This works fine for just video alone, but when I attempt to add audio, I can't get past this error message:     Output pad "default" with type audio of the filter instance "Parsed_asetpts_4" of asetpts not connected to any destination   It appears I'm not connecting the audio output properly. I think I need to alter the [over] lines to include audio. But how do I do this?  `ffmpeg -i vid1.ts -i vid2.ts -f lavfi -i color=black -filter_complex \ "[0:v]format=pix_fmts=yuva420p,\ fade=t=out:st=9:d=1:alpha=1,setpts=PTS-STARTPTS[v0];\ [0:a]\ afade=t=out:st=9:d=1,asetpts=PTS-STARTPTS[a0];\ [1:v]format=pix_fmts=yuva420p,\ fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+9/TB[v1];\ [1:a]\ afade=t=in:st=0:d=1,asetpts=PTS-STARTPTS+9/TB[a1];\ [a0][a1]amix=inputs=2;\  [2:v]scale=720x406,trim=duration=19[over];\ [over][v0]overlay[over1];\ [over1][v1]overlay=format=yuv420[outv]" -vcodec libx264 -y -map [outv] final.ts` Why might one also use a blank constructor? I was reading some Java recently and came across something (an idiom?) new to me: in the program, classes with multiple constructors would also always include a blank constructor. For example:   public class Genotype {   private boolean bits[];   private int rating;   private int length;   private Random random;    public Genotype() {              //  &lt;= THIS is the bandit, this one right here     random = new Random();   }    /* creates a Random genetoype */   public Genotype(int length, Random r) {     random = r;     this.length = length;     bits = new boolean[length];      for(int i=0;i&lt;length;i++) {         bits[i] =random.nextBoolean();     }   }    /* copy constructor */   public Genotype(Genotype g,Random r) {     random = r;     bits = new boolean[g.length];     rating = g.rating;     length = g.length;      for(int i=0;i&lt;length;i++) {         bits[i] = g.bits[i];     }    } }   The first constructor doesn't seem to be a "real" constructor, it seems as though in every case one of the other constructors will be used. So why is that constructor defined at all? Where are the evolutionary "inbetweeners"? The problem I've always had with evolution is the actual lack of variation between animals. More specifically, the lack of observable gradual change between species.  Take for example the hammerhead shark. It obviously has a strong connection with a normal shark, but where's the "half-hammerhead" shark? Where's the species that only has a SLIGHTLY wider head?  I really doubt that a single mutation on a normal shark resulted in a head shaped like that, it had to happen gradually. Right? As far as I understand, evolution works by random mutation in a child being somehow slightly beneficial to that animal so it get's to live longer and reproduce more, eventually resulting in it's genetic material in dominating the inferior ones before it. But if it was for whatever reason beneficial to have a slightly wider head, why don't all the sharks have slightly wider heads now? On the other hand, if it wasn't beneficial, how come the hammerhead still exists?  Furthermore, I feel like some characteristics of a certain animal can't really have gradual benefits. There's a lizard that shoots blood out of it's eyes. The original ancestor certainly didn't, and I'm sure that if it's child only bled slightly from it's eyes it wouldn't really help if much in life. So for it to actually become beneficial, it seems to me that there had to be a ton of lizards that had a disadvantage of bleeding slightly. In fact, there had to be so many that they evolved even further in the same direction and kept doing that until they bled so much it's an actual benefit (sorry for this turning so gross). So why did the inbetweeners survive long enough to evolve even more, and why did they THEN die out? Is there any criterion (theorem or algorithm) to find out a given polynomial $f(x)$ is irreducible over the field $\mathbb{F}_2$? There is  with this exact same prompt which got several down-votes for not showing  their work.  So I'll show what work I've got.  I know being a harmonic function implies satisfying the Mean Value Property, thus what I thought I'd do is consider two arbitrary points in $\mathbb{C}$ and prove that:  $$|u(z) - u(w)|=|\frac{1}{2\pi}\int_0^{2\pi}u(z - re^{i\theta})d\theta - \frac{1}{2\pi}\int_0^{2\pi}u(w - te^{i\theta})d\theta| $$ $$= |\frac{1}{2\pi}\int_0^{2\pi}u(z - re^{i\theta}) - u(w - te^{i\theta})d\theta|$$  Now what I wan't to do is take r and t to infinity and prove this integral goes to zero, but I can't figure out how to do that.  I've used the fact that my harmonic function u is defined on all of $\mathbb{C}$ in taking t and r to infinity but I still need to use the fact that it's bounded.  I also read through the proof of Liouville's Theorem, given as an answer in that other post, which seems intuitively correct but rather un-rigorous.  It actually says that the value in the center of a ball is equal to the average over the ball's volume.  I imagine this can be proven from the average over the boundary since the average over the boundary will not change as you continuously shrink the boundary down to its center. This however would require the difference of two surface integrals, or is there a simpler way?   I was also considering using the Maximum Modulus Principle somehow but I haven't found a way yet.  I've probably made this way more complicated than it has to be, hopefully someone can help me, thanks! =].  Edit: Ok after thinking some more about the accepted answer in that other post, I've decided what I need to do is look at the canonical holomorphic function whose real part is my harmonic function u, and prove that holomorphic function is bounded.  From there I can prove that since it's entire and bounded that it's constant, and from there prove that then its real part must be constant.  So could someone talk a bit about the construction of this canonical holomorphic function? How to force nginx to resolve DNS (of a dynamic hostname) everytime when doing proxy_pass? I am using nginx/0.7.68, running on CentOS, with the following configuration:  server {     listen       80;     server_name ***;     index index.html index.htm index.php default.html default.htm default.php;      location / {             root   /***;             proxy_pass   http://***:8888;             index  index.html index.htm;     }     # where *** is my variables   The proxy_pass is to a DNS record whose IP changes frequently. Nginx caches the outdated IP address, resulting in a request to the wrong IP address.  How can I stop nginx from caching the IP address, when it is outdated? How to count the number of set bits in a 32-bit integer? Suppose that $\hat{x}$ is the least squares solution of $Ax = b$.  That is, $\min{|r|}, r = Ax - b$ with respect to $x$.  Is $\hat{x}$ also the least squares solution of $JAx = Jb$?  I suspect so, but I'm not sure how to prove it.  If $J$ is invertible, it's easy enough to prove as you can just cancel it out from both sides.  But what if it's not invertible?