I'm trying to send a file from my jsp to controller via ajax, im getting EXCEPTION:Null Error, below is my code:  Controller:  @RequestMapping(value = "/schedulebatch",method =  RequestMethod.POST,params="insertData") public @ResponseBody String addBatch(@RequestParam( @RequestParam(value="upfile",required=false) MultipartFile upfile) throws  Exception {  if(!upfile.isEmpty()){                     System.out.println("test1");}   View:      $("#submit-btn").click(function(){      var upfile = document.getElementById('upfile').enctypeVIEW;     alert('test');  if(batchname==null || fromdate == null || partners == null || interval ==      null){   $('#insertmodalalert').empty();      $('#insertmodalalert').append('&lt;div class="alert alert-info"&gt;&lt;strong      &gt;NOTICE |&lt;/strong&gt; Please fill out the required form. &lt;/div&gt;');      $('#alertMod').modal();      $('#okbtn').click(function(){       window.location.reload(true);      });  }  else{      $.ajax({        type: "POST",    url: "schedulebatch?insertData",    data: {"upfile" : upfile},                         success: function(response){       // alert('test');             $('#insertmodalalert').empty();             $('#insertmodalalert').append('&lt;div class="alert alert-     info"&gt;&lt;strong &gt;NOTICE |&lt;/strong&gt; '+response+' &lt;/div&gt;');             $('#alertMod').modal();             $('#okbtn').click(function(){              $('#alertMod').modal('hide');              window.location.reload(true);             });            },                       error: function(xhr, status, error) {                              var err = eval("(" + xhr.responseText + ")");             // alert('test');               // Display the specific error raised by the server      (e.g. not a               //   valid value for Int32, or attempted to divide by      zero).               $('#insertmodalalert').append('&lt;div class="alert      alert-danger"&gt;&lt;strong &gt;NOTICE |&lt;/strong&gt; '+err.Message+'&lt;/div&gt;');              $('#activateMod').modal();                            $('#okbtn').click(function(){               $('#alertMod').modal('hide');               window.location.reload(true);              });            }             });   //alert("Test");  }     HTML:     File to upload: &lt;input class="form-control" type="file" name="upfile"      accept=".csv" id="upfile"&gt; &lt;button type="submit" class="btn btn-success" id="submit-     btn"&gt;Submit&lt;/button&gt;     I narrowed down the code to the only thing that gives me error, thanks in advance. It gets the Multipart file successfully but im not sure why it gives a null exception error
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?
While I can post external texts into question and answer bodies, it preserves the old font style, spacing and size (although the markdown display won’t be affected by that.)   App Version: 1.6.6.2 Device: iPhone 6 OS Version: Version 11.0.3 (Build 15A432) I am an international student in the US (important as my stay in US is tied to my student visa, issued to attend my current university).  I joined as a grad student in the MS CS program in one of the okayish public universities (ranked ~50 on QS/US news). I joined in Fall '18 and am still in my first semester. I took all the so-called "difficult" courses, but I find them very trivial (considering my undergrad was from a very good university). I am very disappointed with the curriculum and feel the coursework is not at all rigorous for a grad-school.  I might sound super arrogant, but I feel out-of-place when I talk to other students and hear them cringe about how hard the courses are, or how they don't have enough time to finish assignments within the deadlines as I find all of the coursework very trivial and feel that the assignments are a joke.   Fortunately, I am working with one of the best profs the university has to offer on a very impactful project and the research is going great. But that's the only plus point I see from sticking around.  My aim from grad school is to get research experience and join one of the Big 4s or upcoming CS unicorn startups. I cannot see myself joining one of the Big-Ns after graduating since the students from this school rarely bag a Google/Fb/unicorn startup job.  Since December is the Fall'19 admissions deadline, I am thinking about reapplying to those top 10 CS schools which I couldn't get into last year (probably because of my poor undergrad GPA).   On the other hand, since every CS company just asks leetcode-style questions in interviews, I can just be super good at it and try to nail whatever interview I get without wasting another year and then doing the same.  I'm not really interested in any kind of credit transfer either since I would like to start fresh in a more rigorous curriculum.  I'm not sure if switching schools would be a wise decision and could really use some advice from the community here.  PS :  Probably related -   Posting with a dummy account for anonymity. In the Harry Potter universe, wizards and witches have managed to keep Muggles unaware of their existence, across the planet and over many centuries. Up to the timeframe that the novels take place in (the 1990s), I can see how this can be achieved through a combination of discretion and magic, with discretion being the preferred method on occasion (e.g., you don't need magic to slip into Platform 9 3/4 unnoticed, you just need to check that nobody is looking).   Our current world of 2016, however, its a very different place. The UK is (in)famously heavily camera-monitored (). Even more poignantly, a very large (and growing) segment of the population carries an internet-enabled HD camera with them at all times and are willing to use it at a moment's notice (, but it is comedy in part because a more realistic version could happen). It looks like, the moment something magical happens in public, a video of it would be on Youtube/Facebook/Twitter and within minutes.   How does the Ministry of Magic deal with this development? Do they need to create a dedicated corps to monitor social media services and alter records as necessary? I'm looking to view and archive all my old DMs in Twitter, since I would like to revive conversations that took place 1 year ago.  Acording to Twitter they don't delete old messages, they simply archive them in their database.  Is there a way to view and download all of these messages, just like you can view all your old public tweets with third party apps?  UPDATE: I found  but apparently it's not working for DMs now Regarding the ellipsoid computed by using the "lifting step" I need your expertise in understanding and hopefully solving the following problem:  Let $C \subset \mathbb{R}^d$, and lets assume that $C$ is not centrally symmetric, thus when computing the $MVEE(C)$ (i.e the minimum volume enclosing ellipsoid), they use the following "lifting step":  $$ C^\prime = \left\lbrace \pm \begin{bmatrix} x\\ 1 \end{bmatrix} \middle| x \in C \right\rbrace,$$ where $C^\prime$ is centrally symmetric.  It is proven that for any $\varepsilon &gt; 0$, $MVEE(C^\prime) \cap \Pi$ is a $(1 + \varepsilon)$-approximation to $MVEE(C) \times \left\lbrace 1 \right\rbrace$, where $\Pi = \left\lbrace x \in \mathbb{R^{d+1}} \middle| x_{d+1} = 1 \right\rbrace$.  Let $G \in \mathbb{d \times d}$ be an invertible matrix, let $ v \in \mathbb{R}^d$ such that the pair $(G,v)$ represents the matrix and the center of $MVEE(C)$ respectively. Let $\hat{G} \in \mathbb{R}^{(d + 1) \times (d + 1)}$ be an invertible matrix such that the pair $(\hat{G},\overset{\to}{0})$ represents the matrix and center of $MVEE(C^\prime)$ respectively.  Then, $\forall x \in MVEE(C)$ $$ \left| \left| \left[ x , 1 \right] \hat{G} \begin{bmatrix} x\\1 \end{bmatrix} \right| \right|_2 = (1 + \varepsilon) \cdot \left| \left| (x - v) G (x - v)^T \right| \right|_2 .$$  Regarding $x \not\in MVEE(C) $, then it is easy to see that the above term is not satisfied and moreover the right term is bigger or equal to the left term.  What I need to know is whether it possible the bound the right term by the left term (maybe because $MVEE(C) \times \left\lbrace 1 \right\rbrace \subseteq MVEE(C^\prime)$), i.e. $$ poly(d) \cdot \left| \left| \left[ x , 1 \right] \hat{G} \begin{bmatrix} x\\1 \end{bmatrix} \right| \right|_2 \geq (1 + \varepsilon) \cdot \left| \left| (x - v) G (x - v)^T \right| \right|_2 \ ?$$  Please Do correct if I am wrong and thanks in advance. 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 ? Virtual Box Toolbar Hidden. How to show? Is there an analog to the Runge-Lenz vector for a 3D spherically symmetric harmonic potential? Today I found something strange on my newly installed Windows 7 OS - my "users" folder C:\Users was shared and "Everyone" had full access... I disabled that and now it seems fine, however I'm a bit scared actually, I'd like to know what caused that and if my system is compromised. Why can Naruto still use Rasenshuriken? When Naruto first used Rasenshuriken against Kakuzu the effect was massive. He destroyed   two of Kakuzu's hearts, but there were a huge after effect to him. If I'm not mistaken, Tsunade advised Kakashi to ask Naruto never to use the technique again due to the huge risk. So why is Naruto still able to use the technique and have no side effects after that battle? I may have missed out on something. What is the easiest way to handle huge numbers in C? I need to store values in the Area 1000^900, or in more human readable form 10^2700. Does anybody know of an easy way to do that? Any help would really be appreciated! I'm looking into using Named Credentials (spring '15) to simplify apex callouts to an external web service.  I actually thought, based on the documentation, that this would help, and I'm referring correctly to the Named Credential in my code and have also given my profile access to the NC, but I'm faced with this error when I do the callout:     System.UnexpectedException: You don't have permission to view this   data. Ask your administrator to set up authentication for the external   data source   This seems to say that NC are tied to the use of External Data Source, which is absolutely unrelated to what I want to do, and the documentation doesn't mention that they are a requirement.  Have any of you run into this error when testing out Named Credentials? The warlock's Thirsting Blade eldritch invocation cannot be normally used with the (non-warlock) class feature Extra Attack, since both feature explicitly say you attack twice instead of once. But it seems to me that you could use both features (if you have them) when using Two-Weapon Fighting.  Assume your character is wielding two light weapons, one of which is your pact weapon. You take the Attack action on your turn to attack twice with your non-pact weapon using your  class feature.  Then, given the Two-Weapon Fighting rules, you use your bonus action to attack once using your pact weapon this time.  The  rules (PHB p. 195) state:     When you take the Attack action and attack with a light melee weapon that you're holding in one hand, you can use a bonus action to attack with a different light melee weapon that you're holding in the other hand.   But since your have the Thirsting Blade invocation, and you used the Attack action, you get to attack twice with your pact weapon.  The Thirsting Blade  (PHB p. 111) says:     You can attack with your pact weapon twice, instead of once, whenever you take the Attack action on your turn.   Does this combo work within the rules, or is there any interaction I'm not aware of? pm-hibernate freezes and/or fails to resume on Dell XPS 13, 14.04, 3.19 kernel I'm running 14.04 on a new XPS 13. In order to support the newer hardware, I'm running a mainline 3.19 kernel.   Hibernate resume has been iffy with the entire 3.19 kernel line, but recently (3.19.5) pm-hibernate no longer works at all. The screen will either a) switch off momentarily, then back on with all inputs frozen or b) switch off entirely, and fail to resume upon power on (despite displaying the correct resume-from-uuid message).  I have enough swap space (and it has worked in the past), I have checked that the uuid is being correctly referenced, and nothing seems particularly amiss in /var/log/pm-suspend.log (last 200 lines here: )  Thanks for your help. Minecraft Vanilla 1.9 crash with problematic frame ig8icd64.dll I've been trying to photograph lightning lately, as we have had some great storms in Colorado. I've had some difficulty getting a good vantage point, however, as almost all of these storms include rain as well. To keep my camera from getting drenched (I have weather-sealed lenses, but my camera body, a Canon 450D, is not weather sealed as far as I can tell), I've had to shoot under the eve of a building or under a thick canopy of trees, however that has greatly limited my ability to adapt to the changing weather and get get a vantage point on the best lightning.  Is there any equipment, something I can purchase or something home-made that has easy-to-find parts, that can help me protect my lens from the rain while still being able to shoot? Additionally, I've been getting rain on a UV filter I have on the front of my lenses, simply to prevent rain from getting on the front lens element itself. However, once a storm really gets going, so does the rain. Is there a simple solution to keep rain off the front of the lens? Help us test the alpha version of our Android app We are in the early stages of development of the official Stack Exchange Android app and we need your help with testing. To set a few expectations: there will be bugs, crashes, and missing features, all of which will be fixed in .    We are initially targeting Android devices running  (Android 4.1 or higher) starting with phones (up to ~5 inch) and eventually moving our way to tablets.    To register for alpha testing .  After you register we will send you an invite to a private Google community where you can find a link to download our app directly from the  store. The invitations will be sent out in waves, so if you don’t get an invite immediately, be patient.  Crash reports will be automatically reported back to us using . Bugs or feature requests should be reported here on meta and tagged . Please do not use the Google community to report bugs.  As always, we welcome your feedback and are committed to building the best mobile app possible for browsing the Stack Exchange sites. Why do I get different outputs in case of sh and bash? we all study mathematics , and all of us learn mathematical methods to solve problems , we learn how to prove , how to think mathematically   but the question is, what is mathematics ? how can we define it as a branch of science ? Continuity of absolute value of a function Let $f(x)$ be a continuous function. Prove that $\left|f(x)\right|$ is also continuous.  Is it correct to say that, by the reverse triangle inequality, $\left|f(x)-f(c)\right| \geq \left|f(x)\right|-\left|f(c)\right|$ in all cases, so we will always have that for all $\left|x-c\right|&lt;\delta$ implies $\left|f(x)-f(c)\right|\leq \epsilon$?  I am not sure if my solution adequately uses the functional form, since I just used the equation and not my actual function. Please help with the proper solution!