Java - Attempt to read from a null 2-D Randomly Generate Array
What is a NullPointerException, and how do I fix it?
Should initial e's after h-dropping be capitalized? A new Victorian-set British novel begins sentences containing h-dropping with lower-case e's, as in " 'e took my money, 'e did." This seems incorrect but I'm at a loss to find the rule. Organize uploads by year, month and day Time Traveler steps on a butterfly, changes everything I heard of this in high school, but never learned its title or author- supposedly the aforementioned worm butterfly would have played a part in evolution that caused the extinction of the dinosaurs (instead of that meteor most people blame now). This story might even have been parodied on a certain Simpsons Halloween Special (the one where Homer accidentally makes a time machine trying to fix the toaster). Catch multiple exceptions at once? How to cleanly launch a GUI app via the Terminal? Some GUI apps launch cleanly via the Terminal command line, but some don't, and they cause the Terminal to wait for the app to terminate. Even then, some don't "release" the command line.  The mysterious ampersand &amp; suffix seems to cause the terminal to put the process into the background (but I'm not sure what happens there).  Is there a way to launch an app via the Terminal so that there is no "hang on" effect, just like launching something via Alt+F2?  I'd like to have the command line available again immediately, without something still in the background and printing in the terminal. Error : Warning: strpos() [function.strpos]: Offset not contained in string - can not find solution Rails Previous Sunday in Relation to Any DateTime Is it possible to get the ID of a Contact which is part of a Person Account?  I have a custom object which has a custom field referencing the Person Account, though it seems to be referencing the Contact directly. I have created a button which I am using to pass the ID into a Visualforce Page.  With the Insert Field drop-down on the create/edit button page I can put in {!Account.Id} or {!Contact.Id} but neither of these work. The Account ID is placed in the URL but is not the correct ID and the Contact ID is blank, which I assume is because the button is on a Person Account page and not a Contact Page. How do I put a stencil-like texture across a sectioned object? I'm trying to show that a finite sum of eigenspaces (with distinct eigenvalues) is a direct sum.   I have $ \alpha : V \to V $. The eigenspaces are $ V_{\lambda_i} = \ker(\alpha - \lambda_i id_V )$ for $ 1 \leq i \leq n $. My attempt at a proof:  $ A + B $ is a direct sum iff $ A \cap B = \{0\} $. If $ v \neq 0 \in V_{\lambda_i} \cap V_{\lambda_j} $ for some $i,j, i \neq j $, then $ \alpha(v) = \lambda_i v $ and $ \alpha(v) = \lambda_j v $. So $(\lambda_i - \lambda_j)v = 0 $, and so $ \lambda_i = \lambda_j $. This is a contradiction, so any pair of the eigenspaces have trivial intersection. Therefore $ \cap_{i=1}^n V_{\lambda_i} = \{0\} $, and so we have a direct sum.  Is this ok?  Thanks iOS 9 Screen Recording in El Capitan I used to record iOS devices through QuickTime, however now it's only recording audio (not sure is this linked to OS X 10.11 or iOS 9).  How can I fix this (without third party sofrware)? I have used the package nomencl. In my code I have incorporated the \nomenclature as well. But when I compile, it is not showing me any results. My code is :  \documentclass[pdftex,12pt,a4paper]{report} \usepackage{nomencl} \makenomenclature \begin{document} ---page numbering and other things included----- \include{symbols} -----others--- \end{document}   symbols.tex  \chapter*{NOTATIONS} \addcontentsline{toc}{chapter}{Notations} \nomenclature{$G_e$}{Equivalent Shear Modulus} \printnomenclature   Shall I use \nomenclature while explaining the chapter. Will It give me the same results? like  \documentclass[pdftex,12pt,a4paper]{report} \usepackage{nomencl} \makenomenclature \begin{document} ---page numbering and other things included----- \include{symbols} \include{chap3-calculate_w} -----others--- \end{document}   symbols.tex  \chapter*{NOTATIONS} \addcontentsline{toc}{chapter}{Notations} \printnomenclature   chap3-calculate_w.tex  \chapter{SETTLEMENT RESPONSE OF GEOSYNTHETIC REINFORCED GRANULAR FILL SOFT SOIL} \label{chap:W} \section{INTRODUCTION} In this thesis, the methodology to determine an  Equivalent single layer shear modulus \nomenclature{$G_e$}{Equivalent Shear Modulus},$G_e$ value for a...etc   I am not getting the output in both these. Can someone help me with this? If a subring of a ring R has identity, does R also have the identity? I know it does not make sense that if a subring of a ring $R$ is commutative, then $R$ is also commutative. (For example, the set consisting of the matrices whose all entries except (1,1)-entry are zero, is a subring of ring of 2x2 real matrices.)  I also considered the case of a ring containing a subring with identity, but I had no ideas. Maybe it seems that it does not make sense, either.  Who give me some examples supporting my guess? Over the years I've written some libraries. These libraries sometimes depend on each other.  As a result, the "tex" directory is structured as follows:  tex ├── library |   ├── library1.sty |   ├── library2.sty |   └── library3.sty ├── project1 |   ├── master.tex |   ├── chapter1.tex |   └── chapter2.tex ├── project2 |   └── article.tex └── project3     └── paper.tex   The libraries depend on each other. As a result, in every library that depends on another library, this is part of the header:  %library2.sty \ProvidesPackage{library2} \RequirePackage{../library/library1}   In other words, the library is imported from the "root of every project". This is not a good design choice. What if someone copies the libraries in the folder of the root of a project, or what if the folder "library" is renamed...  It is however reasonable the "active directory" still remains in the project root.  What can be done to resolve such library dependencies? Why doesn't my Bash script recognize aliases? How to render an ASP.NET MVC view as a string? I want to output two different views (one as a string that will be sent as an email), and the other the page displayed to a user.  Is this possible in ASP.NET MVC beta?  I've tried multiple examples:  1.      If I use this example, I receive the "Cannot redirect after HTTP   headers have been sent.".   2.      If I use this, I seem to be unable to do a redirectToAction, as it   tries to render a view that may not exist. If I do return the view, it   is completely messed up and doesn't look right at all.   Does anyone have any ideas/solutions to these issues i have, or have any suggestions for better ones?  Many thanks!  Below is an example. What I'm trying to do is create the GetViewForEmail method:  public ActionResult OrderResult(string ref) {     //Get the order     Order order = OrderService.GetOrder(ref);      //The email helper would do the meat and veg by getting the view as a string     //Pass the control name (OrderResultEmail) and the model (order)     string emailView = GetViewForEmail("OrderResultEmail", order);      //Email the order out     EmailHelper(order, emailView);     return View("OrderResult", order); }   Accepted answer from Tim Scott (changed and formatted a little by me):  public virtual string RenderViewToString(     ControllerContext controllerContext,     string viewPath,     string masterPath,     ViewDataDictionary viewData,     TempDataDictionary tempData) {     Stream filter = null;     ViewPage viewPage = new ViewPage();      //Right, create our view     viewPage.ViewContext = new ViewContext(controllerContext, new WebFormView(viewPath, masterPath), viewData, tempData);      //Get the response context, flush it and get the response filter.     var response = viewPage.ViewContext.HttpContext.Response;     response.Flush();     var oldFilter = response.Filter;      try     {         //Put a new filter into the response         filter = new MemoryStream();         response.Filter = filter;          //Now render the view into the memorystream and flush the response         viewPage.ViewContext.View.Render(viewPage.ViewContext, viewPage.ViewContext.HttpContext.Response.Output);         response.Flush();          //Now read the rendered view.         filter.Position = 0;         var reader = new StreamReader(filter, response.ContentEncoding);         return reader.ReadToEnd();     }     finally     {         //Clean up.         if (filter != null)         {             filter.Dispose();         }          //Now replace the response filter         response.Filter = oldFilter;     } }   Example usage  Assuming a call from the controller to get the order confirmation email, passing the Site.Master location.  string myString = RenderViewToString(this.ControllerContext, "~/Views/Order/OrderResultEmail.aspx", "~/Views/Shared/Site.Master", this.ViewData, this.TempData); What exactly is a kilogram-meter? This question isn't just about kilogram-meters, it's about multiplied units in general.  I have a good mental conception of divided units, e.g. meters per second or grams per cubic meter.  Meters per second just (usually) means how many meters are traversed by an object each second.  Simple.  But I don't really have a mental conception of what it means when units are multiplied, e.g. a kilogram-meter.  Can anyone explain in simple physical terms what a kilogram-meter is? After turning census block data into a raster, how do I redistribute the density to reflect land cover types I plan on rasterizing (terminology?) census block data relating to density to a regular 30 m by 30 m grid for use with NLCD data.  I then hope to distribute the density of the original census block among each result set of grid cells within the original polygon according to the land cover type dictated by the NLCD dataset.  For example, let's imagine a string of city blocks with a park, all found within one census block.  If within this census block the average density is 1000 people/km^2, we ultimately would want the resulting grid cell containing the park to have a lower population density than the grid cells containing the surrounding apartments.  This information may be captured by the NLCD dataset, with the park being classified as '21' (open but developed land) versus 24 for apartment buildings which could be classified as '24' (high density development).  Is there a method, or set of methods, within ArcMap that would allow me to:   Redistribute the density based on the NLCD value Perform this redistribution only within the original census block polygon   I don't know if this is possible, but I figured I would ask.  Edit  Here's what I have been trying:  I converted the census block data to a raster, snapping it to the NLCD land cover data and ensuring the output grid cells were the same size.  Each cell contains the same info as the original census block (housing umbers, population, etc). I have been trying to figure out a way to edit the new grid so that if the NLCD grid cell contains a land cover type that doesn't support a business or housing (park, forest, farm, etc.) that it's housing and population values area set to 0.  My next move was going to be figuring out how to subtract the non-residential/non-business grid cells area from the area of the original census block, and force a recalculation of the density.  Converted the altered census block layer to grid cells again, with each having the new density value, and once again set the cells' housing, population, and density values that don't support a business or housing (park, forest, farm, etc.) to 0.  Kind of circular, and I'm not sure of all the steps (raster calculator for editing individual grid cells based on another raster's grid cell value?), but it seems to logically work out if I can get the parts to work.  On the other hand, @dof1985's answer seems to simplify the first part of my workflow (by directing me to the correct toolset), but I will still have to nullify the grid cells where parks, etc., do exits after the density has been recalculated for the census data. Class vs Struct for data only? Is there any advantage over using a class over a struct in cases such as these?  (note: it will only hold variables, there will never be functions)  class Foo {  private:       struct Pos { int x, y, z }; public:        Pos Position;  };   Versus:  struct Foo {    struct Pos { int x, y, z } Pos; };     Similar questions: Suppose $A,B,C$ are sets. Prove that $A\mathbin\triangle B\subseteq C \iff A\cup C=B\cup C$. Suppose $A,B,C$ are sets.  Prove that $A\mathbin\triangle B\subseteq C \iff A\cup C=B\cup C$.  I proved that for $x\in A\setminus B$, $x\in A\cup C$ and for $x\in B\setminus A$, $x\in B\cup C$. How do I show that $A\cup C=B\cup C$, and that $A\mathbin\triangle B\subseteq C \iff A\cup C=B\cup C$?