https://github.com/usmanhalalit/gost for idea of implementation
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
#lang racket | |
(define rock "A") | |
(define paper "B") | |
(define scissor "C") | |
(define rules (make-hash)) | |
(hash-set! rules (string-append rock scissor) 6) | |
(hash-set! rules (string-append rock paper) 0) | |
(hash-set! rules (string-append rock rock) 3) | |
(hash-set! rules (string-append paper rock) 6) |
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
#lang racket | |
(define (max-calories rec) | |
(foldl + 0 (map string->number (string-split rec "\n")))) | |
(define (process in) | |
(sort (foldl cons '() (map max-calories (string-split in "\n\n"))) >)) | |
(define (report l) | |
(printf "part1:~a ~n" (car l)) | |
(printf "part2:~a ~n" (foldl + 0 (take l 3)))) | |
;; part 1 |
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
package main | |
import ( | |
"crypto/tls" | |
"flag" | |
"log" | |
"net" | |
"net/textproto" | |
) |
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
Script started on 2019-10-14 13:37:14+0000 | |
To run a command as administrator (user "root"), use "sudo <command>". | |
See "man sudo_root" for details. | |
[ubuntu@experiment-5d816f2592f715a1 ~] 2019-10-14 13:37:14 | |
$exit | |
exit | |
Script done on 2019-10-14 13:47:58+0000 |
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
# Configure the Google Cloud provider | |
provider "google" { | |
credentials = "${file("credentials.json")}" | |
project = "REPLACEMEWITHPROJECTID" | |
region = "us-central1" | |
} | |
# Terraform plugin for creating random ids | |
resource "random_id" "instance_id" { |
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
// Configure the Google Cloud provider | |
provider "google" { | |
credentials = "${file("credentials.json")}" | |
project = "REPLACEME_WITHPROJECTID" | |
region = "us-central1" | |
} | |
// Terraform plugin for creating random ids | |
resource "random_id" "instance_id" { |
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
// Configure the Google Cloud provider | |
provider "google" { | |
credentials = "${file("credentials.json")}" | |
project = "pilosa-sandbox" | |
region = "us-central1" | |
} | |
// Terraform plugin for creating random ids | |
resource "random_id" "instance_id" { |
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
// Configure the Google Cloud provider | |
provider "google" { | |
credentials = "${file("credentials.json")}" | |
project = "pilosa-sandbox" | |
region = "us-central1" | |
} | |
// Terraform plugin for creating random ids | |
resource "random_id" "instance_id" { | |
byte_length = 8 |
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
import org.apache.log4j.{Level, Logger} | |
import util.Random | |
import org.apache.spark.sql.functions._ | |
import scala.reflect.ClassTag | |
import org.apache.spark.{Partition, TaskContext,SparkContext} | |
import org.apache.spark.rdd.RDD | |
import org.apache.spark.Partitioner | |
import org.apache.spark.sql.types._ | |
import org.apache.spark.SparkContext._ |
NewerOlder