Tutorial by Examples: er

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...
iOS 6 Within a single line, we can get an UUID like below: Swift let UDIDString = UIDevice.currentDevice().identifierForVendor?.UUIDString Objective-C NSString *UDIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; The identifierForVendor is an unique identifier that st...
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 = ...
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...
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 perform a query in Apex, surround the query with square brackets. The result can be assigned to a list, or to a single object. List<Account> allAccounts = [SELECT Id, Name FROM Account]; Account oldestAccount = [SELECT Id, Name FROM Account ORDER BY CreatedDate LIMIT 1];
To reference a variable in a query, add a colon (:) before the variable name. Datetime targetDate = Datetime.now().addDays(-7); List<Lead> recentLeads = [SELECT Id FROM Lead WHERE CreatedDate > :targetDate]; string targetName = 'Unknown'; List<Contact> incompleteContacts = [SELE...
When assigning to a single object, a query that returns anything other than a single row will throw a QueryException. try { Account a = [SELECT Id FROM Account WHERE Name = 'Non-existent Account']; } catch (QueryException e) { // List has no rows for assignment to SObject } try { ...
Intent: Separate the construction of a complex object from its representation so that the same construction process can create different representations Builder pattern is useful when you have few mandatory attributes and many optional attributes to construct a object. To create an object with dif...
Often you will want to perform asynchronous operations in parallel. There is direct syntax that supports this in the async/await proposal, but since await will wait for a promise, you can wrap multiple promises together in Promise.all to wait for them: // Not in parallel async function getFriend...
The visitor Pattern can be used to traverse structures. class GraphVisitor; class Graph { public: class Node { using Link = std::set<Node>::iterator; std::set<Link> linkTo; public: void accept(GraphVisito...
<?php use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; class TestController extends Controller { //Inject Request HTTP Component in your function then able to exploit it public function myFunctionAction(Request $request) {...
You can disable compiler warnings using #pragma warning disable and restore them using #pragma warning restore: #pragma warning disable CS0168 // Will not generate the "unused variable" compiler warning since it was disabled var x = 5; #pragma warning restore CS0168 // Will gene...
We shall create a simple Alert Dialog in Xamarin.Android Now considering you have gone through the getting started guide from the documentation. You must be having the project structure like this: Your Main Activity must be looking like this: public class MainActivity : Activity { ...
We can use the insert() method to insert a value at any index of the array. Here is an example : my_array = array('i', [1,2,3,4,5]) my_array.insert(0,0) #array('i', [0, 1, 2, 3, 4, 5]) In the above example, the value 0 was inserted at index 0. Note that the first argument is the index while se...
The reverse() method does what the name says it will do - reverses the array. Here is an example : my_array = array('i', [1,2,3,4,5]) my_array.reverse() # array('i', [5, 4, 3, 2, 1])
This method provides you the array buffer start address in memory and number of elements in array. Here is an example: my_array = array('i', [1,2,3,4,5]) my_array.buffer_info() (33881712, 5)

Page 211 of 417