Tutorial by Examples: l

<PROJECT_ROOT>\app\build.gradle is specific for app module. <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project, as a local library you would have another...
A list in Erlang is a sequence of zero or more Erlang terms, implemented as a singly linked list. Each element in the list can be any type of term (any data type). 1> [1,2,3]. [1,2,3] 2> [wow,1,{a,b}]. [wow,1,{a,b}] The list's head is the first element of the list. The list's tail...
@interface MyObject : MySuperclass @property (copy) void (^blockProperty)(NSString *string); @end When assigning, since self retains blockProperty, block should not contain a strong reference to self. Those mutual strong references are called a "retain cycle" and will prevent the...
Key Value Coding is integrated into NSObject using NSKeyValueCoding protocol. What this means? It means that any id object is capable of calling valueForKey method and its various variants like valueForKeyPath etc. ' It also means that any id object can invoke setValue method and its various vari...
The clone() method is used to create and return a copy of an object. This method arguable should be avoided as it is problematic and a copy constructor or some other approach for copying should be used in favour of clone(). For the method to be used all classes calling the method must implement the...
Google Apps Script does not require setup or installation. The only requirement is a Google Account. A Gmail account works as well as a Google Apps for Work/Education/Government account. You can create a new Google account by going to accounts.google.com Start your first script by going to script.g...
At its simplest, a property is a function which returns a Bool. prop_reverseDoesNotChangeLength xs = length (reverse xs) == length xs A property declares a high-level invariant of a program. The QuickCheck test runner will evaluate the function with 100 random inputs and check that the result is...
Classes can be created dynamically through the use of Class.new. # create a new class dynamically MyClass = Class.new # instantiate an object of type MyClass my_class = MyClass.new In the above example, a new class is created and assigned to the constant MyClass. This class can be instanti...
You can use an instance of an object to form your parameters public class SearchParameters { public string SearchString { get; set; } public int Page { get; set; } } var template= new SearchParameters { SearchString = "Dapper", Page = 1 }; var p = new DynamicParameters...
Java SE 8 An array of strings can be joined using the static method String.join(): String[] elements = { "foo", "bar", "foobar" }; String singleString = String.join(" + ", elements); System.out.println(singleString); // Prints "foo + bar + foobar&qu...
Creating an HTML document and enabling knockout.js Create an HTML file and include knockout.js via a <script> tag. <!DOCTYPE html> <html> <head> <title>Hello world! (knockout.js)</title> </head> <body> <script src="https://cdnjs...
The quickCheck function tests a property on 100 random inputs. ghci> quickCheck prop_reverseDoesNotChangeLength +++ OK, passed 100 tests. If a property fails for some input, quickCheck prints out a counterexample. prop_reverseIsAlwaysEmpty xs = reverse xs == [] -- plainly not true for all ...
To start coding in the first place, you have to right click your VBA Project in the left list and add a new Module. Your first Hello-World Code could look like this: Sub HelloWorld() MsgBox "Hello, World!" End Sub To test it, hit the Play-Button in your Toolbar or simply hit the...
To do an insert on specific columns (as opposed to all of them) you must specify the columns you want to update. INSERT INTO USERS (FIRST_NAME, LAST_NAME) VALUES ('Stephen', 'Jiang'); This will only work if the columns that you did not list are nullable, identity, timestamp data type or compute...
To insert multiple rows of data in SQL Server 2008 or later: INSERT INTO USERS VALUES (2, 'Michael', 'Blythe'), (3, 'Linda', 'Mitchell'), (4, 'Jillian', 'Carson'), (5, 'Garrett', 'Vargas'); To insert multiple rows of data in earlier versions of SQL Server, use "UNION ALL" like so: ...
A single row of data can be inserted in two ways: INSERT INTO USERS(Id, FirstName, LastName) VALUES (1, 'Mike', 'Jones'); Or INSERT INTO USERS VALUES (1, 'Mike', 'Jones'); Note that the second insert statement only allows the values in exactly the same order as the table columns whereas in...
If you wish to copy the contents of a slice into an initially empty slice, following steps can be taken to accomplish it- Create the source slice: var sourceSlice []interface{} = []interface{}{"Hello",5.10,"World",true} Create the destination slice, with: Length =...
The canvas element was introduced in HTML5 for drawing graphics. <canvas id="myCanvas"> Cannot display graphic. Canvas is not supported by your browser (IE<9) </canvas> The above will create a transparent HTML<canvas> element of 300×150 px in size. You can us...
The family of x86 assembly languages represents decades of advances on the original Intel 8086 architecture. In addition to there being several different dialects based on the assembler used, additional processor instructions, registers and other features have been added over the years while still r...
Angular2 comes with a few built-in pipes: PipeUsageExampleDatePipedate{{ dateObj | date }} // output is 'Jun 15, 2015'UpperCasePipeuppercase{{ value | uppercase }} // output is 'SOMETEXT'LowerCasePipelowercase{{ value | lowercase }} // output is 'sometext'CurrencyPipecurrency{{ 31.00 | currency:'US...

Page 90 of 861