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
| from collections import namedtuple | |
| from operator import itemgetter | |
| from pprint import pformat | |
| class Node(namedtuple('Node', 'location left_child right_child')): | |
| def __repr__(self): | |
| return pformat(tuple(self)) | |
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
| from scipy.misc import imread | |
| from scipy.linalg import svd | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| if __name__ == '__main__': | |
| img = imread('mm.jpg') | |
| h, w, c = img.shape |
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 requests | |
| from bs4 import BeautifulSoup | |
| base_url = 'https://zzk.cnblogs.com/s/blogpost' | |
| cookies = dict( | |
| ZzkNoRobotCookie= | |
| 'CfDJ8KlpyPucjmhMuZTmH8oiYTOsZWLqcxSx0sRuNdfc35P334ttmwTqPekgb1OOGtp_JeXby7PZgQla4HC63Y3_nnWwF8kvdklA71DbLOQ2ADfziUqy4BkuXQUgJEB4y2kj6w' | |
| ) | |
| languages = [ |
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
| \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\DefaultColors\Standard | |
| \HKEY_CURRENT_USER\Control Panel\Colors |
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 <windows.h> | |
| #include <stdio.h> | |
| void normal(char* s) { | |
| HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); | |
| WORD info_style = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; | |
| SetConsoleTextAttribute(hOut, info_style); | |
| printf(s); | |
| } |
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 smtplib | |
| from email.mime.text import MIMEText | |
| from email.mime.multipart import MIMEMultipart | |
| from_addr = "msn4399@163.com" | |
| to_addr = "httpggg@qq.com" | |
| msg = MIMEMultipart() | |
| msg['From'] = from_addr | |
| msg['To'] = to_addr |
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
| [Unit] | |
| Description=Shadowsocks Python local client | |
| [Service] | |
| Type=forking | |
| ExecStart=/path/to/sslocal -c /path/to/config.json -d start | |
| ExecReload=/path/to/sslocal -c /path/to/config.json -d restart | |
| ExecStop=/path/to/sslocal -c /path/to/config.json -d stop | |
| [Install] |
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 <sstream> | |
| #include <fstream> | |
| std::string readFileToStr(std::string file) | |
| { | |
| std::ifstream input(file); | |
| std::stringstream sstr; | |
| while(input >> sstr.rdbuf()); |
NewerOlder