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
#!/usr/bin/env python3 | |
# https://cyc2018.github.io/CS-Notes/#/notes/12.%20%E7%9F%A9%E9%98%B5%E4%B8%AD%E7%9A%84%E8%B7%AF%E5%BE%84 | |
# https://www.nowcoder.com/questionTerminal/c61c6999eecb4b8f88a98f66b273a3cc?f=discussion | |
class Solution: | |
def hasPath(self, matrix, rows, cols, path): | |
# write code here | |
if not matrix: | |
return False | |
if not 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
# https://cyc2018.github.io/CS-Notes/#/notes/7.%20%E9%87%8D%E5%BB%BA%E4%BA%8C%E5%8F%89%E6%A0%91 | |
# https://www.nowcoder.com/practice/8a19cbe657394eeaac2f6ea9b0f6fcf6?tpId=13&tqId=11157&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github | |
class TreeNode(object): | |
def __init__(self, x): | |
self.val = x | |
self.left = None | |
self.right = None | |
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
# -*- coding: utf-8 -*- | |
import os | |
import scrapy | |
import urllib.request | |
class AudioSpider(scrapy.Spider): | |
name = 'audio' | |
allowed_domains = ['english.cri.cn'] | |
start_urls = ['http://english.cri.cn/4926/more/11680/more11680.htm'] |
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
replace last line of C-w and C-x w to | |
(when (not (current-line-empty-p)) (indent-for-tab-command))))) | |
;; use different bullet for a sub-list | |
(setq org-list-demote-modify-bullet | |
'(("-" . "+") ("+" . "*") ("*" . "-") ("1." . "+") ("1)" . "+") | |
("a." . "-") ("a)" . "-") ("A." . "-") ("A)" . "-"))) | |
;; Comment this line out, since it will cause the sub-list indentation problem, |
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
cmd="-e '(execute-kbd-macro (kbd \"C-c a a c\"))'" |
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 zips -d 'zip to list(l)/extract(x)/create(c)' | |
set -l options 'l' 'L' 'c' 'x' 'X' | |
argparse -n zips $options -- $argv | |
or return | |
for a in $argv | |
if set -q _flag_l # list | |
unzip -l $a | |
else if set -q _flag_L # list Chinese characters | |
zips.py -l $a |
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
#!/bin/bash | |
print_usage() | |
{ | |
cat <<EOF | |
$(basename $0) -- gif recorder and converter | |
Usage: $(basename $0) [-h] [-r] [-w] [-c] [time] [file] | |
-h to print this usage | |
-r to record a region |
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
#!/bin/bash | |
# 0. put this script into ~/.local/bin/ | |
# 1. Create a emacsclient.desktop in ~/.local/share/applications/emacsclient.desktop | |
# 1.1 if you installed Emacs using pkg manager instead of anaconda3, omit this step | |
# 1.2 if you are using non-GUI or launcher is unnecessary, omit this step including the next | |
# 1.3 if you are using an OS without systemctl installed, omit this step including the next | |
# | |
# emacsclient.desktop: | |
# |
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
(setq org-todo-keywords | |
;; !/@ meaning: https://orgmode.org/manual/Tracking-TODO-state-changes.html | |
'((sequence "TODO(t!)" "STARTED(s!)" "NEXT(n!)" "WAITING(w!)" "|" "DONE(d!)" "CANCELED(c@)") | |
;; multiple sets for one file | |
;; (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)""|" "FIXED(f)") | |
;; (sequence "|" "CANCELED(c)") | |
)) | |
# put this before txt README |
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
channels: | |
- https://mirrors.cloud.tencent.com/anaconda/cloud/conda-forge/ | |
- https://mirrors.cloud.tencent.com/anaconda/cloud/menpo/ | |
- https://mirrors.cloud.tencent.com/anaconda/cloud/pytorch/ | |
- https://mirrors.cloud.tencent.com/anaconda/cloud/bioconda/ | |
- https://mirrors.cloud.tencent.com/anaconda/pkgs/main/ | |
- https://mirrors.cloud.tencent.com/anaconda/pkgs/free/ | |
- ripl-org | |
- lebedov | |
- conda-forge |