Skip to content

Instantly share code, notes, and snippets.

View dndx's full-sized avatar

Datong Sun dndx

View GitHub Profile
@dndx
dndx / TestClass.java
Created September 17, 2012 03:49
Test Case for Assignment1
/* Copyright (c) <2012> <Datong Sun>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@dndx
dndx / xiami_decode.py
Created April 29, 2012 14:42
Xiami URL Decoder
import urllib2
def xiami_decode(s):
s = s.strip()
if not s:
return False
result = []
line = int(s[0])
rows = len(s[1:]) / line
extra = len(s[1:]) % line