Tutorial by Examples

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 this example, a model will learn to classify fruits given certain features, using the Labels for training. WeightColorLabel0.5greenapple0.6purpleplum3greenwatermelon0.1redcherry0.5redapple Here the a model will take Weight and Color as features to predict the Label. For instance [0.15, 'red'] s...
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...
Methods can be defined in classes to perform a function and optionally return a result. They can receive arguments from the caller. class Something { constructor(data) { this.data = data } doSomething(text) { return { data: this.data, te...
SAS is an integrated system of software solutions that enables you to perform the following tasks: data entry, retrieval, and management report writing and graphics design statistical and mathematical analysis business forecasting and decision support operations research and project managemen...
PubNub Access Manager (PAM) extends PubNub's existing security framework by allowing developers to create and enforce secure access to channels throughout the PubNub Real Time Network. Access Manager allows you to manage granular permissions for your realtime apps and data streams, create multiple ...
joins() allows you to join tables to your current model. For ex. User.joins(:posts) will produce the following SQL query: "SELECT "users".* FROM "users" INNER JOIN "posts" ON "posts"."user_id" = "users"."id"" Hav...

Page 554 of 1336