Skip to content

Instantly share code, notes, and snippets.

View zhaofeng-shu33's full-sized avatar
🎯
Focusing

赵丰 (Zhao Feng) zhaofeng-shu33

🎯
Focusing
  • Institute of Telecommunication and Navigation Satellite
  • Chinese Academy of Space Technology, Beijing, PR China
View GitHub Profile
@zhaofeng-shu33
zhaofeng-shu33 / errata.md
Last active September 26, 2020 13:33
Ye Min SIBM article

Page 4, Definition 1, "a undirected" => "an undirected".

Page 5, the last 7th line, "Therefor" => "Therefore"

Page 8, the 6th line, "define define" => "define"

Page 15, the last line, "to proving" => "to prove"

Page 16, the equation 17, should add the cardinality symbol.

from PIL import Image, ImageFile
from sys import exit, stderr
from os.path import getsize, isfile, isdir, join
from os import remove, rename, walk, stat
from stat import S_IWRITE
from shutil import move
from argparse import ArgumentParser
from abc import ABCMeta, abstractmethod
class ProcessBase:
@zhaofeng-shu33
zhaofeng-shu33 / ToChinese.py
Last active May 15, 2020 10:34
convert scientific workplace generated tex files to normal tex files
#!/usr/bin/python
#coding=utf-8
import re
import os
def toUnicode(num):
try:
return eval("u"+"'\u{0}'".format(num))
except Exception as e:
import pdb
pdb.set_trace()
import re
import os
def replace_frame_str(str):
r_ex = re.compile(r'\\FRAME.*?}}', flags=re.DOTALL)
return re.sub(r_ex, '%FRAME', str)
def replace_frame_file(filename):
with open(filename) as f:
st = f.read()
import os
import argparse
def convert(filename):
with open(filename, 'rb') as f:
st = f.read()
try:
st = st.decode('gbk')
except Exception as e:
print('gbk decode error for ' + filename)
Page 93: the position of ".text:00000009 lea eax, [ecx+eax*2]" is wrong
Page 59: 0x0000BEEF should be red with the corresponding label
@zhaofeng-shu33
zhaofeng-shu33 / errata_lfd.md
Last active August 30, 2020 14:01
learning from data errata

Lecture 9 Reinforcement learning

Page 34, loss function, missing the closing bracket (y_i - Q()^2)

Page 21, the second equation of Newton's law is wrong, the physical dimension mismatches on two sides of the equality.

import time
import subprocess
from subprocess import PIPE, STDOUT
import sys
from PIL import Image
resolution = 144
pdf_file_name = sys.argv[1]
r = subprocess.run(['gs', '-q', '-dBATCH', '-dNOPAUSE', '-sDEVICE=bbox', pdf_file_name], stdout=PIPE, stderr=STDOUT)
@zhaofeng-shu33
zhaofeng-shu33 / texshop.applescript
Last active November 7, 2020 04:17
applescript for texshop to open skim displayline
--AppleScript direct
-- set val to do shell script "sed 's|[a-zA-Z]*.pdf|build/&|g' <<< " & quoted form of #PDFPATH#
-- tell application "Skim" to open val
set val to do shell script "sed 's|[a-zA-Z]*.pdf|build/&|g' <<< " & quoted form of #PDFPATH#
-- val is pdfpath
set lf to linefeed
tell application "TeXShop"
set offs to offset of the selection of document #DOCUMENTNAME#