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
| scala> def addStringOneParam(input: String): String = input + "foo" | |
| addStringOneParam: (input: String)String | |
| scala> def addStringDefParam(input: String, toAdd: String = "foo"):String = input + toAdd | |
| addStringDefParam: (input: String, toAdd: String)String | |
| scala> addStringOneParam("baz") | |
| res3: String = bazfoo | |
| scala> addStringDefParam("baz") |
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
| scala> Array(1, 2, 3) == Array(1, 2, 3) | |
| res0: Boolean = false | |
| scala> Vector(1, 2, 3) == Vector(1, 2, 3) | |
| res1: Boolean = true | |
| scala> List(1, 2, 3) == List(1, 2, 3) | |
| res2: Boolean = true |
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
| scala> Set | |
| res0: scala.collection.immutable.Set.type = scala.collection.immutable.Set$@12559336 | |
| scala> import scala.collection.mutable.Set | |
| import scala.collection.mutable.Set | |
| scala> Set | |
| res1: scala.collection.mutable.Set.type = scala.collection.mutable.Set$@f86a0bd |
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
| #!/bin/bash | |
| virtualenv .env && | |
| source .env/bin/activate && | |
| brew install libevent && | |
| brew install libyaml && | |
| pip install cython && | |
| pip install numpy && | |
| pip install scipy && | |
| pip install pandas && | |
| pip install matplotlib && |
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
| Robs-MacBook-Pro:testenv robstory$ sh PIPALLTHETHINGS.sh | |
| New python executable in .env/bin/python2.7 | |
| Also creating executable in .env/bin/python | |
| Installing setuptools, pip...done. | |
| Warning: libevent-2.0.21 already installed | |
| Warning: libyaml-0.1.6 already installed | |
| Downloading/unpacking cython | |
| Downloading Cython-0.20.2-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl (3.4MB): 3.4MB downloaded | |
| Installing collected packages: cython | |
| Successfully installed cython |
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
| (.env)Robs-MacBook-Pro:IScala-0.1 robstory$ ipython console --KernelManager.kernel_cmd='["java", "-jar", "lib/IScala.jar", "--profile", "{connection_file}", "--parent"]' | |
| Python 2.7.8 (default, Aug 13 2014, 14:30:31) | |
| Type "copyright", "credits" or "license" for more information. | |
| IPython 2.2.0 -- An enhanced Interactive Python. | |
| ? -> Introduction and overview of IPython's features. | |
| %quickref -> Quick reference. | |
| help -> Python's own help system. | |
| object? -> Details about 'object', use 'object??' for extra details. | |
| Welcome to Scala 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_67) |
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
| val vec1 = Vector(1, 2, 3) | |
| val vec2 = Vector(3, 4, 5, 6, 7, 8) | |
| val vec3 = Vector("foo", "bar", "baz") | |
| val vec4 = Vector("one", Map("one" -> 1, "two" -> 2)) | |
| def match_vec(vec: Vector[Any]) { | |
| vec match { | |
| case Vector(_, _, 3) => println("Vector ends in 3!") | |
| case Vector(3, _*) => println("Vector starts with three, has any number of elements!") | |
| case Vector(_, "bar", _) => println("String Vector!") |
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
| class YoDawg(FacetGrid): | |
| """I got facets in your facets""" | |
| def __init__(args, kwargs) | |
| super(YoDawg, self).__init__(*args, **kwargs) |
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
| stats = malort.run('mydir/files', delimiter='|') | |
| redshift_suggestions = malort.get_redshift_types(stats) | |
| df = malort.get_dataframe(stats) | |
| # OR | |
| result = malort.run('mydir/files', delimiter='|') | |
| redshift_suggestions = result.get_redshift_types() | |
| df = result.get_dataframe() |
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
| def add(x: Int, y: Int = 1): Int = x + y | |
| def transform(z: Int, transformer: (Int, Int) => Int): Int = transformer(z) | |
| // Exiting paste mode, now interpreting. | |
| <console>:9: error: not enough arguments for method apply: (v1: Int, v2: Int)Int in trait Function2. | |
| Unspecified value parameter v2. | |
| def transform(z: Int, transformer: (Int, Int) => Int): Int = transformer(z) |