Tutorial by Examples: al

function cryptPassword(password, callback) { bcrypt.genSalt(SALT_WORK_FACTOR, function(err, salt) { if (err) return callback(err); bcrypt.hash(password, salt, null, function(err, hash) { return callback(err, hash); }); }); } User.beforeCreate((user, options, ...
User.beforeCreate(function(user, options) { return hashPassword(user.password).then(function (hashedPw) { user.password = hashedPw; }); })
SimpleStringSchema: SimpleStringSchema deserializes the message as a string. In case your messages have keys, the latter will be ignored. new FlinkKafkaConsumer09<>(kafkaInputTopic, new SimpleStringSchema(), prop); JSONDeserializationSchema JSONDeserializationSchema deserializes json-form...
In kafka, each consumer from the same consumer group gets assigned one or more partitions. Note that it is not possible for two consumers to consume from the same partition. The number of flink consumers depends on the flink parallelism (defaults to 1). There are three possible cases: kafka pa...
Three different methods of insertion can used with sets. First, a simple insert of the value. This method returns a pair allowing the caller to check whether the insert really occurred. Second, an insert by giving a hint of where the value will be inserted. The objective is to optimize the inser...
All the insertion methods from sets also apply to multisets. Nevertheless, another possibility exists, which is providing an initializer_list: auto il = { 7, 5, 12 }; std::multiset<int> msut; msut.insert(il);
There are several ways to search a given value in std::set or in std::multiset: To get the iterator of the first occurrence of a key, the find() function can be used. It returns end() if the key does not exist. std::set<int> sut; sut.insert(10); sut.insert(15); sut.insert(22); ...
The most obvious method, if you just want to reset your set/multiset to an empty one, is to use clear: std::set<int> sut; sut.insert(10); sut.insert(15); sut.insert(22); sut.insert(3); sut.clear(); //size of sut is 0 Then the erase method can be used.  It offers some poss...
Adding dependcy To use a gruntplugin, you first need to add it as a dependency to your project. Let's use the jshint plugin as an example. npm install grunt-contrib-jshint --save-dev The --save-dev option is used to add the plugin in the package.json, this way the plugin is always installed aft...
Import ReactiveFormsModule, and then import { Component, OnInit, OnDestroy } from '@angular/core'; import { FormControl } from '@angular/forms'; import { Subscription } from 'rxjs'; @Component({ selector: 'component', template: ` <input [formControl]="control" /> ...
For those of you that are new to programming in Swift and those of you coming from different programming bases, such as Python or Java, this article should be quite helpful. In this post, we will discuss a simple solution for implementing swift algorithms. Fizz Buzz You may have seen Fizz Buzz wri...
Let's explore an example Transaction search where we define a filter for a single transaction's internal ID: We've specified a filter to only show us results for the Transaction with the internal ID of 875; here is that Transaction: We can see it is a Sales Order with a single line item. Beca...
Recoding missing values Regularly, missing data isn't coded as NA in datasets. In SPSS for example, missing values are often represented by the value 99. num.vec <- c(1, 2, 3, 99, 5) num.vec ## [1] 1 2 3 99 5 It is possible to directly assign NA using subsetting num.vec[num.vec == 99]...
npm install --save mongodb npm install --save mongoose //A simple wrapper for ease of development In your server file (normally named index.js or server.js) const express = require('express'); const mongodb = require('mongodb'); const mongoose = require('mongoose'); const mongoConnectString...
The BigDecimal class contains an internal cache of frequently used numbers e.g. 0 to 10. The BigDecimal.valueOf() methods are provided in preference to constructors with similar type parameters i.e. in the below example a is preferred to b. BigDecimal a = BigDecimal.valueOf(10L); //Returns cached O...
You can create custom dialogs which contains many component and perform many functionality on it. It behaves like second stage on owner stage. In the following example an application that shows person in the main stage tableview and creates a person in a dialog (AddingPersonDialog) prepared. GUIs c...
Making a sequence of HTTP requests has two primary reasons: Requests are depending on each other (the result from one requests is required for a consecutive request). We want to spread server load into multiple requests. 1. Making multiple dependent requests This can be performed usi...
Detailed instructions on getting mediawiki set up or installed.
See the download page to manually download and unpack the latest version, or follow the links below: spring-boot-cli-1.5.1.RELEASE-bin.zip spring-boot-cli-1.5.1.RELEASE-bin.tar.gz
$ brew tap pivotal/tap $ brew install springboot

Page 225 of 269