Tutorial by Examples: ed

In Spark, a DataFrame is a distributed collection of data organized into named columns. It is conceptually equivalent to a table in a relational database or a data frame in R/Python, but with richer optimizations under the hood. DataFrames can be constructed from a wide array of sources such as stru...
Let's try to look at the differences between client and cluster mode of Spark. Client: When running Spark in the client mode, the SparkContext and Driver program run external to the cluster; for example, from your laptop. Local mode is only for the case when you do not want to use a cluster and in...
@Module class AppModule(val app: Application) { @Provides @Named("the_answer") fun providesTheAnswer(): Int { return 42 } }
class MyClass{ @field:[Inject Named("the_answer")] lateinit var answer: Int } In Android Development, this is the way in which you inject dependencies into Activity, Fragment or any other object that is instantiated directly by the OS. To learn more about the @field: annotation i...
class MyClass @Inject constructor(@Named val answer: Int){ /* The nuts and bolts of your class */ }
(let [xf (comp (map inc) (filter even?))] (transduce xf + [1 2 3 4 5 6 7 8 9 10])) ;; => 30 This example creates a transducer assigned to the local xf and uses transduce to apply it to some data. The transducer add's one to each of it's inputs and only returns the ...
The Rule An e-commerce have a shipping rule based on zipcodes. All shipping to California is eligible to free shipping. All other west cost are US$ 10.00 and The rest of USA is US$ 20.00 How to apply technique We all know there are lots of zipcodes by state, and we are not going to use them all. ...
In order to clear the selection of those values which are selected using a Select2 drop down,we can use the empty() function. <select id="select2_example"> <option>Option1</option> <option>Option2</option> <option>Option3</option> </select&...
The rule An e-commerce have a 20% off offer valid for entire month of July. How to apply the technique Using the Equivalence Partition technique we could divide this as Inside July Is outside July But we can do a little better with this case. We can use the boundaries of the partition to e...
The rule Another common case we usually find and where it is useful to apply this technique are progressive rates based on values. An e-commerce has an offer that is like: 10% off for orders above US$ 80.00 15% off for orders above US$ 150.00 25% off for orders above US$ 200.00 How to appl...
Suppose we have an API which allows us to get object metadata in single request (getAllPets), and other request which have full data of single resource (getSinglePet). How we can query all of them in a single chain? public class PetsFetcher { static class PetRepository { List<Integer&g...
ADDITIONAL_LOAD_PATHS ARGF ARGV ActionController ActionView ActiveRecord ArgumentError Array BasicSocket Benchmark Bignum Binding CGI CGIMethods CROSS_COMPILING Class ClassInheritableAttributes Comparable ConditionVariable Config Continuation DRb DRbIdConv DRbObject DRbUndu...
<?php //Creating Connection to MySQL database using MySQLi $mysqli = mysqli_connect("IP ADDRESS OR DOAMIN", "username", "password", "database_name"); //Executing Query in the Database using MySQLi $result = mysqli_query($mysqli, "SELECT * FROM T...
These locators should be used as a priority when possible, because they are more persistent to changes in an application then locators based on css or xpath, which can easily break. Binding locator Syntax by.binding('bind value') Example View <span>{{user.password}}</span> <s...
# Create 100 standard normals in a vector x <- rnorm(100, mean = 0, sd = 1) # Find the lenght of a vector length(x) # Compute the mean mean(x) # Compute the standard deviation sd(x) # Compute the median value median(x) # Compute the range (min, max) range(x) # Sum an itera...
This example will demonstrate the searchable select box in MVC. it uses Ajax to get all records from database as user types the new character. I'll consider Country and its City example to illustrate the functionality of Searchable dropdown box. Code behind is c# with MVC, but its easy to grasp wh...
Visual Studio Community 2017 Free, fully-featured IDE for students, open-source and individual developer Visual Studio Professional 2017 Professional developer tools, services, and subscription benefits for small teams Visual Studio Enterprise 2017 End-to-end solution to meet demand...
Use LocalDate and ChronoUnit: LocalDate d1 = LocalDate.of(2017, 5, 1); LocalDate d2 = LocalDate.of(2017, 5, 18); now, since the method between of the ChronoUnit enumerator takes 2 Temporals as parameters so you can pass without a problem the LocalDate instances long days = ChronoUnit.DAYS.betw...
service.ts: import { Injectable } from '@angular/core'; @Injectable() export class AppState { public mylist = []; } parent.component.ts: import {Component} from '@angular/core'; import { AppState } from './shared.service'; @Component({ selector: 'parent-example', templ...
If you have your data with each month of data arranged in rows like so: start by creating quarterly sums in the adjacent columns, D & E in our example. Start with the third row in the new column or the first quarter you want to create, in this example we'll use March 31st (2000-03-31). Use t...

Page 143 of 145