Tutorial by Examples: e

Len

Returns the number of characters of a string. Note: the LEN function ignores trailing spaces: SELECT LEN('My string'), -- returns 9 LEN('My string '), -- returns 9 LEN(' My string') -- returns 12 If the length including trailing spaces is desired there are several techniques...
Returns a character expression (varchar or nvarchar) after converting all uppercase characters to lowercase. Parameters: Character expression. Any expression of character or binary data that can be implicitly converted to varchar. SELECT LOWER('This IS my STRING') -- Returns 'this is my strin...
Returns a character expression (varchar or nvarchar) after converting all lowercase characters to uppercase. Parameters: Character expression. Any expression of character or binary data that can be implicitly converted to varchar. SELECT UPPER('This IS my STRING') -- Returns 'THIS IS MY STRIN...
Returns the integer value representing the Unicode value of the first character of the input expression. Parameters: Unicode character expression. Any valid nchar or nvarchar expression. SELECT UNICODE(N'Ɛ') -- Returns 400 DECLARE @Unicode nvarchar(11) = N'Ɛ is a char' SELECT UNICODE(@Uni...
An interface contains the signatures of methods, properties and events. The derived classes defines the members as the interface contains only the declaration of the members. An interface is declared using the interface keyword. interface IProduct { decimal Price { get; } } class Product...
List comprehensions are a syntactic construct to create a list based on existing lists. In erlang a list comprehension has the form [Expr || Qualifier1, ..., QualifierN]. Where qualifiers are either generators Pattern <- ListExpr or filter like integer(X) evaluating to either true or false. Th...
plot() can take arguments that get passed on to matplotlib to style the plot in different ways. df.plot(style='o') # plot as dots, not lines df.plot(style='g--') # plot as green dashed line df.plot(style='o', markeredgecolor='white') # plot as dots with white edge
By default, plot() creates a new figure each time it is called. It is possible to plot on an existing axis by passing the ax parameter. plt.figure() # create a new figure ax = plt.subplot(121) # create the left-side subplot df1.plot(ax=ax) # plot df1 on that subplot ax = plt.subplot(122) # c...
All integers or pointers can be used in an expression that is interpreted as "truth value". int main(int argc, char* argv[]) { if (argc % 4) { puts("arguments number is not divisible by 4"); } else { puts("argument number is divisible by 4"); } ... ...
ScopedTypeVariables let you refer to universally quantified types inside of a declaration. To be more explicit: import Data.Monoid foo :: forall a b c. (Monoid b, Monoid c) => (a, b, c) -> (b, c) -> (a, b, c) foo (a, b, c) (b', c') = (a :: a, b'', c'') where (b'', c'') = (b <&g...
If an array happens to have one or more nil elements and these need to be removed, the Array#compact or Array#compact! methods can be used, as below. array = [ 1, nil, 'hello', nil, '5', 33] array.compact # => [ 1, 'hello', '5', 33] #notice that the method returns a new copy of the array w...
The code sample below shows one way to retrieve records from an MSSql Server in a background thread using FireDAC. Tested for Delphi 10 Seattle As written: The thread retrieves data using its own TFDConnection and TFDQuery and transfers the data to the form's FDQuery in a call to Sychronize...
In Clojure everything that is not nil or false is considered logical true. Examples: (boolean nil) ;=> false (boolean false) ;=> false (boolean true) ;=> true (boolean :a) ;=> true (boolean "false") ;=> true (boolean 0) ;=> tru...
PHP's source code is hosted on GitHub. To build from source you will first need to check out a working copy of the code. mkdir /usr/local/src/php-7.0/ cd /usr/local/src/php-7.0/ git clone -b PHP-7.0 https://github.com/php/php-src . If you want to add a feature, it's best to create your own bra...
We can use flatten() in order to lazily reduce the nesting of a multi-dimensional sequence. For example, lazy flattening a 2D array into a 1D array: // A 2D array of type [[Int]] let array2D = [[1, 3], [4], [6, 8, 10], [11]] // A FlattenBidirectionalCollection<[[Int]]> let lazilyFlatten...
Melting: The basics Melting is used to transform data from wide to long format. Starting with a wide data set: DT = data.table(ID = letters[1:3], Age = 20:22, OB_A = 1:3, OB_B = 4:6, OB_C = 7:9) We can melt our data using the melt function in data.table. This returns another data.table in long...
To create a libary , you should use File -> New -> New Module -> Android Library. This will create a basic library project. When that's done, you must have a project that is set up the following manner: [project root directory] [library root directory] [gradle] build.gradle...
To use the library, you must include it as a dependency with the following line: compile project(':[library root directory]')
Perform the following steps to create the library: Create a GitHub account. Create a Git repository containing your library project. Modify your library project's build.gradle file by adding the following code: apply plugin: 'com.github.dcendents.android-maven' ... // Build a j...
The PHP execution operator consists of backticks (``) and is used to run shell commands. The output of the command will be returned, and may, therefore, be stored in a variable. // List files $output = `ls`; echo "<pre>$output</pre>"; Note that the execute operator and sh...

Page 489 of 1191