View match-score.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
alphabet_to_num = {
'A': 3,
'B': 3,
'C': 1,
'D': 2,
View no-work-posession.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def geometric_coeff(percentage, n):
if percentage != 0:
ratio = percentage / 100.0
return float((1 + ratio) ** n - 1) / ratio
else:
return n
View gist:b834bfac2b3c7ee8ab46
import com.twitter.util.Future
var seq = Future(Seq(1,2,3))
seq map { s => Map(s map {x => x -> x * 2}): _*) }