Tutorial by Examples: amp

The TestProducerfrom this example produces Integerobjects in a given range and pushes them to its Subscriber. It extends the Flowable<Integer> class. For a new subscriber, it creates a Subscription object whose request(long) method is used to create and publish the Integer values. It is impor...
Required External Jar: mysql-connector-java-5.1.40-bin.jar to connect to Data Base. Add this jar by right clicking the project -->Build Path--> Add external Archieve. Create the Flow as Flowing 2) Database Connector Configuration: Select MySQL as your database by double clicking the Data...
This example shows how to embed some basic C# into a PowerShell script, add it to the runspace/session and utilise the code within PowerShell syntax. $code = " using System; namespace MyNameSpace { public class Responder { public static void StaticRespond() { ...
This example shows how to embed some basic C# into a PowerShell script, add it to the runspace/session and utilise the code within PowerShell syntax. $code = @" Imports System Namespace MyNameSpace Public Class Responder Public Shared Sub StaticRespond() Console....
Firstly it's important to note that when a new socket is created it is assigned a unique Id which is retrieved by calling socket.id. This id can then be stored within a user object and we can assign an identifier such as a username which has been used in this example to retrieve user objects. /** ...
This code implements a version of std::async, but it behaves as if async were always called with the deferred launch policy. This function also does not have async's special future behavior; the returned future can be destroyed without ever acquiring its value. template<typename F> auto asyn...
# install sbt with homebrew (if you didn't) brew install sbt # - create a new scala project # - name your project name when asked like: hello-world sbt new sbt/scala-seed.g8 # go to the new project directory that you named cd hello-world # run sbt to open the sbt shell sbt # run you...
The below coordinator job will trigger coordinator action once in a day that executes a workflow. The workflow has a shell script that moves input to output. <coordinator-app name="log_process_coordinator" frequency="${coord:days(1)}" start="2017-04-29T06:00Z" ...
<workflow-app xmlns="uri:oozie:workflow:0.4" name="shell-wf"> <start to="shell-node"/> <action name="shell-node"> <shell xmlns="uri:oozie:shell-action:0.2"> <job-tracker>${jobTracker}</job-tracker> <name-n...
nameNode=hdfs://namenode:port start=2016-04-12T06:00Z end=2017-02-26T23:25Z jobTracker=yourjobtracker poolName=yourpool oozie.coord.application.path=${nameNode}/hdfs_path/coord_job_example/coord workflowAppUri=${oozie.coord.application.path} myscript=myscript.sh myscriptPath=${oozie.coord.ap...
inputDir=${1} outputDir=${2} hadoop fs -mkdir -p ${outputDir} hadoop fs -cp ${inputDir}/* ${outputDir}/
dplyr uses Non-Standard Evaluation(NSE), which is why we normally can use the variable names without quotes. However, sometimes during the data pipeline, we need to get our variable names from other sources such as a Shiny selection box. In case of functions like select, we can just use select_ to u...
Creating files Language To create a language file, you must end it with _lang.php. For example, you want to create a language file for French language, then you must save it with french_lang.php. Within this file you can store all your language texts in key, value combination in $lang array as show...
One of the central difficulties of writing an Android application using Dagger is that many Android framework classes are instantiated by the OS itself, like Activity and Fragment, but Dagger works best if it can create all the injected objects. Instead, you have to perform members injection in a li...
By setting Multi-Release: true in the MANIFEST.MF file, the Jar file becomes a multi-release Jar and the Java runtime (as long as it supports the MRJAR format) will pick the appropriate versions of classes depending on the current major version. The structure of such a Jar is the following: jar ro...
math.js 'use strict'; const Promise = require('bluebird'); module.exports = { // example of a callback-only method callbackSum: function(a, b, callback) { if (typeof a !== 'number') return callback(new Error('"a" must be a number')); if (typeof b !== 'number...
Add any JSR 303 implementation to your classpath. Popular one used is Hibernate validator from Hibernate. <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.Final</version> </dependen...
import {Http} from '@angular/http'; @Injectable() export class StudentService{ constructor(public http: Http){} getAllStudents(): Observable<Students[]>{ return this.http.get('assets/students.json') .map(res => res.json().data) } } notice ...
export class HomePage implements OnInit { ... .... constructor(....){} ngOnInit(){ this._studentService.getAllStudents().subscribe( (students: Students[]) => this.students = students, )

Page 40 of 46