Skip to content

Instantly share code, notes, and snippets.

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

Vojtech Letal letalvoj

🏠
Working from home
View GitHub Profile
@letalvoj
letalvoj / TF-nGraph-PlaidML.ipynb
Created November 24, 2019 13:57
Error while trying to set up tensorflow with nGraph backend with PlaidML backend.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@letalvoj
letalvoj / OrigamiParser.scala
Created February 9, 2018 12:45
Parser for the ICFP 2016 competition written in purely functional style
import cats.Id
import cats.data.StateT
import spire.math.Rational
/**
*
* This exercise should show you how you can combine parsers using `flatMap`.
* We will parse one of standard ACM assignments...
*
@letalvoj
letalvoj / FoldTest.scala
Created January 6, 2017 15:31
Is the Cats `fold` method useless?
object FoldTest extends App {
import cats.implicits._
val maps =
List(Map("a" -> 1), Map("a" -> 2), Map("b" -> 3))
/**
* COMPILES
*
@letalvoj
letalvoj / RecursiveStreamComplexity.scala
Last active May 28, 2016 08:51
Recursively defining scala streams by themselves
object RecursiveStreamComplexity extends App {
val integer = new AtomicInteger()
val foo: Stream[Int] = 1 #:: foo.map(i => {
integer.incrementAndGet()
i + 2
})
@letalvoj
letalvoj / google_panorama_downloader.sh
Created May 17, 2016 07:20
Script for downloading panoramas from google street view
#!/usr/bin/env bash
AGENT='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36';
PANOID='Xow4B2hLPjwWMR10JcaB7A';
for j in {0..12}; do
jj=$(printf %02d $j)
for i in {0..25}; do
ii=$(printf %02d $i)
@letalvoj
letalvoj / MongoConfiguraion.java
Created May 5, 2016 17:47
Using Jackson together with Spring Data MongoDB
package cz.blindspot.armorway.analytics.configuration;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.TreeNode;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.mongodb.*;