Tutorial by Examples: n

1. Jenkins : Jenkins is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute with Oracle. In a nutshell, Jenkins is the leading open source automation server. Built with Java, it provides hundreds of plugins to support building, testing, de...
Setup Spark context in R To start working with Sparks distributed dataframes, you must connect your R program with an existing Spark Cluster. library(SparkR) sc <- sparkR.init() # connection to Spark context sqlContext <- sparkRSQL.init(sc) # connection to SQL context Here are infos how...
If you'd like to quickly test if an ability class is giving the correct permissions, you can initialize an ability in the console or on another context with the rails environment loaded, just pass an user instance to test against: test_ability = Ability.new(User.first) test_ability.can?(:show, Pos...
The QueryClose event is raised whenever a form is about to be closed, whether it's via user action or programmatically. The CloseMode parameter contains a VbQueryClose enum value that indicates how the form was closed: ConstantDescriptionValuevbFormControlMenuForm is closing in response to user act...
import groovy.json.JsonSlurper; def jsonSlurper = new JsonSlurper() def obj = jsonSlurper.parseText('{ "foo": "bar", "baz": [1] }') assert obj.foo == 'bar' assert obj.baz == [1]
import groovy.json.JsonSlurper; def jsonSlurper = new JsonSlurper() File fl = new File('/path/to/fils.json') // parse(File file) method is available since 2.2.0 def obj = jsonSlurper.parse(fl) // for versions < 2.2.0 it's possible to use def old = jsonSlurper.parse(fl.text)
import groovy.json.JsonOutput; def json = JsonOutput.toJson([foo: 'bar', baz: [1]]) assert json == '{"foo":"bar","baz":[1]}' In addition to maps, lists and primitives groovy.json.JsonOutput also supports a POJOs serialitzation: import groovy.json.JsonOutput; ...
import groovy.json.JsonOutput; def json = JsonOutput.toJson([foo: 'bar', baz: [1]]) assert json == '{"foo":"bar","baz":[1]}' def pretty = JsonOutput.prettyPrint(json) assert pretty == '''{ "foo": "bar", "baz": [ ...
$true and $false are two variables that represent logical TRUE and FALSE. Note that you have to specify the dollar sign as the first character (which is different from C#). $boolExpr = "abc".Length -eq 3 # length of "abc" is 3, hence $boolExpr will be True if($boolExpr -eq $tr...
$null is used to represent absent or undefined value. $null can be used as an empty placeholder for empty value in arrays: PS C:\> $array = 1, "string", $null PS C:\> $array.Count 3 When we use the same array as the source for ForEach-Object, it will process all three items (i...
Here are simplified steps (based on the official documentation) required to create a Firebase project and connect it with an Android app. Add Firebase to your app Create a Firebase project in the Firebase console and click Create New Project. Click Add Firebase to your Android app and fol...
From dataframe: mtrdd <- createDataFrame(sqlContext, mtcars) From csv: For csv's, you need to add the csv package to the environment before initiating the Spark context: Sys.setenv('SPARKR_SUBMIT_ARGS'='"--packages" "com.databricks:spark-csv_2.10:1.4.0" "sparkr-shel...
The Phalcon Incubator can be used by the community to experiment with new features or expand onto the existing Phalcon adapters, prototypes or functionalities. Anything in the Incubator can be potentially corporated into the framework. Github repository: https://github.com/phalcon/incubator
Installation via Composer The easiest way to install the Incubator is by using Composer. Install Composer and create a new composer.json file in the root of your project. |-- app |-- public | `-- index.php |-- vendor |-- composer.json Add the following content to the composer.json file. ...
This is an example of a simple GET API call wrapped in a promise to take advantage of its asynchronous functionality. var get = function(path) { return new Promise(function(resolve, reject) { let request = new XMLHttpRequest(); request.open('GET', path); request.onload = resolve; ...
Use list() to quick assign a list of variable values into an array. See also compact() // Assigns to $a, $b and $c the values of their respective array elements in $array with keys numbered from zero list($a, $b, $c) = $array; With PHP 7.1 (currently in beta) you will be able to use s...
To create a custom standalone Gradle plug-in using java (you can also use Groovy) you have to create a structure like this: plugin |-- build.gradle |-- settings.gradle |-- src |-- main | |-- java | |-- resources | |-- META-INF | |-- gradle-plugins ...
set var=10 set /a var=%var%+10 echo %var% The final value of var is 20. The second line is not working within a command block used for example on an IF condition or on a FOR loop as delayed expansion would be needed instead of standard environment variable expansion. Here is another, better w...
Foreign keys enables you to define relationship between two tables. One (parent) table need to have primary key that uniquely identifies rows in the table. Other (child) table can have value of the primary key from the parent in one of the columns. FOREIGN KEY REFERENCES constraint ensures that valu...
Let's assume that we have one row in Company table with companyId 1. We can insert row in employee table that has companyId 1: insert into Employee values (17, 'John', 1) However, we cannot insert employee that has non-existing CompanyId: insert into Employee values (17, 'John', 111111) Msg ...

Page 605 of 1088