Skip to content

Instantly share code, notes, and snippets.

View lvzongting's full-sized avatar

lvzongting lvzongting

View GitHub Profile
% Compile the PROPACK package
% Copyright LI, Wei(@kuantkid)
% detect gfortran
switch (lower(computer))
case 'glnxa64'
fc = 'gfortran';
suffix = 'mexa64';
case 'glnxa32'
fc = 'gfortran';
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@lvzongting
lvzongting / db_fm.py
Created February 13, 2012 02:30 — forked from yanyaoer/db_fm.py
listening my douban.fm with python & mpg123
# vim: set et sw=4 ts=4 sts=4 fdm=syntax ff=unix fenc=utf8:
#!/usr/bin/python
import json
from subprocess import Popen
import urllib2
_url = 'http://douban.fm/j/mine/playlist?type=n&h=&channel=0'
req = urllib2.urlopen(urllib2.Request(_url))
obj = json.load(req)