Tutorial by Examples: er

Ruby 2.3.0 added the safe navigation operator, &.. This operator is intended to shorten the paradigm of object && object.property && object.property.method in conditional statements. For example, you have a House object with an address property, and you want to find the street_n...
If you want to get the properties of the file (like the name or the size) you can do it before using the File Reader. If we have the following html piece of code: <input type="file" id="newFile"> You can access the properties directly like this: document.getElementById...
ColorBrewer project is a very popular tool to select harmoniously matching color palettes. RColorBrewer is a port of the project for R and provides also colorblind-friendly palettes. An example of use colors_vec <- brewer.pal(5, name = 'BrBG') print(colors_vec) [1] "#A6611A" &quot...
The package colorspace provides GUI for selecting a palette. On the call of choose_palette() function the following window pops-up: When the palette is chosen, just hit OK and do not forget to store the output in a variable, e.g. pal. pal <- choose_palette() The output is a function that t...
Before we get our hands dirty with code, I feel it is necessary to understand how data is stored in firebase. Unlike relational databases, firebase stores data in JSON format. Think of each row in a relational database as a JSON object (which is basically unordered key-value pair). So the column nam...
First-time visitors to any web page has to make several HTTP requests. By using the “Expires” header you make the components of the requests cacheable. This avoids unnecessary HTTP requests on subsequent page views. You want to find the area of the .htaccess file that starts with <IfModulemod_ex...
Controller::renderAjax() method can be used to respond to an Ajax request. This method is similar to renderPartial() except that it will inject into the rendering result with JS/CSS scripts and files which are registered with the view Assume we have login form in a view file: <?php use yii\hel...
In order to search for packages in the databse, searching both in packages' names and descriptions: pacman -Ss string1 string2 ... To install a single package or list of packages (including dependencies), issue the following command: sudo pacman -S package_name1 package_name2 ... source
This Documentation is a small summary of the offical one Prerequisites Your PC must be running a 64-bit version of Windows 10 Anniversary Update build 14393 or later To find your PC's CPU architecture and Windows version/build number, open Settings>System>About. Look for the OS Build ...
This chapter describes how to set up a Docker Container with Jenkins inside, which is capable of sending Docker commands to the Docker installation (the Docker Daemon) of the Host. Effectively using Docker in Docker. To achieve this, we have to build a custom Docker Image which is based on an arbitr...
Given coins of different denominations and a total, in how many ways can we combine these coins to get the total? Let's say we have coins = {1, 2, 3} and a total = 5, we can get the total in 5 ways: 1 1 1 1 1 1 1 1 2 1 1 3 1 2 2 2 3 The problem is closely related to knapsack problem. The o...
Given coins of different denominations and a total, how many coins do we need to combine to get the total if we use minimum number of coins? Let's say we have coins = {1, 5, 6, 8} and a total = 11, we can get the total using 2 coins which is {5, 6}. This is indeed the minimum number of coins require...
$a1 = array("red","green"); $a2 = array("blue","yellow"); print_r(array_merge($a1,$a2)); /* Array ( [0] => red [1] => green [2] => blue [3] => yellow ) */ Associative array: $a1=array("a"=>"red","b"=&...
Converting a java.util.Calendar object: Calendar rightNow = Calendar.getInstance(); LocalDate today = LocalDate.fromCalendarFields(rightNow); Converting a java.util.Date object: Date rightNow = new Date(); LocalDate today = LocalDate.fromDateFields(rightNow); Converting a string: String d...
Below code is basic example of spark launcher.This can be used if spark job has to be launched through some application. val sparkLauncher = new SparkLauncher //Set Spark properties.only Basic ones are shown here.It will be overridden if properties are set in Main class. sparkLauncher.setSparkHom...
Overview: There are typically two types of SAS Deployments: SAS Foundation only installation (BASE SAS). This is typically is installed on a PC. It does not run any server software. SAS Planned Deployment for their server architecture which will install the SAS server environment along wit...
Php arrayiterator allows you to modify and unset the values while iterating over arrays and objects. Example: $array = ['1' => 'apple', '2' => 'banana', '3' => 'cherry']; $arrayObject = new ArrayObject($array); $iterator = $arrayObject->getIterator(); for($iterator; $iterator-...
MongoDB stores data records as BSON documents. BSON is the binary representation of JSON. $ python >>> from pymongo import MongoClient >>> client = MongoClient() >>> col = client.mydb.test Create Insert a single document insert_one(document) >>> result = ...
This error message may be produced by the OpenSSH ssh client. It means that the TCP connection between the client and the server was abnormally closed by the server immediately after being accepted. Common reasons for this message include: The SSH server process is malfunctioning--for example, it...

Page 327 of 417