Tutorial by Examples: l

This tool let's you consume messages from a topic. to use the old consumer implementation, replace --bootstrap-server with --zookeeper. Display simple messages: kafka-console-consumer --bootstrap-server localhost:9092 --topic test Consume old messages: In order to see older messages, you...
This consumer is a low-level tool which allows you to consume messages from specific partitions, offsets and replicas. Useful parameters: parition: the specific partition to consume from (default to all) offset: the beginning offset. Use -2 to consume messages from the beginning, -1 to consume ...
// PHYSICS CONSTANTS struct PhysicsCategory { static let None : UInt32 = 0 static let All : UInt32 = UInt32.max static let player : UInt32 = 0b1 // 1 static let bullet : UInt32 = 0b10 // 2 } var nodesToRemove = [SKNode]() /...
This example uses the gson library to map java objects to json strings. The (de)serializers are generic, but they don't always need to be ! Serializer Code public class GsonSerializer<T> implements Serializer<T> { private Gson gson = new GsonBuilder().create(); @Over...
import gzip import os outfilename = 'example.txt.gz' output = gzip.open(outfilename, 'wb') try: output.write('Contents of the example file go here.\n') finally: output.close() print outfilename, 'contains', os.stat(outfilename).st_size, 'bytes of compressed data' os.system('file...
A very common use-case in web applications is performing multiple asynchronous (eg. HTTP) requests and gathering their results as they arrive or all of them at once (eg. in Angular2 with the HTTP service). 1. Gathering async responses one by one as they arrive This is typically done with mergeMap(...
Make a simple Hello World Example using your django. let's make sure that you have django installed on your PC first. open a terminal and type: python -c "import django" -->if no error comes that means django is already installed. Now lets create a project in django. For that write ...
In Unit Test layer we usually test the Business Layer functionalities. And in order to do this, we will remove the Data Layer (Entity Framework) dependencies. And the question now is: How can I remove the Entity Framework dependencies in order to unit test the Business Layer functions? And the ans...
Download visual studio code from here Visual studio code. Select your target installer[mac|windows|linux]. Go to downloaded file in your local. Below steps in volved for installing Installation finished successfully.
Create your new project folder and open in windows-command prompt with the location of project folder. Type "dotnet new -t web" and hit. This is for creating new mvc template. Once complete. GO to the project location and see basic mvc project has been created. The...
Open the project folder in VScode. Sample here i am setting break point in home controller. Now click the debug option. add debug configuration like below. Make sure .Net core Launch(web) is selected. You can see break point will hit , once you start debugging by press run icon. Then gi...
In our AppServiceProvider.php public function boot() { HasMany::macro('toHasOne', function() { return new HasOne( $this->query, $this->parent, $this->foreignKey, $this->localKey ); }); } Suppose we have shop modal and ...
The MSDN library contains several different types of documentation which can be used for implementing features. Topic Overviews These are broad overviews of topics intended to provide a general understanding of an API. These overviews also often outline best practices, and implementation strategi...
In Progress 4GL the normal way to write a special character is to preceed it with a tilde character (~). These are the default special characters SequenceInterpreted asComment~""Used to write " inside strings defined using "string".~''Used to write ' inside strings defined...
It's very simple to pass temp-tables in and out of programs, procedures and functions. This can be handy if you want a procedure to process a bigger number of data than you can easily store in a string or similar. You can pass temp-tables as INPUT, OUTPUT and INPUT-OUTPUT data. Inputting one temp-...
class SomeSerializer < ActiveModel::Serializer attribute :title, key: :name attributes :body end
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; }); })
To run ARM assembly code you will need a machine with an ARM processor. If you are on Linux you can use the following commands to compile your program: as -o prog_object.o my_prog_source.s Link to get the executable: ld -o run_prog prog_object.o Run using: ./run_prog If you run echo $? it wil...
FlinkKafkaConsumer let's you consume data from one or more kafka topics. versions The consumer to use depends on your kafka distribution. FlinkKafkaConsumer08: uses the old SimpleConsumer API of Kafka. Offsets are handled by Flink and committed to zookeeper. FlinkKafkaConsumer09: uses the new ...

Page 723 of 861