https://hk029.gitbooks.io/leetbook/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE/ https://www.cnblogs.com/grandyang/p/6854825.html
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
function customDiff(obj1, obj2) { | |
const result = {}; | |
// Helper function to check if a value is considered 'empty' | |
function isEmpty(val) { | |
return val === null || val === ""; | |
} | |
// Recursive function to find differences | |
function findDifferences(lhs, rhs, path = '') { |
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
''' | |
毫秒级录屏 | |
按Backspace键停止录屏 | |
''' | |
from PIL import ImageGrab | |
import numpy as np | |
import cv2 | |
import datetime | |
from pynput import keyboard | |
import threading |
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
from heapq import * | |
''' | |
Need to specify key function for custom data structures for comaprision in a min heap | |
''' | |
class _Wrapper: | |
def __init__(self, item, key): | |
self.item = item | |
self.key = key |
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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "(gdb) Bash on Windows Launch", | |
"type": "cppdbg", | |
"request": "launch", |
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 torch.nn as nn | |
import torch | |
class SRU(nn.Module): | |
""" Simple Recurrent Unit https://arxiv.org/pdf/1709.02755.pdf """ | |
def __init__(self, input_size, hidden_size, activation=F.tanh): | |
super().__init__() | |
self.input_size = input_size | |
self.hidden_size = hidden_size |
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
struct cmpByStringLength { | |
bool operator()(const std::string& a, const std::string& b) const { | |
return a.length() < b.length(); | |
} | |
}; | |
// ... | |
std::map<std::string, std::string, cmpByStringLength> myMap; |
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
CUDA_VISIBLE_DEVICES=2,5,6,7 ./language/labs/consistent_zero_shot_nmt/scripts/run_nmt_experiment.sh \ | |
--data-dir=/dresden/users/jz704/data \ | |
--dataset-name=iwslt17-star \ | |
--model-name=agreement_multilingual_nmt \ | |
--conf-name=ag_gnmt_luong_att \ | |
--problem-name=translate_iwslt17 \ | |
--gpu-num=4 \ | |
--output-dir=/dresden/users/jz704/results 2>&1 | tee ~/exp_result/iwslt_orininal_agree |
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
pip uninstall apex -y | |
git clone https://github.com/NVIDIA/apex | |
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./apex |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder