Detailed instructions on getting WSO2 set up or installed.
Almost all the WSO2 Products can be started using the wso2server.sh/bat files that can be found in the <Product_Home>/bin folder of each product. When you run the sh/bat script it will star the particular WSO2 product with default set...
The use of null values is strongly discouraged, unless interacting with legacy Java code that expects null. Instead, Option should be used when the result of a function might either be something (Some) or nothing (None).
A try-catch block is more appropriate for error-handling, but if the function ...
CLP(FD) constraints are provided by all serious Prolog implementations. They allow us to reason about integers in a pure way.
?- X #= 1 + 2.
X = 3.
?- 5 #= Y + 2.
Y = 3.
Destructuring also gives you the ability to interpret a sequence as a map:
(def my-vec [:a 1 :b 2])
(def my-lst '("smthg else" :c 3 :d 4))
(let [[& {:keys [a b]}] my-vec
[s & {:keys [c d]} my-lst]
(+ a b c d)) ;= 10
It is useful for defining functions with named p...
CLP(FD) constraints are completely pure relations. They can be used in all directions for declarative integer arithmetic:
?- X #= 1+2.
X = 3.
?- 3 #= Y+2.
Y = 1.
In oracle, the difference (in days and/or fractions thereof) between two DATEs can be found using subtraction:
SELECT DATE '2016-03-23' - DATE '2015-12-25' AS difference FROM DUAL;
Outputs the number of days between the two dates:
DIFFERENCE
----------
89
And:
SELECT TO_DATE( '201...
Following code will release the lock. There will be no problem. Behind the scenes lock statement works as try finally
lock(locker)
{
throw new Exception();
}
More can be seen in the C# 5.0 Specification:
A lock statement of the form
lock (x) ...
where x is an expression of a referenc...
Partial application means calling a function with less arguments than it has and saving the result as another function (that waits for the rest of the arguments).
multiplyBy: Int -> Int -> Int
multiplyBy x y =
x * y
multiplyByTwo : Int -> Int -- one Int has disappeared! we ...
The function toupper will convert a string to upper case (capital letters). For example:
BEGIN {
greeting = "hello"
loud_greeting = toupper(greeting)
print loud_greeting
}
This code will output "HELLO" when run.
Enum classes as any other classes can have a constructor and be initialized
enum class Color(val rgb: Int) {
RED(0xFF0000),
GREEN(0x00FF00),
BLUE(0x0000FF)
}
Enum classes can also declare members (i.e. properties and functions). A semicolon (;) must be placed between the last enum object and the first member declaration.
If a member is abstract, the enum objects must implement it.
enum class Color {
RED {
override val rgb: Int = 0xFF0000
...
The routing configuration is included in your app/config/config.yml file, by default the app/config/routing.yml file.
From there you can link to the controllers that have annotated routing configuration:
# app/config/routing.yml
app:
resource: "@AppBundle/Controller"
type: ...
A browser's debugging console can be used in order to print simple messages. This debugging or web console can be directly opened in the browser (F12 key in most browsers – see Remarks below for further information) and the log method of the console Javascript object can be invoked by typing the fol...
Sometimes, we may open a file which we do not have permission to write in Vim without using sudo.
Use this command to save a read-only file edited in Vim.
:w !sudo tee > /dev/null %
Which you could map to :w!! in your .vimrc:
cmap w!! w !sudo tee > /dev/null %
You will be presented a ...
The size of a canvas is the area it occupies on the page and is defined by the CSS width and height properties.
canvas {
width : 1000px;
height : 1000px;
}
The canvas resolution defines the number of pixels it contains. The resolution is set by setting the canvas element width and heigh...
Starter code to create and remove a full page canvas that responds to resize events via javascript.
var canvas; // Global canvas reference
var ctx; // Global 2D context reference
// Creates a canvas
function createCanvas () {
const canvas = document.createElement(&q...
This example will show you how to create a simple animation using the canvas and the 2D context. It is assumed you know how to create and add a canvas to the DOM and obtain the context
// this example assumes ctx and canvas have been created
const textToDisplay = "This is an example that uses...