This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var admin = require('firebase-admin'); | |
admin.initializeApp({ | |
credential: admin.credential.applicationDefault(), | |
// databaseURL: 'https://<DATABASE_NAME>.firebaseio.com' | |
}); | |
// This registration token comes from the client FCM SDKs. | |
var registrationToken = '<token>'; | |
var message = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Storage: | |
"""Note bucket is the prefix to identify object usage""" | |
def save(self, bucket: str, file_name: str, expire_time: long): | |
"""save file to bucket with file_name""" | |
pass | |
def delete(self, bucket: str, file_name: str) -> bool: | |
"""delete file of bucket""" | |
pass | |
def get(self, bucket: str, file_name: str) -> bytes: | |
"""get file from bucket""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Definition for a binary tree node. | |
* struct TreeNode { | |
* int val; | |
* TreeNode *left; | |
* TreeNode *right; | |
* TreeNode(int x) : val(x), left(NULL), right(NULL) {} | |
* }; | |
*/ | |
class Solution { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/ptrace.h> | |
#include <bits/types.h> | |
#include <sys/user.h> | |
#include <sys/wait.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <assert.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Thread 1- -Thread 2- -Thread 3- | |
y.store (20); if (x.load() == 10) { if (y.load() == 10) | |
x.store (10); assert (y.load() == 20) assert (x.load() == 10) | |
y.store (10) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
public class Foo | |
{ | |
class NaturalNumber { | |
private int i; | |
public NaturalNumber(int i) { this.i = i; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[27979:27977:1128/105637:235776252141:INFO:CONSOLE(13)] " | |
0000000 000 0000000 | |
111111111 11111111100 000 111111111 | |
00000 111111111111111111 00000 000000 | |
000 1111111111111111111111111100000 000 | |
000 1111 1111111111111111100 000 | |
000 11 0 1111111100 000 | |
000 1 00 1 000 | |
000 00 00 1 000 | |
000 000 00000 1 000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if defined(OS_ANDROID) | |
// Though Android has a "helpful" process called debuggerd to catch native | |
// signals on the general assumption that they are fatal errors. The bkpt | |
// instruction appears to cause SIGBUS which is trapped by debuggerd, and | |
// we've had great difficulty continuing in a debugger once we stop from | |
// SIG triggered by native code. | |
// | |
// Use GDB to set |go| to 1 to resume execution. | |
#define DEBUG_BREAK() do { \ | |
if (!BeingDebugged()) { \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/bind.hpp> | |
#include <boost/thread.hpp> | |
class X { | |
public: | |
void run(); | |
void complexOperation( int limit ); | |
}; | |
int main() |
NewerOlder