Tutorial by Examples: alt

In contrast of a full template specialization partial template specialization allows to introduce template with some of the arguments of existing template fixed. Partial template specialization is only available for template class/structs: // Common case: template<typename T, typename U> st...
public function up() { $this->dropColumn('post', 'position'); $this->renameColumn('post', 'owner_id', 'user_id'); $this->alterColumn('post', 'updated', $this->timestamp()->notNull()->defaultValue('0000-00-00 00:00:00')); }
Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. You can use the _cat APIs to get a human readable, tabular output for various reasons. GET /_cat/health?v <1> The ?v is optional, but it implies that you want "verbose" output. _...
LOOP AT itab INTO wa. ENDLOOP. FIELD-SYMBOLS <fs> LIKE LINE OF itab. LOOP AT itab ASSIGNING <fs>. ENDLOOP. LOOP AT itab ASSIGNING FIELD-SYMBOL(<fs>). ENDLOOP. LOOP AT itab REFERENCE INTO dref. ENDLOOP. LOOP AT itab TRANSPORTING NO FIELDS. ENDLOOP. Conditional L...
PHP provides an alternative syntax for some control structures: if, while, for, foreach, and switch. When compared to the normal syntax, the difference is, that the opening brace is replaced by a colon (:) and the closing brace is replaced by endif;, endwhile;, endfor;, endforeach;, or endswitch;, ...
Alternate return is a facility to control the flow of execution on return from a subroutine. It is often used as a form of error handling: real x call sub(x, 1, *100, *200) print*, "Success:", x stop 100 print*, "Negative input value" stop 200 print*, "Input va...
CREATE DATABASE stackoverflow; USE stackoverflow; Create table stack( id_user int NOT NULL, username varchar(30) NOT NULL, password varchar(30) NOT NULL ); ALTER TABLE stack ADD COLUMN submit date NOT NULL; -- add new column ALTER TABLE stack DROP COLUMN submit; -- drop col...
Because in .NET 3.5 and older you don't have Lazy<T> class you use the following pattern: public class Singleton { private Singleton() // prevents public instantiation { } public static Singleton Instance { get { return Nested.instanc...
String literal types allow you to specify the exact value a string can have. let myFavoritePet: "dog"; myFavoritePet = "dog"; Any other string will give a error. // Error: Type '"rock"' is not assignable to type '"dog"'. // myFavoritePet = "rock&qu...
This example shows how to use two audio sources, and alter one of them based on the other. In this case we create an audio Ducker, that will lower the volume of the primary track if the secondary track produces sound. The ScriptProcessorNode will send regular events to its audioprocess handler. In ...
The HEALTHCHECK instruction has two forms: HEALTHCHECK [OPTIONS] CMD command (check container health by running a command inside the container) HEALTHCHECK NONE (disable any healthcheck inherited from the base image) The HEALTHCHECK instruction tells Docker how to test a container to check that...
Another use of RODBC is in connecting with SQL Server Management Database. We need to specify the 'Driver' i.e. SQL Server here, the database name "Atilla" and then use the sqlQuery to extract either the full table or a fraction of it. library(RODBC) cn <- odbcDriverConnect(connect...
Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. You can use the _cat APIs to get a human readable, tabular output for various reasons. GET /_cat/health <1> _cat/health has existed since Elasticsearch 1.x, but here is an example of its output...
Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. Like most _cat APIs in Elasticsearch, the API selectively responds with a default set of fields. However, other fields exist from the API if you want them: GET /_cat/health?help <1> ?help cau...
Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. The _cat APIs are often convenient for humans to get at-a-glance details about the cluster. But you frequently want consistently parseable output to use with software. In general, the JSON APIs are meant...
Related to Monads are F# computation expressions (CE). A programmer typically implements a CE to provide an alternative approach to chaining Monads, ie instead of this: let v = m >>= fun x -> n >>= fun y -> return_ (x, y) You can write this: let v = ce { let! x = m ...
To use just the time part of a Date use LocalTime. You can instantiate a LocalTime object in a couple ways LocalTime time = LocalTime.now(); time = LocalTime.MIDNIGHT; time = LocalTime.NOON; time = LocalTime.of(12, 12, 45); LocalTime also has a built in toString method that displays the for...
It's easier to implement some UDFs on the worksheet if full column references can be passed in as parameters. However, due to the explicit nature of coding, any loop involving these ranges may be processing hundreds of thousands of cells that are completely empty. This reduces your VBA project (and ...
Here are examples of how to use monotonic predicates instead of impure, non-monotonic constructs in your programs: dif/2 is meant to be used instead of non-monotonic constructs like (\=)/2 arithmetic constraints (CLP(FD), CLP(Q) and others) are meant to be used instead of moded arithmetic predi...
To improve performance one might want to add indexes to columns ALTER TABLE TABLE_NAME ADD INDEX `index_name` (`column_name`) altering to add composite (multiple column) indexes ALTER TABLE TABLE_NAME ADD INDEX `index_name` (`col1`,`col2`)

Page 2 of 6