This file contains hidden or 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 serial | |
from struct import pack | |
from crccheck.crc import Crc8, Crc16 | |
from time import sleep | |
CRC8_TAB = [ 0x00,0x5e,0xbc,0xe2,0x61,0x3f,0xdd,0x83,0xc2,0x9c,0x7e,0x20,0xa3,0xfd,0x1f,0x41, | |
0x9d,0xc3,0x21,0x7f,0xfc,0xa2,0x40,0x1e,0x5f,0x01,0xe3,0xbd,0x3e,0x60,0x82,0xdc, | |
0x23,0x7d,0x9f,0xc1,0x42,0x1c,0xfe,0xa0,0xe1,0xbf,0x5d,0x03,0x80,0xde,0x3c,0x62, | |
0xbe,0xe0,0x02,0x5c,0xdf,0x81,0x63,0x3d,0x7c,0x22,0xc0,0x9e,0x1d,0x43,0xa1,0xff, | |
0x46,0x18,0xfa,0xa4,0x27,0x79,0x9b,0xc5,0x84,0xda,0x38,0x66,0xe5,0xbb,0x59,0x07, |
This file contains hidden or 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
const QUESTIONS = require('./t_question.json'); | |
const ITEMS = require('./t_questionItem.json'); | |
const ANSWERS = require('./t_answer.json'); | |
const _ = require('lodash'); | |
const result = _.map([13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], TPO_CNT => { | |
let questions = _.filter(QUESTIONS, question => question.app_name_sub == `tpo${TPO_CNT}` && question.passage == 'listening'); | |
let items = _.map(questions, question => | |
_.chain(ITEMS) |
https://gist.github.com/SkyZH/2597b532ad191036ae4a6dc785859e5b#file-deque_sqrt_vector-cpp
O(n) access, O(1) insert & remove
This file contains hidden or 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> | |
#include <queue> | |
using namespace std; | |
template<typename T> | |
struct BinomialHeap { | |
struct Node { | |
T x; | |
int order; |
This file contains hidden or 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> | |
#include <climits> | |
#include <cstring> | |
using namespace std; | |
template<typename T> | |
struct BST { | |
struct Node { | |
T x; |
This file contains hidden or 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
#ifndef STRATEGY_HPP | |
#define STRATEGY_HPP | |
#include <vector> | |
#include <cstdlib> | |
#include <ctime> | |
#include "util.hpp" | |
#include <vector> | |
int cnt = 0; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Physics Test</title> | |
</head> | |
<body> | |
<svg id="main" width="800" height="800"></svg> | |
<script src="https://d3js.org/d3.v5.min.js"></script> | |
<script src="main.js"></script> | |
</body> |
This file contains hidden or 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> | |
#include <functional> | |
using namespace std; | |
template <typename T> | |
bool compare_by_value(const T& a, const T& b) { return a < b; } | |
template <typename Comp> | |
bool alex_compare_int(const int& a, const int &b, Comp comp = compare_by_value) { |
This file contains hidden or 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> | |
#include <fstream> | |
#include <map> | |
#include <algorithm> | |
#include <queue> | |
#include <string> | |
using namespace std; | |
struct Node { |