Tutorial by Examples: cheat

It is now a best-practice to use Vector instead of List because the implementations have better performance Performance characteristics can be found here. Vector can be used wherever List is used. List creation List[Int]() // Declares an empty list of type Int List.empty[Int] // U...
Note that this deals with the creation of a collection of type Map, which is distinct from the map method. Map Creation Map[String, Int]() val m1: Map[String, Int] = Map() val m2: String Map Int = Map() A map can be considered a collection of tuples for most operations, where the first e...
ng-app Sets the AngularJS section. ng-init Sets a default variable value. ng-bind Alternative to {{ }} template. ng-bind-template Binds multiple expressions to the view. ng-non-bindable States that the data isn't bindable. ng-bind-html Binds inner HTML property of an HTML element....
Table showing size and values range of all primitive types: data typenumeric representationrange of valuesdefault valuebooleann/afalse and truefalsebyte8-bit signed-27 to 27 - 10-128 to +127short16-bit signed-215 to 215 - 10-32,768 to +32,767int32-bit signed-231 to 231 - 10-2,147,483,648 to +2,147,...
Setup The tests below uses these values for the examples. val helloWorld = "Hello World" val helloWorldCount = 1 val helloWorldList = List("Hello World", "Bonjour Le Monde") def sayHello = throw new IllegalStateException("Hello World Exception") Type c...
Setup Install AWS CLI AWS CLI is an common CLI tool for managing the AWS resources. With this single tool we can manage all the aws resources sudo apt-get install -y python-dev python-pip sudo pip install awscli aws --version aws configure Bash one-liners cat <file> # output a file ...
This sheet assumes that you are in the root directory of the project, containing the build.sbt. $ indicates a command prompt and > indicates commands run inside the SBT console. Compile a project $ sbt compile Test a project $ sbt test Enter SBT REPL: $ sbt Enter Scala Console with B...
AWS-SDK for javascript Lambda contains aws-sdk (https://aws.amazon.com/sdk-for-node-js/) in its global so no need to upload this node-module into the zip. const AWS = require('aws-sdk'); Sample function module.exports.myFunction = (event, context, callback) => { const response = { ...
Sometimes, you need to override one or more attributes of a particular Data Access Class (DAC) field just for a particular screen, without changing the existing behavior for other screens. Replacing All Attributes Suppose the original DAC field attributes are declared as shown below: public class...

Page 1 of 1