d=2015-12-31
while [ "$d" != 2017-01-01 ]; do
echo $d
d=$(date -I -d "$d + 1 day")
done
# pyhton 2
python -c "import json, urllib2;\
print json.load(urllib2.urlopen('https://www.howsmyssl.com/a/check'))['tls_version']"
# pyhton 3
python3 -c "import json, urllib.request;\
print(json.loads(urllib.request.urlopen('https://www.howsmyssl.com/a/check').read().decode('UTF-8'))['tls_version'])"
>>>
from OpenSSL import SSL
print(SSL.OPENSSL_VERSION_NUMBER)
def example = 2 // evaluated when called
val example = 2 //evaluated immediately
lazy val example = 2 //evaluated once when needed
def square(x: Double) // call by value def square(x: => Double) // call by name def myFct(bindings: Int*) = { ... } // bindings is a sequence of int,
// containing a varying # of arguments
val list: List[Int] = List(1, 2, 3, 4, 5)list.fold(0)(_ + _) // op function takes 2 Int and returns sum(Int)// possible orders of parallel execution for fold0 + 1 = 1 0 + 2 = 2 0 + 4 = 4 // 1st parallel operation1 2 + 3 = 5 4 + 5 = 9 // 2nd parallel operation1 5 + 9 = 141 + 14 = 15
val list: List[Int] = List(1, 2, 3, 4, 5)list.foldLeft(0)(_ + _)// Only possible iteration sequence0 + 1 = 11 + 2 = 33 + 3 = 66 + 4 = 1010 + 5 = 15
val list: List[Int] = List(1, 2, 3, 4, 5)list.foldRight(0)(_ + _)// Only possible iteration sequence, Reverse access to elements0 + 5 = 55 + 4 = 99 + 3 = 1212 + 2 = 1414 + 1 = 15