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
#! /bin/bash | |
#SBATCH --nodes=$${nodes} | |
#SBATCH --ntasks=$${ntasks} | |
#SBATCH --ntasks-per-node=$${ntasks_per_node} | |
#SBATCH --cpus-per-task=$${cpus_per_task} | |
#SBATCH --gres=$${gres} | |
#SBATCH --qos=$${qos} | |
#SBATCH --time=$${walltime} | |
#SBATCH --partition=$${queue} | |
#SBATCH --account=$${account} |
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
_fw_name: CommonAdapter | |
_fw_q_type: SLURM | |
rocket_launch: rlaunch -c /home/catml/atomate/config rapidfire | |
nodes: 1 | |
ntasks: 48 | |
walltime: '1680:00:00' | |
queue: null | |
account: null | |
job_name: null | |
pre_rocket: null |
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 matplotlib | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
from pymatgen.analysis.surface_analysis import WorkFunctionAnalyzer | |
plt.figure(figsize=(20, 15)) | |
kwargs = { | |
"poscar_filename": './CONTCAR', |
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 os | |
import sys | |
from glob import glob | |
from ase.io import read, write | |
from ase import Atoms | |
import numpy as np | |
from ase.utils import natural_cutoffs | |
from ase.build import molecule | |
import matplotlib.pyplot as plt |
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 os | |
import sys | |
from glob import glob | |
from ase.io import read, write | |
from ase import Atoms | |
import numpy as np | |
from ase.utils import natural_cutoffs | |
from ase.build import molecule | |
import matplotlib.pyplot as plt |
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 | |
import re | |
url = "http://muchong.com/bbs/logging.php?action=login" | |
sess = requests.session() | |
# 构建headers | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) \ | |
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 \ |
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 Counter | |
from collections import defaultdict | |
def solution(A): | |
c = Counter(A) | |
repeat = [i for i in c if c[i] > 1] | |
ddict = defaultdict(list) | |
for i in range(len(A)): | |
ddict[A[i]].append(i) | |
dis = [max(ddict[i]) - min(ddict[i]) for i in ddict if len(ddict[i]) > 1] |
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
class zjw(): | |
def __init__(self): | |
self.name = 1 | |
@classmethod | |
def classmethod(cls, arg): | |
print dir(cls) | |
print cls | |
print dir(arg) | |
print arg |
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 paramiko | |
import os | |
ssh = paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
IP = "***********" | |
# port = 22 | |
# user = "riic" | |
# key = "/Users/zhangjiawei/.ssh/id_dsa_138_jwzhang.jwzhang" |
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
# -*- coding:utf-8 -*- | |
import re | |
IDCARD_REGEX = '[1-9][0-9]{14}([0-9]{2}[0-9X])?' | |
# 新身份证18位, 最后一位可能是X; 老身份证15位 | |
def is_valid_idcard(idcard): | |
"""Validate id card is valid.""" | |
if isinstance(idcard, int): |
NewerOlder