This file contains 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
// Adding a comment | |
module Light | |
open Point | |
open System.Drawing | |
type Light ( position: Point3, color: Color ) = | |
member this.Position = position | |
member this.Color = color | |
let AddColors (c1: Color) (c2: Color) = |
This file contains 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
;; this will map the regular expression used to match a token type to a code for that token type. | |
;; For example, the regex for an integer token is "^\d+" and this will map that pattern to 0. | |
;; Unfortunately, I can't seem to get this to work with matching the regex pattern type with the string keys of the map. | |
(def TokenTypes { "^\\d+" 0 | |
"^[a-zA-Z]+" 1 | |
"^\\+" 2 | |
"^\\*" 3 | |
"^\\^" 4}) | |
;; This will take a token and a regular expression and return a vecor with the code for the token type |
This file contains 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
// First Example: | |
val first_example = sc.cassandraTable("spark_demo", "first_example") | |
first_example.first | |
first_example.first.get[Int]("id") | |
//--- | |
case class FirstExample(Id: Int, Value: Int ) |
This file contains 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
create KEYSPACE spark_demo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}; | |
create table spark_demo.raw_files (filename text,line int, contents text, PRIMARY KEY(filename,line)); | |
create table spark_demo.users (id int PRIMARY KEY ); | |
create table spark_demo.movies (id int PRIMARY KEY, name text, year int); | |
create table spark_demo.ratings (id int PRIMARY KEY, user_id int, movie_id int, rating float ); |