Tutorial by Examples

var number1 = 5; number1 = 3; Here, we defined a number called "number1" which was equal to 5. However, on the second line, we changed the value to 3. To show the value of a variable, we log it to the console or use window.alert(): console.log(number1); // 3 window.alert(number1); //...
var myInteger = 12; // 32-bit number (from -2,147,483,648 to 2,147,483,647) var myLong = 9310141419482; // 64-bit number (from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807) var myFloat = 5.5; // 32-bit floating-point number (decimal) var myDouble = 9310141419482.22; // 64-bit floating-...
var myArray = []; // empty array An array is a set of variables. For example: var favoriteFruits = ["apple", "orange", "strawberry"]; var carsInParkingLot = ["Toyota", "Ferrari", "Lexus"]; var employees = ["Billy", "Bob...
Let's first brush up with what are the Instance Variables: They behave more like properties for an object. They are initialized on an object creation. Instance variables are accessible through instance methods. Per Object has per instance variables. Instance Variables are not shared between object...
Comparison of access controls of Java against Ruby: If method is declared private in Java, it can only be accessed by other methods within the same class. If a method is declared protected it can be accessed by other classes which exist within the same package as well as by subclasses of the class...
Creating an Snackbar without the need pass view to Snackbar, all layout create in android in android.R.id.content. public class CustomSnackBar { public static final int STATE_ERROR = 0; public static final int STATE_WARNING = 1; public static final int STATE_SUCCESS = 2; publi...
Detailed instructions on getting graph set up or installed.
DOSKEY macros don't work in a batch script. However, we can use a little workaround. set DOSKEYMacro=echo Hello World %DOSKEYMacro% This script can simulate the macro function. One can also use ampersands(&) to join commands, like $T in DOSKEY. If you want a relatively large "macro&qu...
A pointer to a concrete data type, converted to void *, can be used to pass values to and return results from the thread function. #include <stdio.h> #include <stdlib.h> #include <pthread.h> struct thread_args { int a; double b; }; struct thread_result { ...
Min-Heap 1 / \ 2 3 / \ / \ 4 5 6 7 The above tree is a Min-Heap since the root is the minimum among all the nodes present in the tree.The same property is followed by all the nodes in the tree. Max-Heap 7 / \ 6 5 / \ /...
Rhas a vast collection of built-in datasets. Usually, they are used for teaching purposes to create quick and easily reproducible examples. There is a nice web-page listing the built-in datasets: https://vincentarelbundock.github.io/Rdatasets/datasets.html Example Swiss Fertility and Socioecono...
There are packages that include data or are created specifically to disseminate datasets. When such a package is loaded (library(pkg)), the attached datasets become available either as R objects; or they need to be called with the data() function. Gapminder A nice dataset on the development of c...
Numerous packages are created specifically to access some databases. Using them can save a bunch of time on reading/formating the data. Eurostat Even though eurostat package has a function search_eurostat(), it does not find all the relevant datasets available. This, it's more convenient to brow...
Human Mortality Database Human Mortality Database is a project of the Max Planck Institute for Demographic Research that gathers and pre-process human mortality data for those countries, where more or less reliable statistics is available. # load required packages library(tidyverse) library(ext...
Detailed instructions on getting odoo-10 set up or installed.
Spaghetti code means a code snippet that uses many, and often confusing structures. Such as GOTOs, exceptions and inconsistent code. Examples and Solutions Example A @echo off set /a counter=0 :Loop set /a counter=%counter% + 1 echo %counter% if %counter% equ 10 goto :exit goto :Loop ...
For a convenient way to iterate through an arrayBuffer, you can create a simple iterator that implements the DataView methods under the hood: var ArrayBufferCursor = function() { var ArrayBufferCursor = function(arrayBuffer) { this.dataview = new DataView(arrayBuffer, 0); this.size = a...
Detailed instructions on getting url set up or installed.
Detailed instructions on getting user-interface set up or installed.
An entity represents an object of a game like a player figure or an enemy figure. Since this object does not do much without arms and legs we can add the components to this. To create this system apple has the GKEntity and GKComponent classes. Lets assume we have the following classe for the follow...

Page 1317 of 1336