Tutorial by Examples: and

Parentheses are needed to avoid ambiguity: foo 1 |> bar 2 |> baz 3 Should be written as: foo(1) |> bar(2) |> baz(3)
/// <summary> /// Returns the data for the specified ID and timestamp. /// </summary> /// <param name="id">The ID for which to get data. </param> /// <param name="time">The DateTime for which to get data. </param> /// <returns>A Data...
Stored procedures can be created through a database management GUI (SQL Server example), or through a SQL statement as follows: -- Define a name and parameters CREATE PROCEDURE Northwind.getEmployee @LastName nvarchar(50), @FirstName nvarchar(50) AS -- Define the query to be...
Horizontally vim -o file1.txt file2.txt Vertically vim -O file1.txt file2.txt You may optionally specify the number of splits to open. The following example opens two horizontal splits and loads file3.txt in a buffer: vim -o2 file1.txt file2.txt file3.txt
Packages are collections of R functions, data, and compiled code in a well-defined format. Public (and private) repositories are used to host collections of R packages. The largest collection of R packages is available from CRAN. Using CRAN A package can be installed from CRAN using following code...
Variables of character type or of a derived type with length parameter may have the length parameter either assumed or deferred. The character variable name character(len=len) name is of length len throughout execution. Conversely the length specifier may be either character(len=*) ... ! Ass...

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 =...
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...
Any data structure that supports __getitem__ can have their nested structure formatted: person = {'first': 'Arthur', 'last': 'Dent'} '{p[first]} {p[last]}'.format(p=person) # 'Arthur Dent' Object attributes can be accessed using getattr(): class Person(object): first = 'Zaphod' la...
Exporting a macro to allow other modules to use it: #[macro_export] // ^~~~~~~~~~~~~~~ Think of it as `pub` for macros. macro_rules! my_macro { (..) => {..} } Using macros from other crates or modules: #[macro_use] extern crate lazy_static; // ^~~~~~~~~~~~ Must add this in ord...
This topic specifically talks about UTF-8 and considerations for using it with a database. If you want more information about using databases in PHP then checkout this topic. Storing Data in a MySQL Database: Specify the utf8mb4 character set on all tables and text columns in your database. ...
The following code will print the arguments to the program, and the code will attempt to convert each argument into a number (to a long): #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <limits.h> int main(int argc, char* argv[]) { for (int ...
Defining a member block inside a resource creates a route that can act on an individual member of that resource-based route: resources :posts do member do get 'preview' end end This generates the following member route: get '/posts/:id/preview', to: 'posts#preview' # preview_post_p...
The specifier override has a special meaning in C++11 onwards, if appended at the end of function signature. This signifies that a function is Overriding the function present in base class & The Base class function is virtual There is no run time significance of this specifier as is mainl...
In Python 2, <> is a synonym for !=; likewise, `foo` is a synonym for repr(foo). Python 2.x2.7 >>> 1 <> 2 True >>> 1 <> 1 False >>> foo = 'hello world' >>> repr(foo) "'hello world'" >>> `foo` "'hello world'"...
child.py import time def main(): print "starting work" time.sleep(1) print "work work work work work" time.sleep(1) print "done working" if __name__ == '__main__': main() parent.py import os def main(): for i in range(5):...
This example starts Notepad, waits for it to be closed, then gets its exit code. #include <Windows.h> int main() { STARTUPINFOW si = { 0 }; si.cb = sizeof(si); PROCESS_INFORMATION pi = { 0 }; // Create the child process BOOL success = CreateProcessW( L"C:...
Removing a variable name from the scope using del v, or removing an object from a collection using del v[item] or del[i:j], or removing an attribute using del v.name, or any other way of removing references to an object, does not trigger any destructor calls or any memory being freed in and of itsel...
Inventory is the Ansible way to track all the systems in your infrastructure. Here is a simple inventory file containing a single system and the login credentials for Ansible. [targethost] 192.168.1.1 ansible_user=mrtuovinen ansible_ssh_pass=PassW0rd
This example creates a new file named "NewFile.txt", then writes "Hello World!" to its body. If the file already exists, CreateFile will fail and no data will be written. See the dwCreationDisposition parameter in the CreateFile documentation if you don't want the function to fa...

Page 24 of 153