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 json | |
import requests | |
from datetime import datetime | |
class ConfluenceAPI(): | |
def __init__(self, token_path): | |
self.token_path = token_path | |
self._init_oauth_info(token_path) | |
if self._check_token_expire(self.expires_at): |
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
# p: posting list | |
# p must be like [docID_1, docID_2, docID_3, ...] | |
def union(p1, p2): | |
answer = [] | |
p1_idx = 0 | |
p2_idx = 0 | |
count = 0 | |
while len(p1) > p1_idx or len(p2) > p2_idx: | |
if len(p1) <= p1_idx: | |
answer.append(p2[p2_idx]) |
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
# p: posting list | |
# p must be like [docID_1, docID_2, docID_3, ...] | |
def intersect(p1, p2): | |
answer = [] | |
p1_idx = 0 | |
p2_idx = 0 | |
while len(p1) > p1_idx and len(p2) > p2_idx: | |
if p1[p1_idx] == p2[p2_idx]: | |
answer.append(p1[p1_idx]) | |
p1_idx += 1 |
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
#define JOYCON_L_PRODUCT_ID 8198 | |
#define JOYCON_R_PRODUCT_ID 8199 | |
#define MAX_JOYSTICKS_NUM 16 | |
#include <hidapi.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <iostream> | |
#include <chrono> | |
#include <array> |
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
#define JOYCON_L_PRODUCT_ID 8198 | |
#define JOYCON_R_PRODUCT_ID 8199 | |
#define MAX_JOYSTICKS_NUM 16 | |
#include <hidapi.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <iostream> | |
#include <chrono> | |
#include <array> |
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
#define JOYCON_L_PRODUCT_ID 8198 | |
#define JOYCON_R_PRODUCT_ID 8199 | |
#include <hidapi/hidapi.h> | |
#include <stdint.h> | |
#include <string.h> | |
void SendSubcommand(hid_device *dev, uint8_t command, uint8_t data[], int len, int* globalCount) { | |
uint8_t buf[0x40]; memset(buf, 0x0, size_t(0x40)); | |
buf[0] = 1; // 0x10 for rumble only |
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
#define JOYCON_L_PRODUCT_ID 8198 | |
#define JOYCON_R_PRODUCT_ID 8199 | |
#include <hidapi/hidapi.h> | |
#include <stdint.h> | |
#include <string.h> | |
void SendSubcommand(hid_device *dev, uint8_t command, uint8_t data[], int len, int* globalCount) { | |
uint8_t buf[0x40]; memset(buf, 0x0, size_t(0x40)); | |
buf[0] = 1; // 0x10 for rumble only |