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 = []
View Minesweeper.java
import java.io.*;
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",
"\n",
"In this notebook you will teach a __tensorflow__ neural network to do Q-learning."
]
View keybase.md

Keybase proof

I hereby claim:

  • I am nambrot on github.
  • I am nambrot (https://keybase.io/nambrot) on keybase.
  • I have a public key ASDfEQ9ohfu9htqGyMQjafRCaqXKvag1AeWymD3d81dOMwo

To claim this, I am signing this object:

View beam_trigger.java
PCollection<KV<Integer, Iterable<Alert>>> sessionedAlerts = alerts
.apply(Window.remerge())
.apply(Window.into(Sessions.withGapDuration(Duration.standardHours(1))))
.apply(MapElements.via((Alert event) -> KV.of(event.userId, event)).withOutputType(new TypeDescriptor<KV<Integer, Alert>>() {}))
.apply(GroupByKey.create());
PCollection<Alert> throttledAlerts = sessionedAlerts
.apply(FlatMapElements.via((KV<Integer, Iterable<Alert>> pair) -> {
ArrayList<Alert> acc = new ArrayList<>();
FluentIterable
View beam_join.java
final TupleTag<BloodPressureEvent> bpTag = new TupleTag<>();
final TupleTag<HeartRateEvent> hrTag = new TupleTag<>();
PCollection<KV<Integer, CoGbkResult>> joined =
KeyedPCollectionTuple.of(bpTag, bpEvents)
.and(hrTag, hrEvents)
.apply(CoGroupByKey.create());
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);
View beam_sources.java
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 =
p.apply(Create.of(bloodPressureRawEvents))
.apply(ParDo.of(new BloodPressureEventCaster()))
.apply(Window.into(window))
.apply(MapElements.via((BloodPressureEvent event) -> KV.of(event.userId, event)).withOutputType(new TypeDescriptor<KV<Integer, BloodPressureEvent>>() {}));
PCollection<KV<Integer, HeartRateEvent>> hrEvents =
p.apply(Create.of(heartRateRawEvents))
You can’t perform that action at this time.