Skip to content

Instantly share code, notes, and snippets.

Nam Chu Hoai nambrot

Block or report user

Report or block nambrot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View minsweeper.ruby
require 'json'
class Minesweeper
def initialize(n, m, number_of_mines)
@n = n
@m = m
@number_of_mines = number_of_mines
@user_board = []
@visible = []
import java.util.*;
* To execute Java, please define "static void main" on a class
* named Solution.
* If you need more classes, simply define them inline.
View seminar_tf.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test.ipnyb
"cells": [
"cell_type": "markdown",
"metadata": {},
"source": [
"# Approximate q-learning\n",
"In this notebook you will teach a __tensorflow__ neural network to do Q-learning."

Keybase proof

I hereby claim:

  • I am nambrot on github.
  • I am nambrot ( on keybase.
  • I have a public key ASDfEQ9ohfu9htqGyMQjafRCaqXKvag1AeWymD3d81dOMwo

To claim this, I am signing this object:

PCollection<KV<Integer, Iterable<Alert>>> sessionedAlerts = alerts
.apply(MapElements.via((Alert event) -> KV.of(event.userId, event)).withOutputType(new TypeDescriptor<KV<Integer, Alert>>() {}))
PCollection<Alert> throttledAlerts = sessionedAlerts
.apply(FlatMapElements.via((KV<Integer, Iterable<Alert>> pair) -> {
ArrayList<Alert> acc = new ArrayList<>();
final TupleTag<BloodPressureEvent> bpTag = new TupleTag<>();
final TupleTag<HeartRateEvent> hrTag = new TupleTag<>();
PCollection<KV<Integer, CoGbkResult>> joined =
KeyedPCollectionTuple.of(bpTag, bpEvents)
.and(hrTag, hrEvents)
PCollection<Alert> alerts = joined.apply(FlatMapElements.via((KV<Integer, CoGbkResult> pair) -> {
CoGbkResult result = pair.getValue();
Boolean hasLowSystolic = FluentIterable.from(result.getAll(bpTag)).anyMatch((BloodPressureEvent event) -> event.systolic < 100);
SlidingWindows window = SlidingWindows.of(Duration.standardMinutes(60)).every(Duration.standardMinutes(5));
// create the sources and map them into POJOs (and window them by the sliding window)
PCollection<KV<Integer, BloodPressureEvent>> bpEvents =
.apply(ParDo.of(new BloodPressureEventCaster()))
.apply(MapElements.via((BloodPressureEvent event) -> KV.of(event.userId, event)).withOutputType(new TypeDescriptor<KV<Integer, BloodPressureEvent>>() {}));
PCollection<KV<Integer, HeartRateEvent>> hrEvents =
You can’t perform that action at this time.