Skip to content

Instantly share code, notes, and snippets.

View perillaroc's full-sized avatar

Wang Dapeng perillaroc

View GitHub Profile
@perillaroc
perillaroc / convert_baidu_blog_to_hugo.py
Created May 4, 2019 12:18
Convert baidu blog to hugo pages.
# coding: utf-8
from datetime import datetime
import re
import hashlib
from pathlib import Path
from bs4 import BeautifulSoup
import html2text
import frontmatter
from pytz import timezone
@perillaroc
perillaroc / draw_contour.py
Created September 23, 2018 07:44
Use Matplotlib to draw a contour plot
# coding: utf-8
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np
import nuwe_pyeccodes
file_path = "some/file/path/to/gmf.gra.2018081800003.grb2"
message_number = 85
@perillaroc
perillaroc / compile_python.sh
Last active November 14, 2017 06:14
Compile Python On AIX
# python 2
./configure --prefix=YOUR_INSTALL_DIR --disable-ipv6 \
--with-libs=-L/opt/freeware/lib --disable-shared --without-computed-gotos \
CC=xlc CXX=xlC
# python 3
./configure --prefix=YOUR_INSTALL_DIR --disable-ipv6 \
--with-libs=-L/opt/freeware/lib --disable-shared --without-computed-gotos \
CC=xlc CXX=xlC
@perillaroc
perillaroc / matrix_data.cpp
Created February 16, 2017 06:43
Using GSL to create a matrix data structure using in Qwt
#include "matrix_data.h"
MatrixData::MatrixData(QVector<double> x_coords, QVector<double> y_coords, QVector<QVector<double>> matrix):
QwtRasterData{},
interp_type_{gsl_interp2d_bilinear},
interp_x_accel_{nullptr},
interp_y_accel_{nullptr},
spline_x_coords_{nullptr},
spline_y_coords_{nullptr},
spline_values_{nullptr},