Tutorial by Examples: c

Factory Method is one of creational design patterns. It is used to deal with the problem of creating objects without specifying exact result type. This document will teach you how to use Factory Method DP properly. Let me explain the idea of it to you on a simple example. Imagine you're working in ...
set alpha {a 1 b 2 c 3} dict get $alpha b # => 2 dict get $alpha d # (ERROR) key "d" not known in dictionary If dict get is used to retrieve the value of a missing key, an error is raised. To prevent the error, use dict exists: if {[dict exists $alpha $key]} { set result [d...
The DatePicker class has a property, SelectedDate, which enable you to get or set the selected date. If there is none selected, it means its value will be null. if (datePicker.SelectedDate == null) { // Do what you have to do }
Android developers(mainly beginners) have been confused regarding Internal & External storage terminology. There are lot of questions on Stackoverflow regarding the same. This is mainly because of the fact that terminology according to Google/official Android documentation is quite different to...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); var newItem = new Interactions{ SiteName = "Example", Pages = ...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); var result = IMongoCollectionExtensions .AsQueryable(collection) ...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); var update = MongoDB.Driver .Builders .Update.Set(s => s.SiteName, "New Ex...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); collection.DeleteOne(s => s.SiteName == "New Example");
To add a child view controller: - (void)displayContentController:(UIViewController *)vc { [self addChildViewController:vc]; vc.view.frame = self.view.frame; [self.view addSubview:vc.view]; [vc didMoveToParentViewController:self]; } To remove a child view controller: - (void)hid...
First let's create an ExchangeManager object, where the constructor will connect to the services for us. It also has a GetOofSettings method, which will return the OofSettings object for the specified email address : using System; using System.Web.Configuration; using Microsoft.Exchange.WebServic...
Introduction Maps stores key/value pairs, where each key has an associated value. Given a particular key, the map can look up the associated value very quickly. Maps, also known as associate array, is an object that stores the data in form of keys and values. In Java, maps are represented using Ma...
TRUNCATE TABLE Helloworlds This code will delete all the data from the table Helloworlds. Truncate table is almost similar to Delete from Table code. The difference is that you can not use where clauses with Truncate. Truncate table is considered better than delete because it uses less transacti...
To comment on power scripts by prepending the line using the # (hash) symbol # This is a comment in powershell Get-ChildItem You can also have multi-line comments using <# and #> at the beginning and end of the comment respectively. <# This is a multi-line comment #> Get-Chil...
Static .Net library methods can be called from PowerShell by encapsulating the full class name in third bracket and then calling the method using :: #calling Path.GetFileName() C:\> [System.IO.Path]::GetFileName('C:\Windows\explorer.exe') explorer.exe Static methods can be called from the c...
trigger AccountTrigger on Account (before insert) { System.debug('Account(s) are about to be inserted'); }
trigger ContactTrigger on Contact (before insert, after insert, before update, after update, before delete, after delete, after undelete) { /** Before or After trigger execution**/ /...
trigger MyTrigger on SomeObject__c (after insert, after update) { if (Trigger.isAfter && Trigger.isInsert) { System.debug('The following records were inserted: '); for (SomeObject__c o : Trigger.new) { System.debug(o.Name); } } else if (Trigg...
To ensure that all possible items are documented, you can use the missing_docs link to receive warnings/errors from the compiler. To receive warnings library-wide, place this attribute in your lib.rs file: #![warn(missing_docs)] You can also receive errors for missing documentation with this lin...
Rust provides two types of documentation comments: inner documentation comments and outer documentation comments. Examples of each are provided below. Inner Documentation Comments mod foo { //! Inner documentation comments go *inside* an item (e.g. a module or a //! struct). They use th...
/// In documentation comments, you may use **Markdown**. /// This includes `backticks` for code, *italics* and **bold**. /// You can add headers in your documentation, like this: /// # Notes /// `Foo` is unsuitable for snafucating. Use `Bar` instead. struct Foo { ... } /// It is cons...

Page 412 of 826