This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
..... | |
File "./filepicker/client/url_client.py", line 102, in get_file_info_response | |
url = urls_lib.sanitize_url(url, strict=True) | |
File "./filepicker/urls_lib.py", line 50, in sanitize_url | |
error() | |
File "./filepicker/urls_lib.py", line 38, in error | |
raise exceptions_lib.FilepickerException("Invalid Url", 400) | |
TypeError: 'AuthException' object is not callable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import other | |
def thrower(): | |
raise other.Exp1 | |
def catcher(): | |
try: | |
thrower() | |
except other.Exp1, other.Exp2: | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Useful Scala Patterns for Compiler Design | |
// 1. Case Classes | |
// [For full details, see Programming in Scala 2ed, page 310] | |
// Case classes are syntactic sugar around normal Scala classes. They come prebaked with the following properties: | |
// * Factory constructor (don't need new) : | |
case class Foo(bar: String) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import boto.ec2 | |
import itertools | |
AWS_KEY = os.getenv('AWS_ACCESS_KEY') | |
AWS_SECRET = os.getenv('AWS_SECRET_KEY') | |
# Tweak as necessary for your infrastructure | |
regions = ['us-east-1', 'us-west-1', 'eu-west-1'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logs.view.map(_.takeWhile(_ != ' ')).grouped(8).count(_.contains("ERROR")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logs.view.map(_.takeWhile(_ != ' ')).grouped(8).count(_.contains("ERROR")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1 to 10) map (_ + 5) map (_ * 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = 1 | |
var num = 0 | |
while(x < 1000) { | |
if(x % 10 == 0) { num += 1 } | |
x += 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1 until 1000).count(_ % 10 == 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = 0L | |
for(i <- 0 to 10000; j <- 0 to 1000; k <- 0 to 1000) { | |
x += 1 | |
} |