Tutorial by Examples: al

short type has no literal. Integer literals are implicitly converted from int: short s = 127;
ushort type has no literal suffix. Integer literals are implicitly converted from int: ushort us = 127;
bool literals are either true or false; bool b = true;
let rec factorial n = match n with | 0 | 1 -> 1 | n -> n * (factorial (n - 1)) This function matches on both the values 0 and 1 and maps them to the base case of our recursive definition. Then all other numbers map to the recursive call of this function.
The following assumes you will use kdiff3 for file diffing and although not essential it is a good idea. C:\> choco install kdiff3 Git can be installed first so you can state any parameters you wish. Here all the Unix tools are also installed and 'NoAutoCrlf' means checkout as is, commit as i...
Unlike the other helpers, this one uses static class helpers to serialize and deserialize, hence it is a little bit easier than the others to use. using Newtonsoft.Json; var rawJSON = "{\"Name\":\"Fibonacci Sequence\",\"Numbers\":[0, 1, 1, 2, 3, 5, 8, 13]}...
Azure Webjobs run on an Azure App Service. If we scale our App Service horizontally (add new instances), each instance will have its own JobHost. Note that this only applies to WebJobs running in Continuous mode. On-demand and scheduled WebJobs are not affected by horizontal scaling, they always ru...
extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; #[derive(Serialize)] struct Person { #[serde(rename="firstName")] first_name: String, #[serde(rename="lastName")] last_name: String, } fn main() { let person = ...
The Meteor Tool will notify you when a newer release is available. To update Meteor projects to the latest release, execute the following command inside a Meteor project: meteor update In case you want to update your Meteor project to a specific Meteor release, run the following command inside ...
Extension methods enable you to simplify your interface definitions by only including core required functionality in the interface itself and allowing you to define convenience methods and overloads as extension methods. Interfaces with fewer methods are easier to implement in new classes. Keeping o...
Shiny can run as a standalone application on your local computer, on a server that can provide shiny apps to multiple users (using shiny server), or on shinyapps.io. Installing Shiny on a local computer: in R/RStudio, run install.packages("shiny") if installing from CRAN, or devtools::i...
Quickstart for Jekyll $ gem install jekyll $ jekyll new my-awesome-site $ cd my-awesome-site ~/my-awesome-site $ jekyll serve Now browse to http://localhost:4000 Quickstart for Jekyll with Bundler $ gem install jekyll bundler $ jekyll new my-awesome-site $ cd my-awesome-site ~/my...
You often find yourself in a situation where you need to find a variables corresponding value, and collections got you covered. In the example below we got three different locales in an array with a corresponding calling code assigned. We want to be able to provide a locale and in return get the as...
# Fetch and install package to setup access to the official APT repository wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb sudo dpkg -i erlang-solutions_1.0_all.deb # Update package index sudo apt-get update # Install Erlang and Elixir sudo apt-get install esl-erlan...
Run command below to install nginx. sudo apt-get install nginx By default, Nginx automatically starts when it is installed. You can access the default Nginx landing page to confirm that the software is running properly by visiting your server's domain name or public IP address in your web browse...
Dim array2D(,) As Integer = {{1, 2, 3}, {4, 5, 6}} ' array2D(0, 0) is 1 ; array2D(0, 1) is 2 ; array2D(1, 0) is 4 Dim array3D(,,) As Integer = {{{1, 2, 3}, {4, 5, 6}}, {{7, 8, 9}, {10, 11, 12}}} ' array3D(0, 0, 0) is 1 ; array3D(0, 0, 1) is 2 ' array3D(0, 1, 0) is 4 ; array3D(1, 0, 0) is 7 ...
Note the parenthesis to distinguish between a jagged array and a multidimensional array SubArrays can be of different length Dim jaggedArray()() As Integer = { ({1, 2, 3}), ({4, 5, 6}), ({7}) } ' jaggedArray(0) is {1, 2, 3} and so jaggedArray(0)(0) is 1 ' jaggedArray(1) is {4, 5, 6} and so jagge...
valgrind ./my-program arg1 arg2 < test-input This will run your program and produce a report of any allocations and de-allocations it did. It will also warn you about common errors like using uninitialized memory, dereferencing pointers to strange places, writing off the end of blocks allocate...
Unions are useful for minimizing memory usage for exclusive data, such as when implementing mixed data types. struct AnyType { enum { IS_INT, IS_FLOAT } type; union Data { int as_int; float as_float; } value; AnyType(int i) : type...
Pointer initialization is a good way to avoid wild pointers. The initialization is simple and is no different from initialization of a variable. #include <stddef.h> int main() { int *p1 = NULL; char *p2 = NULL; float *p3 = NULL; /* NULL is a macro defined in st...

Page 69 of 269