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
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()
@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()
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 / 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.

@zhaofeng-shu33
zhaofeng-shu33 / suggestions_by_feima.md
Last active April 24, 2020 10:17
suggestions_by_feima.md

Targeted at PPT:

  1. whether to write the name of Professor Huang on the first page of PPT
  2. From engineering perspective to introduce the problem?
  3. Introduction of Info-Clustering and Metric Page has a little more interval pages
  4. research works seem not belonging to yourself.
  5. You should draw a figure to illustrate your main contribution.

Splitted Time: 3min Background 5min Related work

@zhaofeng-shu33
zhaofeng-shu33 / euclid.py
Created April 18, 2020 10:58
draw euclid norm illustration
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1, 1, 100)
x_r = np.linspace(1, -1, 100)
f_x = np.concatenate((x, x_r))
powers = [1, 2, 3, 4, 100]
label_str_list = ['$|x|+|y|=1$',
'$x^2+y^2=1$',
'$|x|^3+|y|^3=1$',
'$x^4+y^4=1$',
#include <immintrin.h>
const int NUM = 1000000;
static float X[NUM], Y[NUM], Z[NUM];
void dig_hole() {
__m128 a,b,c;
for(int j = 0; j < 1000; j++) {
for(int i = 0; i < NUM; i += 4) {
a = _mm_load_ps(&X[i]);
b = _mm_load_ps(&Y[i]);
c = _mm_add_ps(a, b);
#include <gtest/gtest.h>
class A : public testing::Test {
protected:
int a;
void SetUp() override {
a = 2;
}
};
TEST_F(A, power) {
EXPECT_EQ(a * a, 4);
[feng@bcm triangle_counting_dataset]$ cat slurm-25257.out
3225088881 32212254720 s28.e15.kron.edgelist.bin
[feng@bcm triangle_counting_dataset]$ cksum s29.e10.kron.edgelist.bin
2273941959 42949672960 s29.e10.kron.edgelist.bin
#include <stdio.h>
#include <cuda.h>
#define check( a ) \
{\
if ( (a) != 0 ) {\
printf("ERROR in %s : %d\n", __FILE__ , __LINE__ );\
exit(0);\
}\
}