Tutorial by Examples: v

trigger ContactTrigger on Contact (before insert, after insert, before update, after update, before delete, after delete, after undelete) { /** Before or After trigger execution**/ /...
/// 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...
Vaadin plug-in for eclipse provides a quick way to build vaadin project with Apache Ivy dependency manager. Vaadin's documentation explains how to create vaadin project with the help of Eclipse plugin. To install the plug-in just go to eclipse marketplace and search vaadin. Current version of the p...
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...
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...
Template method pattern is a behavioral design pattern that defines the program skeleton of an algorithm in an operation, defering some steps to subclasses. Structure: Key notes: Template method uses Inheritance The Template method implemented by the base class should not be overridden. In t...
entry = tk.Entry(parent, width=10) entry.insert(0, "Hello, World!")
The value of an entry widget can be obtained with the get method of the widget: name_entry = tk.Entry(parent) ... name = name_entry.get() Optionally, you may associate an instance of a StringVar, and retrieve the value from the StringVar rather than from the widget: name_var = tk.StringVar() ...
// A simple class hierarchy that uses the visitor to add functionality. // class VehicleVisitor; class Vehicle { public: // To implement the visitor pattern // The class simply needs to implement the accept method // That takes a reference to a visitor object tha...
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...
Add following Paths to the PATH-Enviromentvariable [Path to CMake]\bin [Path to Git]\bin [Path to SDK]\tools [Path to SDK]\platform-tools [Path to NDK] [Path to ANT]\bin [Path to MinGW]\bin [Path to MinGW]\msys\1.0\bin [Path to Java jre]\bin [Path to Java jdk]\bin Make sure you use ba...
import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; public class KeyBoardExample { public static void main(String[] args) { try { Robot robot = new Robot(); robot.delay(3000); robot.keyPress(KeyEvent.VK_Q); //...
Mouse movement: import java.awt.Robot; public class MouseClass { public static void main(String[] args) throws Exception { Robot robot = new Robot(); // SET THE MOUSE X Y POSITION robot.mouseMove(300, 550); } } Press left/right button of mouse: import java.awt....
Swift 2 import UIKit extension UIDevice { var modelName: String { var systemInfo = utsname() uname(&systemInfo) let machineMirror = Mirror(reflecting: systemInfo.machine) let identifier = machineMirror.children.reduce("") { identifier, ele...
Individual elements can be accessed through indexes. Python arrays are zero-indexed. Here is an example : my_array = array('i', [1,2,3,4,5]) print(my_array[1]) # 2 print(my_array[2]) # 3 print(my_array[0]) # 1
my_array = array('i', [1,2,3,4,5]) my_array.append(6) # array('i', [1, 2, 3, 4, 5, 6]) Note that the value 6 was appended to the existing array values.
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...
Here is an example : my_array = array('i', [1,2,3,4,5]) my_array.remove(4) # array('i', [1, 2, 3, 5]) We see that the element 4 was removed from the array.
pop removes the last element from the array. Here is an example : my_array = array('i', [1,2,3,4,5]) my_array.pop() # array('i', [1, 2, 3, 4]) So we see that the last element (5) was popped out of array.
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])

Page 143 of 296