I am trying to show an error when a user performs an operation with a list item that is checked out.   How I get the list item:   var listItem = list.GetItemById(itemId);   This works and I can perform some other checks, like check the item's column values.   Now I try to check whether the list item is checked out:   if (listItem.File.CheckOutType != SPFile.SPCheckOutType.None) {     var checkedOutBy = listItem.File.CheckedOutByUser.Name;     throw new Exception("This item is checked out by " + checkedOutBy); }   This throws an exception "Object reference not set to an instance of an object".   I check whether the listItem.File is null:   if (listItem.File == null) {     throw new Exception("listItem.File is null"); //gets thrown }   This confirms that the .File is null.   What did I do wrong? Is there any other way to check whether a list item is checked out?
Is there a way to check if a file is checked out by another user? I am going trhough a list file by file and would like to avoid the "file is opened by another user" error. Something like this would be nice:  Guid id = new Guid(slideLibrary); // ID of Slide-Library. List list = ctx.Web.Lists.GetById(id); ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery()); ctx.Load(items); // Loading all the fields System.Security.SecureString pwd = new System.Security.SecureString(); foreach (char c in "pwd".ToCharArray()) pwd.AppendChar(c);  ctx.Credentials = new SharePointOnlineCredentials(login, pwd); ctx.ExecuteQuery();  // Iterating through all the entries. foreach (var item in items) {     String currentID = item["ID"].ToString(); // Getting the ID of the current item.      if (!item.IsCheckedOut()) // This is the part I am looking for.     {        // Do stuff     }     else     {        Console.WriteLine("Item is blocked, skipping it.")     } }   I have yet not been able to find something fitting.
Can I print a custom paper on standsard size in word? Ubuntu 16.04 hangs on splash screen during boot Prove that Gauss map on M is surjective Any group of index 2 is normal I'm trying to understand the proof that any group of index $2$ is normal.   Let $G$ be a group and $H$ a subgroup of index $2$.  I understand that if $x\in H$ then $xH=H=Hx$ since $H$ is a subgroup. However, I don't understand why if $x\in G\setminus H$ then $xH=G\setminus H.$  I know there are other proofs of this on this site but none of them specifically address this question. Prove $\gcd(a+b, a-b) = 1$ or $2\,$ if $\,\gcd(a,b) = 1$ I want to show that for $\gcd(a,b) = 1$ $a,b \in Z$   $\gcd(a+b, a-b) = 1$ or $\gcd(a+b, a-b) = 2$ holds.      I think the first step should look something like this:      $d = \gcd(a+b, a-b) = \gcd(2a, a-b)$   From here I tried to proceed with two cases. 1: $a-b$ is even, which leads to $\gcd(a+b, a-b) = 2$ 2: $a-b$ is odd, which leads to $\gcd(a+b, a-b) = 1$  My main problem I think is, that I do not know how I should include $\gcd(a,b) = 1$ in the proof.  Any help is appreciated. Thx in advance. Cherio Woltan Leading zero in umask 0022 Is there a way to have Cycles skip rendering alpha? If I wanted to create an animation, each frame would have several seconds of rendering a completely transparent part, which adds up obviously. Is there a way to eliminate this waste of time? Did not receive site association bonus (+100 rep) Why do first years cross the lake to get to the castle? It makes sense to keep them together, and to have them arrive in the Great Hall separately from the rest of the school for the Sorting. But why the boats? The lake crossing is dramatic, but inefficient - as we see in book 4 when Dennis Creevey falls in the lake during the storm.   Is there a canon (books/movies or JKR) explanation for why the first years come up from the train in boats instead of carriages? How do I find the amount of free space on my hard drive? Is there a way to quickly check the amount of free / used disk space in Ubuntu?  I would assume you could right click on 'file system' in the file browser and choose 'properties' or something but there is no such option. Prove $\sum\limits_{i=0}^n\binom{i+k-1}{k-1}=\binom{n+k}{k}$ (a.k.a. Hockey-Stick Identity) Let $n$ be a nonnegative integer, and $k$ a positive integer. Could someone explain to me why the identity $$ \sum_{i=0}^n\binom{i+k-1}{k-1}=\binom{n+k}{k} $$ holds? Implicit 'which is', 'which are' A new study has shown that millions of pieces of junk floating in  space could be a big hazard for satellites orbiting Earth.   Is there an implicit 'which are' in front of floating in space? Why is 'which are'  not written? I'm using PostGIS 1.5.2, with geometries in SRID:900913. I need create a circles using a list of points as centre, with a radius of 600 kilometers. I'm using this query:  INSERT INTO circles (geom) (    SELECT ST_Buffer(point, 600000, 'quad_segs=8')     FROM points );   But circles created have not 600 kilometers of radius (radius is near this length, but not exactly).  Are there other methods to create circles in PostGIS?  NOTE: Information represented is from Spain. Correct projection is 4326, but client use Google rasters, so I am storing data in 900913 to avoid reprojections and increase performance. Adding other css files to wp_head Can you make a non-polar electrolytic capacitor out of two regular electrolytic capacitors? How can I make a part of a texture glow? I'm looking to get the result of a command as a variable in a Windows batch script (see  for the bash scripting equivalent).  A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome. Downloading from the main Ubuntu archive is slow even when it's not release day, how can I get apt-get to automatically use a mirror that is close to me? The characteristic and minimal polynomial of a companion matrix of a monic polynomial $f \in \mathbb F\left[x\right]$ in $1$ variable $x$ over a field $\mathbb F$ plays an important role in understanding the structure of finite dimensional $\mathbb F[x]$-modules.  It is an important fact that the characteristic polynomial and the minimal polynomial of $C(f)$ are both equal to $f$. This can be seen quite easily by induction on the degree of $f$.  Does anyone know a different proof of this fact? I would love to see a graph theoretic proof or a non inductive algebraic proof, but I would be happy with anything that makes it seem like more than a coincidence! Weight Painting Won't Get Rid of Weird Protrusions I tried adding weight, removing weight and removing doubles. The mesh popping out won't go away. Any ideas?    Blend File: