Tutorial by Examples: al

ClientContext clientContext = new ClientContext(siteUrl); Web oWebsite = clientContext.Web; ListCollection collList = oWebsite.Lists; clientContext.Load(collList); clientContext.ExecuteQuery(); foreach (List oList in collList) { Console.WriteLine("Title: {0} Created: {1}",...
ClientContext clientContext = new ClientContext(siteUrl); Web oWebsite = clientContext.Web; ListCreationInformation listCreationInfo = new ListCreationInformation(); listCreationInfo.Title = "My Announcements List"; listCreationInfo.TemplateType = (int)ListTemplateType.Announcements;...
ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements"); SP.Field oField = oList.Fields.AddFieldAsXml("<Field DisplayName='MyField' Type='Number' />", true, AddFieldOptions.DefaultValue); ...
ClientContext clientContext = new ClientContext(siteUrl); Web oWebsite = clientContext.Web; List oList = oWebsite.Lists.GetByTitle("My Announcements List"); oList.DeleteObject(); clientContext.ExecuteQuery();
ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements"); CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = "<View><Query><Where><Geq><FieldRef Name='ID'/>" + &qu...
ClientContext clientContext = new ClientContext(siteUrl); ListCollection collList = clientContext.Web.Lists; clientContext.Load( collList, lists => lists.Where( list => list.Hidden == false).Include( list => list.Title, list => list.Items.Take(10)...
When creating a new list item, its fields can be set using syntax similar to string arrays. Note that these fields are not created on the fly and are defined by the schema of the list. These fields (or columns) must exist on the server otherwise the create will fail. All list items will have the Tit...
ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements"); ListItem oListItem = oList.Items.GetById(3); oListItem["Title"] = "My Updated Title."; oListItem.Update(); clientContext.ExecuteQuer...
ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements"); ListItem oListItem = oList.GetItemById(2); oListItem.DeleteObject(); clientContext.ExecuteQuery();
ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); GroupCollection collGroup = clientContext.Web.SiteGroups; Group oGroup = collGroup.GetById(7); UserCollection collUser = oGroup.Users; clientContext.Load(collUser); clientContext.ExecuteQuer...
ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); GroupCollection collGroup = clientContext.Web.SiteGroups; clientContext.Load(collGroup); clientContext.Load(collGroup, groups => groups.Include( group => group.Users)); ...
string siteUrl = "http://MyServer/sites/MySiteCollection"; ClientContext oContext = new ClientContext(siteUrl); SP.List oList = oContext.Web.Lists.GetByTitle("Announcements"); oList.BreakRoleInheritance(true, false); oContext.ExecuteQuery();
extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; #[derive(Deserialize, Debug)] struct Request { // Use the result of a function as the default if "resource" is // not included in the input. #[serde(default="default_resource&quot...
Enums can have custom init methods that can be more useful than the default init?(rawValue:). Enums can also store values as well. This can be useful for storing the values they where initialized with and retrieving that value later. enum CompassDirection { case north(Int) case south(Int)...
[HttpPost] public ActionResult ContactUs(ContactUsModel contactObject) { // This line checks to see if the Model is Valid by verifying each Property in the Model meets the data validation rules if(ModelState.IsValid) { } return View(contactObject); } The model class p...
Build a text report showing the main classification metrics, including the precision and recall, f1-score (the harmonic mean of precision and recall) and support (the number of observations of that class in the training set). Example from sklearn docs: from sklearn.metrics import classification_re...
String literals represent null-terminated, static-duration arrays of char. Because they have static storage duration, a string literal or a pointer to the same underlying array can safely be used in several ways that a pointer to an automatic array cannot. For example, returning a string literal f...
(This pitfall applies equally to all primitive wrapper types, but we will illustrate it for Integer and int.) When working with Integer objects, it is tempting to use == to compare values, because that is what you would do with int values. And in some cases this will seem to work: Integer int1_1 =...
The .format() method can interpret a number in different formats, such as: >>> '{:c}'.format(65) # Unicode character 'A' >>> '{:d}'.format(0x0a) # base 10 '10' >>> '{:n}'.format(0x0a) # base 10 using current locale for separators '10' Format integers to d...
Properties can be set when an object is instantiated. var redCar = new Car { Wheels = 2, Year = 2016, Color = Color.Red };

Page 70 of 269