现在我有一个乳胶部分看起来像
\begin{minipage}{0.35\textwidth} %left column
...
\end{minipage}
\hfill
\begin{minipage}{0.55\textwidth} %right column
...
\end{minipage}
Run Code Online (Sandbox Code Playgroud)
这样做了一个漂亮的两列布局,但我想在两个小部件之间添加一个垂直条(我目前有\ hfill).最简单的方法是什么?
如何通过 FCM 接收消息已收到的确认?我有一个渐进式网络应用程序,它检查用户是否在数据库中保存了 fcm 令牌,如果有,则使用 FCM,如果没有,则诉诸 SMS(通过 twilio)。问题是,即使浏览器关闭,也会记录“成功发送 fcm 消息”,因为消息会排队直到重新打开浏览器。
我如何知道用户确实收到了消息,并且没有卡在队列中等待?如果 Chrome 已关闭,我希望立即发送短信。
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const serviceAccount = require('./service-account.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: `https://${process.env.GCLOUD_PROJECT}.firebaseio.com`
});
function sendFCM(uid, title, body) {
const payload = {
notification: {
title: title,
body: body,
click_action: "https://www.google.com"
}
};
const payloadOptions = {
timeToLive: 0
};
getUserDetails(uid).then((details) => {
if (details.fcmToken !== undefined) {
// send fcm message
return admin.messaging().sendToDevice(details.fcmToken, payload, payloadOptions)
.then(response => {
console.log("Successfully sent fcm message"); …
Run Code Online (Sandbox Code Playgroud) node.js web firebase service-worker firebase-cloud-messaging
我使用的是 digitalocean ubuntu 14.04 vps。当我跑步时
sudo lsof -i:9000
Run Code Online (Sandbox Code Playgroud)
我得到不同的结果,例如
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gunicorn 23148 django 5u IPv4 51019 0t0 TCP localhost:9000 (LISTEN)
Run Code Online (Sandbox Code Playgroud)
或者
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gunicorn 23174 django 5u IPv4 51179 0t0 TCP localhost:9000 (LISTEN)
gunicorn 23175 django 5u IPv4 51179 0t0 TCP localhost:9000 (LISTEN)
Run Code Online (Sandbox Code Playgroud)
即使我在上次尝试后立即运行 lsof,gunicorn 进程的数量也从 0 到 4 不等。简单地运行
pkill gunicorn
Run Code Online (Sandbox Code Playgroud)
失败了,我相信是因为 PID 不断变化(如上所示)。如何永久终止这些进程?如果有什么不同,我是用户“root”,并且没有用户“django”的登录信息
我正在用c ++创建一个交互式数独板.每当用户更改值时,我想检查电路板是否完成.当电路板上的所有空间都填满时,电路板将完成.我对如何做到这两点的想法是:
创建一个包含填充空格量的私有数据成员.要检查电路板是否完成,我只需要检查该值是否等于boardLength ^ 2
创建一个遍历板的成员函数,当找到空格时返回false,如果它通过板而没有找到任何空格,则返回true
这是一个偏好的问题,还是有更多接受/正确的方法来做到这一点?