Tutorial by Examples: o

A region is a collapsible block of code, that can help with the readability and organisation of your code. NOTE: StyleCop's rule SA1124 DoNotUseRegions discourages use of regions. They are usually a sign of badly organized code, as C# includes partial classes and other features which make regions o...
By default, LESS will use its own calc() unless told otherwise. So: @column-count: 2; .class-example { width: calc(100% / @column-count); } Would compile to this: .class-example { width: 50%; } While it is our desired width, LESS has used it's own calc() function to calculate ...
RSA can be used to create a message signature. A valid signature can only be generated with access to the private RSA key, validating on the other hand is possible with merely the corresponding public key. So as long as the other side knows your public key they can verify the message to be signed by...
Asymmetric encryption has the advantage that a message can be encrypted without exchanging a secret key with the recipient of the message. The sender merely needs to know the recipients public key, this allows encrypting the message in such a way that only the designated recipient (who has the corre...
The GNU gprof profiler, gprof, allows you to profile your code. To use it, you need to perform the following steps: Build the application with settings for generating profiling information Generate profiling information by running the built application View the generated profiling inf...
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...
SQL Server 2012 In Transact SQL , you may define an object as Date (or DateTime) using the [DATEFROMPARTS][1] (or [DATETIMEFROMPARTS][1]) function like following: DECLARE @myDate DATE=DATEFROMPARTS(1988,11,28) DECLARE @someMoment DATETIME=DATEFROMPARTS(1988,11,28,10,30,50,123) The parameter...
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...
Variable called Output Field Separator contains string value that is used when converting an array to a string. By default $OFS = " " (a space), but it can be changed: PS C:\> $array = 1,2,3 PS C:\> "$array" # default OFS will be used 1 2 3 PS C:\> $OFS = ",.&qu...
Array of most recent error objects. The first one in the array is the most recent one: PS C:\> throw "Error" # resulting output will be in red font Error At line:1 char:1 + throw "Error" + ~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (Error:String) [], R...
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...
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; ...

Page 567 of 1038