duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
from functools import lru_cache | |
class Solution: | |
def getProbability(self, A): | |
def binom(n, k): | |
if not(0 <= k <= n): | |
return 0 | |
ans = 1 | |
for i in range(1, k + 1): | |
ans *= n - i + 1 |
#!/bin/sh | |
binaries=( | |
trash | |
git | |
mosh | |
tmux | |
screen | |
zsh | |
mackup | |
pyenv |
// -- in my opinion the wonderful polymorphism of monad type classes in MTL | |
// -- is the best thing about MTL (rather than transformers themselves), and clearly | |
// -- superior to how early Free programs were built | |
// | |
// -- Nonetheless Free has en equivalent mechanism, which I'm dubbing Free Transformers | |
// -- FT which goes head-to-head with MTL and even allows developers to target both MTL | |
// -- and free portions of their code | |
// | |
// -- Free Transformesr | |
// |
package cats | |
import cats.instances.all._ | |
import cats.data.XorT | |
import scala.concurrent.{Future, ExecutionContext} | |
case class User(val id: Integer, val name: String) | |
class UserRepo { |
import scalaz._ | |
import Scalaz._ | |
object ScalazPlay extends App | |
{ | |
// having this one-param type is critical for the subsequent type inference! | |
type MyWriter[A] = Writer[List[String],A] | |
def f1(i:Int) : MyWriter[Int] = for { |
import Control.Applicative | |
import Control.Monad | |
import Data.List | |
main = (enumFromTo 1 <$> readLn) >>= mapM_ (\caseno -> do | |
getLine | |
x <- map read . words <$> getLine | |
y <- map read . words <$> getLine | |
let answer = sum $ zipWith (*) (sort x) (reverse $ sort y) | |
putStrLn $ "Case #" ++ show caseno ++ ": " ++ show answer |
object OpsMain { | |
def main(args : Array[String]) { | |
hadoop.util.ToolRunner.run(new hadoop.mapred.JobConf, new Tool[XXX]({args => new XXX(args)}), args) | |
} | |
} |
2014-07-21 16:59:44 | |
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.65-b04-462 mixed mode): | |
"Attach Listener" daemon prio=9 tid=7fdba29da800 nid=0x10f40b000 waiting on condition [00000000] | |
java.lang.Thread.State: RUNNABLE | |
"Low Memory Detector" daemon prio=5 tid=7fdba4001800 nid=0x10f91d000 runnable [00000000] | |
java.lang.Thread.State: RUNNABLE | |
"C2 CompilerThread1" daemon prio=9 tid=7fdba4000800 nid=0x10f81a000 waiting on condition [00000000] |
LENGTH = inputParam - 1; | |
List<Set<Basin>> myBasinSets = new List<HashSet<Basin>>(); | |
Basin[][] basins = new Basin[LENGHT][LENGHT] | |
for (int i = 0; i < LENGTH; i++) { | |
for (int j = 0; j < LENGTH; j++) { | |
Basin currentBasin = basins[i][j]; | |
if(isSink(currentBasin)) { | |
HashSet currentBasinTree = new HashSet<Basin>(); | |
currentBasinTree.add(currentBasin) |