Client apps can subscribe to any existing topic, or they can create a new topic. When a client app subscribes to a new topic name, a new topic of that name is created in FCM and any client can subsequently subscribe to it.
To subscribe to a topic use the subscribeToTopic() method specifying the top...
Use Enum.chunk/2 to group elements into sub-lists, and Map.new/2 to convert it into a Map:
[1, 2, 3, 4, 5, 6]
|> Enum.chunk(2)
|> Map.new(fn [k, v] -> {k, v} end)
Would give:
%{1 => 2, 3 => 4, 5 => 6}
Individual pixel access in OpenCV Mat structure can be achieved in multiple ways. To understand how to access, it is better to learn the data types first.
Basic Structures explains the basic datatypes. Shortly, CV_<bit-depth>{U|S|F}C(<number_of_channels>) is the basic structure of a typ...
Ways to create a file with the echo command:
ECHO. > example.bat (creates an empty file called "example.bat")
ECHO message > example.bat (creates example.bat containing "message")
ECHO message >> example.bat (adds "message" to a new line in example.bat)...
In OpenCV, images can be RGB/BGR, HSV, grayscaled, black-white and so on. It is crucial to know the data type before dealing with images.
The image data types are mainly CV_8UC3 (Matrix of uchar with 3 channels) and CV_8U (Matrix of uchar with 1 channel), however, the conversion to other types such...
DispatchGroup allows for aggregate synchronization of work. You can
use them to submit multiple different work items and track when they
all complete, even though they might run on different queues. This
behavior can be helpful when progress can’t be made until all of the
specified tasks are c...
Activate Developer Mode:
Login to odoo application.
After login user may see several odoo menu's. Click on setting menu.
Click on 'Activate the developer mode' which is located at right-bottom corner of settings page.
Developer mode now activated.
Android now supports devices with 512MB of RAM. This documentation is intended to help OEMs optimize and configure Android 4.4 for low-memory devices. Several of these optimizations are generic enough that they can be applied to previous releases as well.
Enable Low Ram Device flag
We are introduc...
The CPU governor itself is just 1 C file, which is located in kernel_source/drivers/cpufreq/, for example: cpufreq_smartass2.c. You are responsible yourself for find the governor (look in an existing kernel repo for your device)
But in order to successfully call and compile this file into your ke...
DispatchSemaphore provides an efficient implementation of a
traditional counting semaphore, which can be used to control access to
a resource across multiple execution contexts.
A scenario for when to use a semaphore could be if you are doing some file reading/writing, if multiple tasks are t...
There are two main functions in Redis (HSET and HMSET) for adding fields to a hash key. Both functions are available in redis-py.
Using HSET:
import redis
r = redis.StrictRedis(host='myserver', port=6379, db=0)
r.hset('my_key', 'field0', 'value0')
Using HMSET:
import redis
r = redis.St...
Swift 3
Serial Queue
func serialQueues () {
let serialQueue = DispatchQueue(label: "com.example.serial") //default queue type is a serial queue
let start = Date ()
for i in 0...3 { //launch a bunch of tasks
serialQueue.a...
This example echoes the special character ! into a file. This would only work when DelayedExpansion is disabled. When delayed expansion in enabled, you will need to use three carets and an exclamation mark like this:
@echo off
setlocal enabledelayedexpansion
echo ^^^!>file
echo ^>>&...
Redis allows you to add items to either the right or the left of a list.
If I was working with a list, my_list and I wanted to prepend 3 to the list, I could do that using the Redis LPUSH command:
LPUSH my_list 3
If I wanted to append 3 to my_list, I would instead use the RPUSH command:
RPUSH ...
Redis provides the LPOP and RPOP commands as a counterpart to the LPUSH and RPUSH commands for fetching data items.
If I was working with a list my_list that had several data items in it already, I can get the first item in the list using the LPOP command:
LPOP my_list
The result of this comman...
Openfire it's available to download at Ignite Realtime website
It's also possible to download relative source codeenter link description here
Windows installer:
Just execute the exe and follow basic instructions as any program
(installation directory, shortcut etc.).
Unix-Linux-Mac install:...