Tutorial by Examples: du

cd android && ./gradlew assembleRelease
Configuration and initialization First, create a maven project and add the following dependency in your pom: <dependencies> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version&...
Apache Kafka™ is a distributed streaming platform. Which means 1-It lets you publish and subscribe to streams of records. In this respect it is similar to a message queue or enterprise messaging system. 2-It lets you store streams of records in a fault-tolerant way. 3-It lets you process streams...
This tool lets you produce messages from the command-line. Send simple string messages to a topic: kafka-console-producer --broker-list localhost:9092 --topic test here is a message here is another message ^D (each new line is a new message, type ctrl+D or ctrl+C to stop) Send messages with...
//hello.ts export function hello(name: string){ console.log(`Hello ${name}!`); } function helloES(name: string){ console.log(`Hola ${name}!`); } export {helloES}; export default hello; Load using directory index If directory contains file named index.ts it can be loaded using on...
import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Module public class VehicleModule { @Provides @Singleton Motor provideMotor(){ return new Motor(); } @Provides @Singleton Vehicle provideVehicle(){ return new Vehicle(...
The connection between the provider of dependencies, @Module, and the classes requesting them through @Inject is made using @Component, which is an interface: import javax.inject.Singleton; import dagger.Component; @Singleton @Component(modules = {VehicleModule.class}) public interface Vehicl...
Arrays can be passed to proceedures by putting () after the name of the array variable. Function countElements(ByRef arr() As Double) As Long countElements = UBound(arr) - LBound(arr) + 1 End Function Arrays must be passed by reference. If no passing mechanism is specified, e.g. myFunction...
# Getting started First, let’s generate a new Ruby on Rails application: rails new ModularTodo The next step is to generate an engine! cd ModularTodo && rails plugin new todo --mountable We will also create an ‘engines’ folder to store the engines (even if we just have one!). mk...
If you want to loop over a list of tuples for example: collection = [('a', 'b', 'c'), ('x', 'y', 'z'), ('1', '2', '3')] instead of doing something like this: for item in collection: i1 = item[0] i2 = item[1] i3 = item[2] # logic or something like this: for item in collec...
Reading the specification for the document formats in OpenXML can be a time consuming process. Sometimes you just want to see how to produce a certain feature in a word-document. The Open XML SDK 2.5 Productivity Tool for Microsoft Office (OpenXmlSdkTool.exe) does just that. Its main features are: ...
Cargo.toml: [package] name = "customderive" version = "0.1.1" [lib] proc-macro=true [dependencies] quote="^0.3.12" syn="^0.11.4" src/lib.rs: #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; exte...
Cargo.toml: [package] name = "customderive" version = "0.1.0" [lib] proc-macro=true src/lib.rs: #![crate_type = "proc-macro"] extern crate proc_macro; use proc_macro::TokenStream; #[proc_macro_derive(Dummy)] pub fn qqq(input: TokenStream) -> TokenStrea...
You can enhance your kernel by adding new I/O schedulers if needed. Globally, governors and schedulers are the same; they both provide a way how the system should work. However, for the schedulers it is all about the input/output datastream except for the CPU settings. I/O schedulers decide how an u...
package main import "fmt" var V int func F() { fmt.Printf("Hello, number %d\n", V) } This can be built with: go build -buildmode=plugin And then loaded and used from your application: p, err := plugin.Open("plugin_name.so") if err != nil { panic(e...
The Flexbox (Flexible box) layout, introduced in CSS3 provides a more efficient way to lay out, align and distribute space among children elements(flex items) within a container element(flex container). Most importantly even when their sizes are unknown or dynamic and hence the term "flex"...
Dockerize zookeeper-3.4.6 Create a Dockerfile: ####################################################### # Image: img.reg.3g:15000/zookeeper:3.4.6 ####################################################### FROM img.reg.3g:15000/jdk:1.7.0_67 MAINTAINER [email protected] USER root ENV ZO...
Sometimes, the straight forward loop cannot be entirely contained within the loop body. This is because, the loop needs to be primed by some statements B. Then, the iteration begins with some statements A, which are then followed by B again before looping. do_B(); while (condition) { do_A(); ...
Ant provides some built-in properties Property NameValuebasedirthe absolute path of the project's basedirant.filethe absolute path of the buildfile.ant.versionthe version of Antant.project.default-targetthe name of the currently executing project's default targetant.project.namename of the projecta...
/* * Component is an interface * which all elements (files, * folders, links ...) will implement */ class Component { public: virtual int getSize() const = 0; }; /* * File class represents a file * in file system. */ class File : public Component { public: virtual int...

Page 41 of 47