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 parallelProg.week1 | |
object Example0501 extends App { | |
// Resolving deadlocks: acquire resources in the same order | |
class Account(var amount:Int = 0, val name:String) { | |
private val x = new AnyRef {} | |
private var uidCount = 0L | |
val uid = getUniqueId() |
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
batch_size = 16 | |
patch_size = 5 | |
depth = 16 | |
num_hidden = 64 | |
graph = tf.Graph() | |
with graph.as_default(): | |
# Input data: train, test and validation set | |
tf_train_dataset = tf.placeholder( |
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 com.berlinsmartdata.spark.streaming | |
import org.apache.spark._ | |
import org.apache.spark.streaming._ | |
import org.apache.spark.streaming.StreamingContext._ | |
object Sample { | |
def main(args: Array[String]):Unit = { | |
val numReceivers = 2 //note: has to be >= 2 |
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 requests | |
from requests.exceptions import HTTPError, Timeout | |
from pyspark import SparkConf | |
from pyspark import SparkContext | |
from pyspark.sql import SQLContext | |
DEFAULT_INSTANCE_ROLE = 'STAGING_EMR_CLUSTER_ROLE' | |
conf = SparkConf().setAppName(opts.get('app_name')) |
NewerOlder