Skip to content

Instantly share code, notes, and snippets.

View vianel's full-sized avatar
🏠
Working from home

Vianel vianel

🏠
Working from home
  • 05:39 (UTC -05:00)
View GitHub Profile
{
"streams": [
{
"stream": "beers",
"tap_stream_id": "beers",
"schema": {
"type": "object",
"properties": {
"beer_event_id": {
"type": [
@vianel
vianel / gradient_descent.py
Last active March 25, 2021 04:00
Gradient descent implementation
from matplotlib import cm #For the colors
import numpy as np
import matplotlib.pyplot as plt
def f(x,y):
return x**2 + y**2
def derivate(point_with_increment, point, h):
return (f(point_with_increment[0], point_with_increment[1]) - f(point[0], point[1])) / h
@vianel
vianel / MapSourceToFlow.scala
Created August 8, 2018 02:48
Simple sample how to connect a Flow to Source and keep going the stream using Akka Stream
package main
import akka.actor.ActorSystem
import akka.stream.{ActorMaterializer, ClosedShape}
import akka.stream.scaladsl.{Flow, GraphDSL, RunnableGraph, Sink, Source}
import GraphDSL.Implicits._
import com.typesafe.config.{ Config, ConfigFactory }
object SrcToFlow extends App {