Tutorial by Examples: cer

pthread_mutex_t queueMutex; pthread_cond_t queueCond; Queue queue; void Initialize() { //Initialize the mutex and the condition variable pthread_mutex_init(&queueMutex, NULL); pthread_cond_init(&queueCond, NULL); } void Producer() { //First we get some new data ...
A synchronous producer-consumer solution ensures that the consumer reads every data item written by the producer exactly one time. Asynchronous solutions allow the consumer to sample the output of the producer. Either the consumer consumes the data faster than it is produced, or the consumer consume...
This example uses the main procedure as the producer task. In Ada the main procedure always runs in a task separate from all other tasks in the program, see minimal example. ------------------------------------------------------------------ -- Sampling Consumer -- --------------------------------...
This example shows multiple producers and consumers sharing the same buffer. Protected entries in Ada implement a queue to handle waiting tasks. The default queuing policy is First In First Out. ------------------------------------------------------------------ -- Multiple producers and consumers ...
Generate a RSA private key: openssl genrsa -des3 -out server.key 4096 Openssl should ask for a pass phrase at this step. Notice that we’ll use only certificate for communication and authentication, without pass phrase. Just use 123456 for example. Generate the Certificate Signing Request: openssl ...
To run the private registry (securely) you have to generate a self-signed certificate, you can refer to previous example to generate it. For my example I put server.key and server.crt into /root/certs Before run docker command you should be placed (use cd) into the directory that contains certs fo...
Try catch Errors must always be handled. If you are using synchronous programming you could use a try catch. But this does not work if you work asynchronous! Example: try { setTimeout(function() { throw new Error("I'm an uncaught error and will stop the server!"); }, 1...
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&...
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...
Ffmpeg is a swiss knife for streaming project. For any kind of device streaming you only need to get the specification of device. To list the device ffmpeg -f dshow -list_devices true -i dummy Command prompt will list all the aviable device on machine. [dshow @ 0000000004052420] DirectShow vid...
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...
Any @Component or @Configuration could be marked with @Profile annotation @Configuration @Profile("production") public class ProductionConfiguration { // ... } The same in XML config <beans profile="dev"> <bean id="dataSource" class="&l...
It is possible to DELETE data from a table if it matches (or mismatches) certain data in other tables. Let's assume we want to DELETEdata from Source once its loaded into Target. DELETE FROM Source WHERE EXISTS ( SELECT 1 -- specific value in SELECT doesn't matter FROM Target ...
A simple OGL 4.0 GLSL shader program that shows the use shader subroutines. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. The subroutines switch between different geometry generated in the geometry shader and change the surface representatio...
(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 ...
(def xf (filter keyword?)) Apply to a collection, returning a sequence: (sequence xf [:a 1 2 :b :c]) ;; => (:a :b :c) Apply to a collection, reducing the resulting collection with another function: (transduce xf str [:a 1 2 :b :c]) ;; => ":a:b:c" Apply to a collection, and...
function sum(numbers) { var total = 0; for (var i = numbers.length - 1; i >= 0; i--) { total += numbers[i]; } return total; } It's a procedural code with mutations (over total).
So the most used functions on Clojure map and filter have been modified to return transducers (composable algorithmic transformations), if not called with a collection. That means: (map inc) returns a transducer and so does (filter odd?) The advantage: the functions can be composed into a single f...

Page 4 of 4