Skip to content

Instantly share code, notes, and snippets.

View onesuper's full-sized avatar

Dreamsome onesuper

View GitHub Profile
@onesuper
onesuper / wordpressxml2jekyll.rb
Created March 24, 2012 01:34 — forked from markoa/wordpressxml2jekyll.rb
Script to export posts from a Wordpress XML file to Jekyll (Textile) files. Collects comments in a YAML file too.
#!/usr/bin/env ruby
# Input: WordPress XML export file.
# Outputs: a series of Textile files ready to be included in a Jekyll site,
# and comments.yml which contains all approved comments with metadata which
# can be used for a Disqus import.
require 'rubygems'
require 'hpricot'
require 'clothred'
@onesuper
onesuper / LatexReborn
Created October 30, 2012 05:05
let dead latex pictures reborn
javascript:(function(){var from="http://latexservice.mpstechnologies.com/latexservice.cgi";var to="http://latex.codecogs.com/gif.latex";var array=document.getElementsByTagName("img");for(var i=0; i<array.length;i++){if(array[i].src.indexOf(from)==0) {array[i].src=array[i].src.replace(from, to);}}})()
struct foo {
int x;
int y;
};
static struct foo f;
/* The two following functions are running concurrently: */
int sum_a(void)
import sys
def sub(instr):
i = 0
gput = put()
gput.next()
while True:
c = instr[i]
@onesuper
onesuper / gist:8129184
Last active January 1, 2016 10:09
liugu bfs
__global__ void
New_BFSKernel_multiBlock_2LQ_inGPU(int * workset,int * new_workset, Node* g_graph_node, Edge * g_graph_edge, int * visited, int * cost, int worksetsize, int * newsize,int level,int *flag,int *special_q)
{
int tid = blockIdx.x*blockDim.x + threadIdx.x;
count=0;
global_level = level;
global_worksize = worksetsize;
global_flag = 0;
odd = 0;
global_newsize = 0;
import random
class Pool:
def __init__(self, names):
self.names = names
def pick(self):
if len(self.names) == 0:
@onesuper
onesuper / add_del_blank.rb
Created December 7, 2015 06:19
add or del blanks between Chinese and English words.
#!/usr/bin/env ruby
# Usage: deal_blanks.rb input.txt >out.txt
def isEn(char)
/\w/.match(char) != nil
end
File.open(ARGV[0], "r") do |file|
blanks_del = 0
@onesuper
onesuper / kafka.md
Created June 30, 2016 08:46 — forked from ashrithr/kafka.md
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@onesuper
onesuper / tuning_storm_trident.asciidoc
Created July 5, 2016 07:41 — forked from mrflip/tuning_storm_trident.asciidoc
Notes on Storm+Trident tuning

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@onesuper
onesuper / 词性标记.md
Created August 10, 2016 02:22 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

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

ICTPOS3.0词性标记集

n 名词

nr 人名