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 ContactTrigger on Contact (before insert, after insert,
before update, after update,
before delete, after delete,
after undelete) {
/** Before or After trigger execution**/
/...
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...
An array is a data structure that stores values of same data type. In Python, this is the main difference between arrays and lists.
While python lists can contain values corresponding to different data types, arrays in python can only contain values corresponding to same data type. In this tutorial...
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...
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...
Since Java lambdas are closures, they can "capture" the values of variables in the enclosing lexical scope. While not all lambdas capture anything -- simple lambdas like s -> s.length() capture nothing and are called stateless -- capturing lambdas require a temporary object to hold the...
If you like to show the dialog without the close button (i.e. the x button in the upper-right corner of the dialog), perhaps because you want to force the user to select one of options or buttons in the dialog itself:
1- Give your dialog a CSS class:
$("#selector").dialog({
closeOnE...
Apps Script:
//Triggered when the page is navigated to, serves up HTML
function doGet(){
var template = HtmlService.createTemplateFromFile('index');
return template.evaluate()
.setTitle('Example App')
.setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
//Called from the cli...
System.Obsolete is an attribute that is used to mark a type or a member that has a better version, and thus should not be used.
[Obsolete("This class is obsolete. Use SomeOtherClass instead.")]
class SomeClass
{
//
}
In case the class above is used, the compiler will give the w...
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...
You can find the Android Sample in [SFML_ROOT]\examples\android
You can copy it to leave the SFML repository in it's original state. Open cmd.exe in the sample location.
To get a list of all available Android build targets:
android list target
Run Update Project for the Sample:
android upda...
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....
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...
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)
count() will return the number of times and element appears in an array. In the following example we see that the value 3 occurs twice.
my_array = array('i', [1,2,3,3,5])
my_array.count(3)
# 2
Provided that barButtonItem has a non-null image property (e.g. set in the Interface Builder).
Objective-C
barButtonItem.image = [barButtonItem.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
Context is important if you ship your class for others to use.Context lets your class observer verify that its you observer which is being called.
The ...