Tutorial by Examples

interface IFoo { } class Foo : IFoo { } class Bar : IFoo { } var item0 = new Foo(); var item1 = new Foo(); var item2 = new Bar(); var item3 = new Bar(); var collection = new IFoo[] { item0, item1, item2, item3 }; Using OfType var foos = collection.OfType<Foo>(); // result: IEnum...
Special care needs to be taken when there is a possibility that an array become an empty array when it comes to logical operators. It is often expected that if all(A) is true then any(A) must be true and if any(A) is false, all(A) must also be false. That is not the case in MATLAB with empty arrays....
To convert a String to uppercase, use uppercaseString: NSString *myString = @"Emphasize this"; NSLog(@"%@", [myString uppercaseString]; // @"EMPHASIZE THIS" To convert a String to lowercase, use lowercaseString: NSString *myString = @"NORMALIZE this"; N...
Strings are compared for equality using isEqualToString: The == operator just tests for object identity and does not compare the logical values of objects, so it can't be used: NSString *stringOne = @"example"; NSString *stringTwo = [stringOne mutableCopy]; BOOL objectsAreIdentical =...
Modules can have a special variable named __all__ to restrict what variables are imported when using from mymodule import *. Given the following module: # mymodule.py __all__ = ['imported_by_star'] imported_by_star = 42 not_imported_by_star = 21 Only imported_by_star is imported when usi...
The checked out file will overwrite not yet commited changes you did in this file. This command will check out the file file.example (which is located in the directory path/to/) and overwrite any changes you might have made to this file. git checkout some-branch path/to/file some-branch can be ...
To develop an application for iOS, you should start with an application called Xcode. There are other alternative tools you can use, but Xcode is Apple's official tool. Note, however, that it only runs on macOS. The latest official version is Xcode 8.3.3 with Xcode 9 (currently in beta) due to be re...
As of Tensorflow version 1.0 installation has become much easier to perform. At minimum to install TensorFlow one needs pip installed on their machine with a python version of at least 2.7 or 3.3+. pip install --upgrade tensorflow # for Python 2.7 pip3 install --upgrade tensorflow # for ...
There are two ways to connect to a MySQL/MariaDB server, depending on your infrastructure. Standard (TCP/IP) connection $dsn = 'mysql:dbname=demo;host=server;port=3306;charset=utf8'; $connection = new \PDO($dsn, $username, $password); // throw exceptions, when SQL error is caused $connection-...
Installing package manager Homebrew brew Paste that at a Terminal prompt. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Installing Xcode IDE Download it using link below or find it on Mac App Store https://developer.apple.com/down...
Objective-C CGRect myFrame = CGRectMake(0, 0, 320, 35) UIView *view = [[UIView alloc] initWithFrame:myFrame]; //Alternative way of defining the frame UIView *view = [[UIView alloc] init]; CGRect myFrame = view.frame; myFrame.size.width = 320; myFrame.size.height = 35; myFrame.origin.x = 0;...
Some HTML tags can also be used in Markdown. <b>bold</b> bold <i>italic</i> italic <a href="http://stackoverflow.com/">link</a> link <kbd>Ctrl</kbd> Ctrl Named anchors can also be used to allow easier navigation within the document. ...
Lists can be created in multiple ways. The recommended way is to use a List literal: var vegetables = ['broccoli', 'cabbage']; The List constructor can be used as well: var fruits = new List(); If you prefer stronger typing, you can also supply a type parameter in one of the following ways:...
Sets can be created via the constructor: var ingredients = new Set(); ingredients.addAll(['gold', 'titanium', 'xenon']);
Maps can be created in multiple ways. Using the constructor, you can create a new map as follow: var searchTerms = new Map(); Types for the key and value can also be defined using generics: var nobleGases = new Map<int, String>(); var nobleGases = <int, String>{}; Maps can othe...
The % wildcard appended to the beginning or end (or both) of a string will allow 0 or more of any character before the beginning or after the end of the pattern to match. Using '%' in the middle will allow 0 or more characters between the two parts of the pattern to match. We are going to use this...
When working with multi-module projects, it is helpful to centralize dependencies in a single location rather than having them spread across many build files, especially for common libraries such as the Android support libraries and the Firebase libraries. One recommended way is to separate the Gra...
To print a listing of the Error Code descriptions to the Immediate Window, pass it to the Debug.Print function: Private Sub ListErrCodes() Debug.Print "List Error Code Descriptions" For i = 0 To 65535 e = Error(i) If e <> "Application-defined or obje...
The this keyword refers to the current instance of class(object). That way two variables with the same name, one at the class-level (a field) and one being a parameter (or local variable) of a method, can be distinguished. public MyClass { int a; void set_a(int a) { //this...
Detailed instructions on getting google-maps set up or installed.

Page 109 of 1336