Tutorial by Examples

To download the entire repository including the full history and all branches, type: git clone <url> The example above will place it in a directory with the same name as the repository name. To download the repository and save it in a specific directory, type: git clone <url> [dire...
You can create a DataFrame from a list of simple tuples, and can even choose the specific elements of the tuples you want to use. Here we will create a DataFrame using all of the data in each tuple except for the last element. import pandas as pd data = [ ('p1', 't1', 1, 2), ('p1', 't2', 3, 4)...
Component code: angular.module('myModule', []).component('myComponent', { bindings: { myValue: '<' }, controller: function(MyService) { this.service = MyService; this.componentMethod = function() { return 2; }; } }); The test: describe('myComponent', f...
By default, all types in TypeScript allow null: function getId(x: Element) { return x.id; } getId(null); // TypeScript does not complain, but this is a runtime error. TypeScript 2.0 adds support for strict null checks. If you set --strictNullChecks when running tsc (or set this flag in you...
val num = 42d Print two decimal places for num using f println(f"$num%2.2f") 42.00 Print num using scientific notation using e println(f"$num%e") 4.200000e+01 Print num in hexadecimal with a println(f"$num%a") 0x1.5p5 Other format strings can be found ...
If you would like to test a line of macro code without needing to run an entire sub, you can type commands directly into the Immediate Window and hit ENTER to run the line. For testing the output of a line, you can precede it with a question mark ? to print directly to the Immediate Window. Altern...
if ([object respondsToSelector:@selector(someOptionalMethodInProtocol:)]) { [object someOptionalMethodInProtocol:argument]; }
Move Blue to the beginning of the array: NSMutableArray *myColors = [NSMutableArray arrayWithObjects: @"Red", @"Green", @"Blue", @"Yellow", nil]; NSUInteger fromIndex = 2; NSUInteger toIndex = 0; id blue = [[[self.array objectAtIndex:fromIndex] retain]...
Every authenticated user has a Firebase uid that's unique across all providers and is returned in the result of every authentication method. A good way to store your user's data is to create a node to keep all the users's data and to protect it using your security rules - Database { "use...
You can define scripts that can be executed or are triggered before or after another script. { "scripts": { "pretest": "scripts/pretest.js", "test": "scripts/test.js", "posttest": "scripts/posttest.js" } } ...
The dynamic keyword is used with dynamically typed objects. Objects declared as dynamic forego compile-time static checks, and are instead evaluated at runtime. using System; using System.Dynamic; dynamic info = new ExpandoObject(); info.Id = 123; info.Another = 456; Console.WriteLine(info...

and

Evaluates to the second argument if and only if both of the arguments are truthy. Otherwise evaluates to the first falsey argument. x = True y = True z = x and y # z = True x = True y = False z = x and y # z = False x = False y = True z = x and y # z = False x = False y = False z =...

or

Evaluates to the first truthy argument if either one of the arguments is truthy. If both arguments are falsey, evaluates to the second argument. x = True y = True z = x or y # z = True x = True y = False z = x or y # z = True x = False y = True z = x or y # z = True x = False y = Fa...

not

It returns the opposite of the following statement: x = True y = not x # y = False x = False y = not x # y = True
Oracle's CONNECT BY functionality provides many useful and nontrivial features that are not built-in when using SQL standard recursive CTEs. This example replicates these features (with a few additions for sake of completeness), using SQL Server syntax. It is most useful for Oracle developers findin...
Deleting files The unlink function deletes a single file and returns whether the operation was successful. $filename = '/path/to/file.txt'; if (file_exists($filename)) { $success = unlink($filename); if (!$success) { throw new Exception("Cannot delete $filename&qu...
An implicit conversion allows the compiler to automatically convert an object of one type to another type. This allows the code to treat an object as an object of another type. case class Foo(i: Int) // without the implicit Foo(40) + 2 // compilation-error (type mismatch) // defines how t...
This example will guide you through setting up a back end serving an a Hello World HTML page. Installing Requirements Order matters for this step! sudo apt-get install apache2 Setting up the HTML Apache files live in /var/www/html/. Lets quickly get there. Make sure you're in your root ...
Checking if session cookies have been created Session name is the name of the cookie used to store sessions. You can use this to detect if cookies for a session have been created for the user: if(isset($_COOKIE[session_name()])) { session_start(); } Note that this method is generally not ...
for typescript 2.x: definitions from DefinitelyTyped are available via @types npm package npm i --save lodash npm i --save-dev @types/lodash but in case if you want use types from other repos then can be used old way: for typescript 1.x: Typings is an npm package that can automatically insta...

Page 211 of 1336