Skip to content

Instantly share code, notes, and snippets.

import akka.actor.{Inbox, Actor, ActorSystem, Props}
trait Interceptor extends Actor {
abstract override def receive: Receive = {
case m =>
println(s"[MESSAGE RECEIVED]:\n\tMsg: $m\n\tFrom: ${sender()}\n\tTo: $self")
super.receive(m)
}
}
@ale64bit
ale64bit / build.sbt
Created December 11, 2015 07:33
Project file without shading
name := "reproducer"
version := "0.1"
scalaVersion := "2.11.7"
val aws = "1.10.33"
val awsHadoop = "1.7.4"
libraryDependencies ++= {
@ale64bit
ale64bit / build.sbt
Created December 11, 2015 07:37
Project file with shading rule
name := "reproducer"
version := "0.1"
scalaVersion := "2.11.7"
val aws = "1.10.33"
val awsHadoop = "1.7.4"
libraryDependencies ++= {
@ale64bit
ale64bit / build.sbt
Last active December 11, 2015 08:03
Project with working shade rules
name := "reproducer"
version := "0.1"
scalaVersion := "2.11.7"
val aws = "1.10.33"
val awsHadoop = "1.7.4"
libraryDependencies ++= {
n = int(raw_input('')) # read how many input strings follow next
for i in range(0, n): # remember, the interval [a, b] is from a to b-1
s = raw_input('') # read current line
print s # do something with it. It can be printing it, or something more complex.
# Here, you can do what the exercise requires and then print it out.
import akka.actor._
import akka.persistence.PersistentActor
import akka.persistence.inmemory.query.journal.scaladsl.InMemoryReadJournal
import akka.persistence.query.{EventEnvelope, PersistenceQuery}
import akka.stream.scaladsl.Sink
import akka.stream.{ActorMaterializer, ActorMaterializerSettings}
import akka.testkit.{TestKit, TestProbe}
import com.typesafe.config.ConfigFactory
import org.scalatest._
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main implements Runnable {
@ale64bit
ale64bit / Main.java
Created May 30, 2016 19:03
Timus 1846
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Map;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Queue;
import java.util.ArrayDeque;
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
final static int INF = Integer.MAX_VALUE>>1;
@ale64bit
ale64bit / eval.py
Created October 25, 2016 19:44
compute cosine similarity for Inception bottleneck output of two images
import sys
import os.path
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import graph_util
from tensorflow.python.framework import tensor_shape
from tensorflow.python.platform import gfile
BOTTLENECK_TENSOR_NAME = 'pool_3/_reshape:0'