To receive messages, use a service that extends FirebaseMessagingService and override the onMessageReceived method.
public class MyFcmListenerService extends FirebaseMessagingService {
/**
* Called when message is received.
*
* @param remoteMessage Object representing t...
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)...
@echo off prevents the prompt and contents of the batch file from being displayed, so that only the output is visible. The @ makes the output of the echo off command hidden as well.
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)...
Vec (Vector) is a template class for numerical values. Unlike c++ vectors, it generally stores short vectors (only a few elements).
The way a Vec is defined is as follows:
typedef Vec<type, channels> Vec< channels>< one char for the type>;
where type is one of uchar, short, i...
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...
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 ^>>&...
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...