I am writing a file to hdfs using java using the following code:      import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.InputStream; import java.io.OutputStream; import java.net.URI;  import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IOUtils;   public class WriteInrix {     public static void main(String[] args) throws Exception {          //Source file in the local file system         String localSrc = args[0];         //Destination file in HDFS         String dst = args[1];          //Input stream for the file in local file system to be written to HDFS         InputStream in = new BufferedInputStream(new FileInputStream(localSrc));          //Get configuration of Hadoop system         Configuration conf = new Configuration();         System.out.println("Connecting to -- "+conf.get("fs.defaultFS"));          //Destination file in HDFS         FileSystem fs = FileSystem.get(URI.create(dst), conf);         OutputStream out = fs.create(new Path(dst));          //Copy file from local to HDFS         IOUtils.copyBytes(in, out, 4096, true);          System.out.println(dst + " copied to HDFS");          } }   But I am getting the following exception     Exception in thread "main" java.lang.NoClassDefFoundError:   org/apache/hadoop/fs/   FSDataOutputStream           at java.lang.Class.getDeclaredMethods0(Native Method)           at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)           at java.lang.Class.getMethod0(Class.java:2866)           at java.lang.Class.getMethod(Class.java:1676)           at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)           at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)   Caused by: java.lang.ClassNotFoundException:   org.apache.hadoop.fs.FSDataOutputSt   ream           at java.net.URLClassLoader$1.run(URLClassLoader.java:366)           at java.net.URLClassLoader$1.run(URLClassLoader.java:355)           at java.security.AccessController.doPrivileged(Native Method)           at java.net.URLClassLoader.findClass(URLClassLoader.java:354)           at java.lang.ClassLoader.loadClass(ClassLoader.java:425)           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)           at java.lang.ClassLoader.loadClass(ClassLoader.java:358)           ... 6 more   Why I am getting the exception? I just copied the source code from the
I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?
C non-blocking keyboard input I'm trying to write a program in C (on Linux) that loops until the user presses a key, but shouldn't require a keypress to continue each loop.  Is there a simple way to do this? I figure I could possibly do it with select() but that seems like a lot of work.  Alternatively, is there a way to catch a ctrl-c keypress to do cleanup before the program closes instead of non-blocking io? I know that I can make certain blocks only placeable on a specified block, but what is the command to give an item that can only BREAK certain blocks? Wi-Fi not working on Lenovo ThinkPad E570 (Realtek RTL8821CE) Salesforce Internal Server - What's in a GACK? Background  I have been working with Salesforce Support for several weeks now trying to get them to escalate an internal server error with GACK 2134764861-123797 (1611479512) (1611479512). After a long period of waiting I was told that in order to escalate quickly they needed to reproduce the issue in a controlled way. This was again taking them a considerable amount of time so I created a reduced test case myself () that concisely reproduces the issue with a very small amount of code. I was told that this wasn't a valid reproduction because it caused a different GACK (1291518605-518052 (1659192199) (1659192199)) despite reproducing the exact same user experience.  My Question  What makes up a GACK? Is there any information that I can take from their structure that can give me clues on which errors are related without access to the full back-end tools that Salesforce Support uses? It is not infrequent that without premier support it takes me upwards of two weeks to escalate platform bugs and I am hoping that I can somehow use the information from the GACK to reduce this time. macOS Sierra restarting download instead of resuming How do I install nVidia graphics drivers from “X-Swat” ppa? How am I supposed to install nvidia drivers from xorg-edgers? I try  sudo add-apt-repository ppa:xorg-edgers/ppa -y sudo apt-get update sudo apt-get install nvidia-graphics-drivers-331   and I get  E: Unable to locate package nvidia-graphics-drivers-331   The   nvidia-graphics-drivers-331 for trusty, why wouldn't it install? Blowing your own sail? How it this possible? Even if the gif is fake, the Mythbusters did it and with a large sail it really moves forward. What is the explanation? “have found” vs. “found” How do I log all input and output in a terminal session? How do I keep logs of all the work done via terminal? For example, I want a record of all the work done on database via terminal. "invalid EFI file path" while booting Windows I just got my new working notebook with Windows 8 pre-installed. After installing Ubuntu 12.10 the grub menu says that there is an "invalid EFI file path" and it won't boot Windows. Ubuntu works fine...  Is there anything I can do about this? What is the relative speed of two near-light speed particles headed towards each other? I understand that nothing can move faster than light due to time dilation. I want to build upon my understanding of Einstein's theory of Special Relativity, so I came up with this hypothetical problem for myself:  If both particles are moving at 0.9c towards each other (according to an observer on Earth), what speed does each particle have relative to the other?  I'm stumped since I am only familiar with Newtonian classical mechanics to solve this (which would be wrong). I am aware of Lorentz' factor $\gamma =\frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$ and the time dilation equation $t_m = \frac{t_o}{\sqrt{1 - \frac{v^2}{c^2}}}$, but I'm not sure how to apply it in this instance. I'm just looking for a gentle push in the right direction. Edit: My prior research:  This article, ,  talks about the effect of a baseball thrown at 0.9c would have as it traveled towards a batter. This is not what I'm looking for since it doesn't explain the math behind finding the collision speed between two high velocity entities.  This question on Yahoo, , asks a similar question to mine, but no math is involved to demonstrate the calculations behind the reasoning.  This question on Physics.SE, , does not answer my question either. I have not been able to find a similar Physics.SE question which can provide me to clues to my own hypothetical question.  I have also Googled the following phrases:    i. &quot;collision faster than the speed of light&quot; ii. &quot;collision of high speed particles&quot; iii. &quot;lorentz transformation in a collision&quot; iv. &quot;collision analysis at light speed&quot; Exact relationship between electric field and intensity I often see $I(t)\propto |E(t)|^2$. What is the exact form ? Which constants are missing to make this an equality and why are they so often omitted ? Complete references in between the document When we do   \bibliographystyle{style} \bibliography{References.bib}   We get all the references at the end of the document, with some kind of reference/id in the document.   What I need is the complete reference in the document itself (not at the end) and then to be able to write what I want below this reference. For example;  Chaminade, T., Hodgins, J., &amp; Kawato, M. (2007). "Anthropomorphism influences perception of computer-animated characters' actions." Social Cognitive and Affective Neuroscience 2(3): 206-216      - Some text..........      - Some more text.......  Cowley, S. J., Kanda, T. (2005). "Friendly machines: interaction-oriented robots today and tomorrow." Alternation 12(1a): 79-106.      - Some text.....      - Some more text....   How can I do it? Thanks. Why is the light reflected at the same angle from mirror? From the school physics I know that the material objects bounce from the plane surface at the same angle, losing some kinetic energy. In the same school I was taught that the light (and waves in general) obeys this principle too.  Obviously, in the case of light the plane surface should be a perfect mirror. But I can't understand how should this work from the quantum point of view. Let's assume that our mirror consists of a single silver atom.  Why should the electrons of this atom re-emit consumed photons at some specific angle? Is there a way to solve this integral?  $$\int \frac{dx}{\sqrt{-ax^2 + bx +c}}, \;\;\;\;\; \forall\; a,b,c \in (0,+\infty) \;in\;R$$  I have tried it by changing of variable and by parts, but no result. I don't know what else to do.  Thanks in advance. List of generally believed conjectures which cannot all be true There are some conjectures which most leading experts believe in albeit no one can prove it yet. For example: $\mathcal{P} \neq \mathcal{NP}$, the Riemann hypothesis or the Collatz conjecture.  My question is whether there is a set of such conjectures which cannot all be true, eg. is a statement such as "Either $\mathcal{P} = \mathcal{NP}$ or the Riemann hypothesis is wrong" true? C++ catching all exceptions Improving upon ArcGIS Buffer/Dissolve performance? Add chat rooms for Android app Being able to join chat rooms from the Android app would be a plus! It would truly make us connected on the go, instead of having to sit down at our desks and open a browser window. This will allow more users to fully utilize the chat system and join events no matter where they are. Python csv.reader: How do I return to the top of the file? When I'm moving through a file with a csv.reader, how do I return to the top of the file.   If I were doing it with a normal file I could just do something like "file.seek(0)".  Is there anything like that for the csv module?  Thanks ahead of time ;)