Skip to content

Instantly share code, notes, and snippets.

View polyrabbit's full-sized avatar

Changxin Miao polyrabbit

View GitHub Profile
@polyrabbit
polyrabbit / gdb_bt_group.py
Created September 22, 2023 13:48
Group identical GDB stacks together to provide a cohesive overview of the activities of all threads.
#!/usr/bin/env python3
from collections import defaultdict
import sys
def parse_stacks(bt_file):
stack = []
for line in bt_file:
if line.strip():
stack.append(line)
else:
@polyrabbit
polyrabbit / loader.css
Last active September 17, 2019 08:59
loading spinner
.load-container {
display: none;
}
.loading .load-container {
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
@polyrabbit
polyrabbit / decode_ebcdic.go
Last active August 17, 2018 15:55
Decode from EBCDIC CodePage1047(IBM-1047) to UTF-8
// The decode method is copied from here:
// https://github.com/zos-go/go/blob/68b2cb8fee417890683b7fa01f02969d0900ff28/src/internal/ebcdic/ebcdic.go
// MCX - Add main function to call the Decode method, so I can view EBCDIC text outside z/OS
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
@polyrabbit
polyrabbit / 词性标记.md
Last active May 16, 2016 16:00 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@polyrabbit
polyrabbit / tmpfy.ahk
Created June 2, 2013 15:11
simulate the great /tmp from Linux to Windows
; simulate the great /tmp from Linux to Windows
if(A_TickCount>5*60*1000) {
msgbox, It should be run while booting, exiting now.
return
}
EnvGet, home, userprofile
tmp_path := home . "/Desktop/tmp"
try {
FileRemoveDir, % tmp_path, 1
FileCreateDir, % tmp_path
@polyrabbit
polyrabbit / 各学期选修学分.js
Created May 21, 2013 16:22
计算在东华大学各学期选修的学分
if(!new RegExp('jw.dhu.edu.cn/dhu/student/query/scorequery.jsp').test(window.location)) {
alert('You should run this on http://jw.dhu.edu.cn/dhu/student/query/scorequery.jsp');
return;
}
var lines=[], all_trs = document.getElementsByTagName('tr');
var ignore = [/形势与政策/, /军事理论/, /学术讲座/, /课外科技活动/, /社会实践/, /军训/, /学业水平考试/];
for(var i=0; i<all_trs.length; ++i)
if(all_trs[i].children.length==12)
lines.push(all_trs[i]);
seme_score = [0,0,0,0,0,0,0,0,0,0,0,0];
@polyrabbit
polyrabbit / rickshaw-demo.html
Created May 16, 2013 07:22
rickshaw integrated with graphite
<head>
<script src="vendor/d3.min.js"></script>
<script src="vendor/d3.layout.min.js"></script>
<script src="rickshaw.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>
<link rel="stylesheet" href="rickshaw.min.css">
<link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css">
#!/usr/bin/env python
# coding:utf-8
__version__ = '1.0'
__author__ = 'phus.lu@gmail.com'
import sys
import os
def remote_import(name, url):