Skip to content

Instantly share code, notes, and snippets.

View farseerfc's full-sized avatar
👶
rsync -a my-knowledge my_baby_girl:~/

Jiachen Yang farseerfc

👶
rsync -a my-knowledge my_baby_girl:~/
View GitHub Profile
@farseerfc
farseerfc / gist:1125490
Created August 4, 2011 15:50
treeyssy.py
#!/usr/bin/env python3
from urllib.request import urlopen
#!/usr/bin/env python2
# from urllib2 import urlopen
import re,sys,os,html
URLBASE="http://bbs.sjtu.edu.cn/"
URLTHREAD=URLBASE+"bbstfind0?"
URLARTICLE=URLBASE+"bbscon?"
@farseerfc
farseerfc / renren_lovetree.py
Created August 9, 2011 16:46
renren_lovetree.py
from urllib.request import urlopen
from os import fork
from re import findall
accounts={
('[email protected]','password1'),
('[email protected]','password2')
}
def login(accounts):
@farseerfc
farseerfc / 3fibs.py
Created November 25, 2011 03:12
3 kinds of python code for fibonacci
#!/usr/bin/python2
def fibs1(i):
fibs=[1,1]
for j in xrange(2,i):
fibs.append(fibs[j-1]+fibs[j-2])
return fibs
def fib2():
yield (1,1);
@farseerfc
farseerfc / perm.scm
Created December 4, 2011 15:06
Permutation genetator in scheme
(define (empty? list)
(eq? list '()))
(define (len list)
(cond ((empty? list) 0)
(else (+ 1 (len (cdr list))))))
(define (append list num)
(cond ((empty? num) list)
((empty? list) (cons num '()))
@farseerfc
farseerfc / gist:1758739
Created February 7, 2012 09:43
shell try
farseer ~ $ cat inner.sh
#!/bin/sh
echo $@
farseer ~ $ cat month_props.sh
#!/bin/sh
./inner.sh $@
echo `date`
farseer ~ $ cat try.sh
#!/bin/bash
@farseerfc
farseerfc / boost_accumulator_count_if.cpp
Created October 9, 2012 17:53
try to implement a count_if using boost accumulator framework
#include <iostream>
#include <algorithm>
#include <functional>
#include <boost/mpl/placeholders.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/count.hpp>
#include <boost/foreach.hpp>
#include <boost/parameter/keyword.hpp>
@farseerfc
farseerfc / gist:5772210
Last active May 16, 2018 06:17
Molokai theme for termite
# Molokai theme
[colors]
background= #101010
foreground= #d0d0d0
#foreground= #66ff66
#highlight = #505050
cursor = #66ff66
color0= #101010
color1= #960050
color2= #66aa11
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
package sample;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class TestGeneric{
private HashMap<String, Object> hashMap=new HashMap<>();
public Object get(String key){