Tutorial by Examples: is

All non-static member functions have a hidden parameter, a pointer to an instance of the class, named this; this parameter is silently inserted at the beginning of the parameter list, and handled entirely by the compiler. When a member of the class is accessed inside a member function, it is silent...
To list available DSC resources on your authoring node: Get-DscResource This will list all resources for all installed modules (that are in your PSModulePath) on your authoring node. To list all available DSC resources that can be found in the online sources (PSGallery ++) on WMF 5 : Find-DS...
function wait(ms) { return new Promise(function (resolve, reject) { setTimeout(resolve, ms) }) }
file:write_file("myfile.txt", ["Hi " [<<"there">>], $\n]).
["Guten Tag " | [<<"Hello">>]]. [<<"Guten Tag ">> | [<<"Hello">>]]. [$G, $u, $t, $e, $n , $T, $a, $g | [<<"Hello">>]]. [71,117,116,101,110,84,97,103,<<"Hello">>].
Data_1 = [<<"Hello">>]. Data_2 = [Data_1,<<" Guten Tag ">>].
["Guten tag " | <<"Hello">>]. In the shell this will be printed as ["Guten tag "|<<"Hello">>] instead of ["Guten tag ",<<"Hello">>]. The pipe operator will create an improper list if the last element o...
Data = ["Guten tag ",<<"Hello">>], Len = iolist_size(Data), [<<Len:32>> | Data]. The size of an iolist can be calculated using the iolist_size/1. This snippet calculates the size of a message and creates and appends it to the front as a four byte bina...
<<"Guten tag, Hello">> = iolist_to_binary(["Guten tag, ",<<"Hello">>]). An IO list can be converted to a binary using the iolist_to_binary/1 function. If the data is going to be stored for a long period or sent as a message to other processes ...
Here is an example of how to define a different action for each Marker's InfoWindow click event. Use a HashMap in which the marker ID is the key, and the value is the corresponding action it should take when the InfoWindow is clicked. Then, use a OnInfoWindowClickListener to handle the event of a ...
If a class is intended to be used polymorphically, with derived instances being stored as base pointers/references, its base class' destructor should be either virtual or protected. In the former case, this will cause object destruction to check the vtable, automatically calling the correct destruc...
Consider these two micro-benchmarks: The first benchmark simply creates, starts and joins threads. The thread's Runnable does no work. public class ThreadTest { public static void main(String[] args) throws Exception { while (true) { long start = System.nanoTime(); ...
The simple and most obvious way to use recursion to get the Nth term of the Fibonnaci sequence is this int get_term_fib(int n) { if (n == 0) return 0; if (n == 1) return 1; return get_term_fib(n - 1) + get_term_fib(n - 2); } However, this algorithm does not scale for higher ...
// Store a reference to the native method let open = XMLHttpRequest.prototype.open; // Overwrite the native method XMLHttpRequest.prototype.open = function() { // Assign an event listener this.addEventListener("load", event => console.log(XHR), false); // Call the s...
You can achieve a Persistent Bottom Sheet attaching a BottomSheetBehavior to a child View of a CoordinatorLayout: <android.support.design.widget.CoordinatorLayout > <!-- ..... --> <LinearLayout android:id="@+id/bottom_sheet" android:elevation...
C# 7.0 adds accessors, constructors and finalizers to the list of things that can have expression bodies: class Person { private static ConcurrentDictionary<int, string> names = new ConcurrentDictionary<int, string>(); private int id = GetId(); public Person(string n...
Files: To determine if a file exists, simply pass the filename to the Dir$ function and test to see if it returns a result. Note that Dir$ supports wild-cards, so to test for a specific file, the passed pathName should to be tested to ensure that it does not contain them. The sample below raises an...
This is a screenshot of a video playing. You see a normal 16:9 video like you would expect to see in any modern video solution. This - the aspect ratio that the viewer sees - is what is called the display aspect ratio or DAR. From the illustrated parameters, we see that DAR = 1280:720 = 16:9 = 1....
Consider the following list comprehension Python 2.x2.7 i = 0 a = [i for i in range(3)] print(i) # Outputs 2 This occurs only in Python 2 due to the fact that the list comprehension “leaks” the loop control variable into the surrounding scope (source). This behavior can lead to hard-to-find...
The SwipeDismissBehavior works on any View and implements the functionality of swipe to dismiss in our layouts with a CoordinatorLayout. Just use: final SwipeDismissBehavior<MyView> swipe = new SwipeDismissBehavior(); //Sets the swipe direction for this behavior. ...

Page 64 of 109