Tutorial by Examples: er

The command :g/apples/y A will yank all lines containing the word apples into the a register, which can be pasted with "ap. Any regular expression can be used. Note the space before the A, and the capitalization of the register letter. If a capital letter is used as the yank register, matc...
When you first start Julia, by default, there will only be a single process running and available to give work to. You can verify this using: julia> nprocs() 1 In order to take advantage of parallel processing, you must first add additional workers who will then be available to do work that...
SELECT @@VERSION Returns the version of MS SQL Server running on the instance. SELECT @@SERVERNAME Returns the name of the MS SQL Server instance. SELECT @@SERVICENAME Returns the name of the Windows service MS SQL Server is running as. SELECT serverproperty('ComputerNamePhysicalNetBIOS'...
Stored procedures can return values using the OUTPUT keyword in its parameter list. Creating a stored procedure with a single out parameter CREATE PROCEDURE SprocWithOutParams ( @InParam VARCHAR(30), @OutParam VARCHAR(30) OUTPUT ) AS BEGIN SELECT @OutParam = @InParam + ' must co...
Problem: You need to match text of a certain format, for example: 1-a-0 6/p/0 4 g 0 That's a digit, a separator (one of -, /, or a space), a letter, the same separator, and a zero. Naïve solution: Adapting the regex from the Basics example, you come up with this regex: [0-9]([-/ ])[a-z]\...
Linux running systemd, like Ubuntu 16.04, adding -H tcp://0.0.0.0:2375 to /etc/default/docker does not have the effect it used to. Instead, create a file called /etc/systemd/system/docker-tcp.socket to make docker available on a TCP socket on port 4243: [Unit] Description=Docker Socket for the AP...
MERGE INTO targetTable USING sourceTable ON (targetTable.PKID = sourceTable.PKID) WHEN MATCHED AND (targetTable.PKID > 100) THEN DELETE WHEN MATCHED AND (targetTable.PKID <= 100) THEN UPDATE SET targetTable.ColumnA = sourceTable.ColumnA, targetTable.Co...
WITH SourceTableCTE AS ( SELECT * FROM SourceTable ) MERGE TargetTable AS target USING SourceTableCTE AS source ON (target.PKID = source.PKID) WHEN MATCHED THEN UPDATE SET target.ColumnA = source.ColumnA WHEN NOT MATCHED THEN INSERT (ColumnA) VALUES (Source.ColumnA);...
MERGE INTO TargetTable AS Target USING (VALUES (1,'Value1'), (2, 'Value2'), (3,'Value3')) AS Source (PKID, ColumnA) ON Target.PKID = Source.PKID WHEN MATCHED THEN UPDATE SET target.ColumnA= source.ColumnA WHEN NOT MATCHED THEN INSERT (PKID, ColumnA) VALUES (Source.PKID...
WITHOUT_ARRAY_WRAPPER option in FOR JSON clause will remove array brackets from the JSON output. This is useful if you are returning single row in the query. Note: this option will produce invalid JSON output if more than one row is returned. Input table data (People table) IdNameAge1John232J...
Functions can have optional parameters, for example: function hello($name, $style = 'Formal') { switch ($style) { case 'Formal': print "Good Day $name"; break; case 'Informal': print "Hi $name"; break; ...
Function arguments can be passed "By Reference", allowing the function to modify the variable used outside the function: function pluralize(&$word) { if (substr($word, -1) == 'y') { $word = substr($word, 0, -1) . 'ies'; } else { $word .= 's'; } } $w...
The standard requires that long double provides at least as much precision as double, which provides at least as much precision as float; and that a long double can represent any value that a double can represent, while a double can represent any value that a float can represent. The details of the ...
If you like to organize your project by keeping source files in different subdirectories, you should know that during a build qmake will not preserve this directory structure and it will keep all the ".o" files in a single build directory. This can be a problem if you had conflicting file ...
public function actionFormSubmission() { $security = new Security(); $string = Yii::$app->request->post('string'); $stringHash = ''; if (!is_null($string)) { $stringHash = $security->generatePasswordHash($string); } return $this->render('form-submi...
USE AdventureWorks2012; GO CREATE FULLTEXT CATALOG production_catalog; GO CREATE FULLTEXT INDEX ON Production.ProductReview ( ReviewerName Language 1033, EmailAddress Language 1033, Comments Language 1033 ) KEY INDEX PK_ProductR...
USE AdventureWorks2012; GO CREATE FULLTEXT INDEX ON Production.Document ( Title Language 1033, DocumentSummary Language 1033, Document TYPE COLUMN FileExtension Language 1033 ) KEY INDEX PK_Document_DocumentID ...
Postmodern is a library to interface the relational database PostgreSQL. It offers several levels of access to PostgreSQL, from the execution of SQL queries represented as strings, or as lists, to an object-relational mapping. The database used in the following examples can be created with these SQ...
Basic error handling should be added to all procedures in production code, since otherwise an unexpected error will cause Access to crash or invite the end-user to enter debug mode. A typical pattern for a basic error handler that traps all errors is: Sub Name() On Error GoTo errHandler '[some...
Enable utf8 pragma In order to enable utf8 pragma in one-liner, perl interpreter should be called with -Mutf8 option: perl -Mutf8 -E 'my $人 = "human"; say $人' Unicode handling with -C switch The -C command line flag lets you control Unicode features. It can be followed by a list of o...

Page 196 of 417