Creates a step in Amazon EMR for a given cluster_id
and monitors it's progress using a sensor. A more complex example, that involves cluster creation/termination can be found here.
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
public final class BusyApp { | |
public static void main(String []args) throws Exception { | |
final java.util.Random generator = new java.util.Random(); | |
while (true) { | |
generator.ints(1000000, 0, 100).sorted(); | |
Thread.sleep(5000L); | |
} | |
} | |
} |
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
object SbtAmazonEcr extends App { | |
while(true) { | |
println("Hello Docker.") | |
Thread.sleep(3000) | |
} | |
} |
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
object EmojiMeal extends App { | |
type Ingredient = String | |
type Meal = String | |
type Person = String | |
type Poop = String | |
def cook(item: Ingredient): Meal = item match { | |
case "🐮" => "🍔" | |
case "🍠" => "🍟" | |
case "🐔" => "🍗" |
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
# | |
# A Kafka consumer, that will print schema version information for | |
# all available subjects. | |
# | |
# Use the RESTful API to query SchemaRegistry directly. For example: | |
# curl http://schema-registry:8081/subjects/{subject}/versions | |
# | |
from kafka import KafkaConsumer | |
from random import randint |
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
lazy val person = settingKey[String]("Person to greet") | |
lazy val hello = taskKey[Unit]("Greet person") | |
// https://stackoverflow.com/q/14262798/1535738 | |
def greetEveryone = Command.command("greetEveryone") { state => | |
Seq("John", "Alice", "Bob").foreach { name => | |
val extracted = Project extract state | |
val newState = extracted.append(Seq(person := name), state) | |
Project.extract(newState).runTask(hello, newState) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
namespace knn | |
{ | |
class MainClass | |
{ | |
public struct Record |
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 Double.NaN | |
object FillMissingValues1 extends App { | |
val data = List(1.0, NaN, 2.0, NaN, NaN, 3.0, 4.0, NaN, 5.0, NaN) | |
val res = data.scanLeft(0.0)( (current, item) => if (item.isNaN) current else item) | |
println(res) | |
} |
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 React from 'react' | |
import PropTypes from 'prop-types' | |
import { | |
isEqual, | |
includes | |
} from 'lodash' | |
class DelayedList extends React.Component { | |
constructor(props) { |