Skip to content

Instantly share code, notes, and snippets.

RROR: /Users/connie/vsco/jvm/bedrock/src/test/java/com/vsco/bedrock/profiler/BUILD.bazel:17:2: Couldn't build file bedrock/src/test/java/com/vsco/bedrock/profiler/ProfilerTest.jar: Building bedrock/src/test/java/com/vsco/bedrock/profiler/ProfilerTest.jar () failed: Worker process returned an unparseable WorkResponse!
Did you try to print something to stdout? Workers aren't allowed to do this, as it breaks the protocol between Bazel and the worker process.
---8<---8<--- Exception details ---8<---8<---
com.google.protobuf.InvalidProtocolBufferException$InvalidWireTypeException: Protocol message tag had invalid wire type.
at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:115)
at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:551)
at com.google.protobuf.GeneratedMessageV3.parseUnknownFieldProto3(GeneratedMessageV3.java:305)
at com.google.devtools.build.lib.worker.WorkerProtocol$WorkResponse.<init>(WorkerProtocol.java:19
@conniec
conniec / notes.md
Last active March 12, 2019 00:16
Chapter 6 — Applicative and Traversable Functors

Overview

In previous chapters, we see how functors and monads allow us to sequence operations in a program using map and flatMap. Applicative functors are a related abstraction that is less powerful than monads, and are more common.

Methods that define a Functor:

def map[A,B](a: F[A])(f: A => B): F[B]
2018-06-22 18:21:20,284 DEBUG - [pool-1-thread-8 - 3796959c-e2da-4420-99ce-0d46a3f70130:] ~ Mapping vertex org.apache.atlas.repository.graphdb.janus.AtlasJanusVertex@bcb8e883 to atlas entity Referenceable.qualifiedName (EntityGraphRetriever:606)
2018-06-22 18:21:20,284 DEBUG - [pool-1-thread-8 - 3796959c-e2da-4420-99ce-0d46a3f70130:] ~ Mapping vertex org.apache.atlas.repository.graphdb.janus.AtlasJanusVertex@bcb8e883 to atlas entity Asset.name (EntityGraphRetriever:606)
2018-06-22 18:21:20,285 DEBUG - [pool-1-thread-8 - 3796959c-e2da-4420-99ce-0d46a3f70130:] ~ Mapping vertex org.apache.atlas.repository.graphdb.janus.AtlasJanusVertex@bcb8e883 to atlas entity Asset.description (EntityGraphRetriever:606)
2018-06-22 18:21:20,285 DEBUG - [pool-1-thread-8 - 3796959c-e2da-4420-99ce-0d46a3f70130:] ~ Mapping vertex org.apache.atlas.repository.graphdb.janus.AtlasJanusVertex@bcb8e883 to atlas entity Asset.owner (EntityGraphRetriever:606)
2018-06-22 18:21:20,286 DEBUG - [pool-1-thread-8 - 3796959c-e2da-4420-99ce-0d46a3f7
14:28:45.733 [kafka-streams-test-service-akka.actor.default-dispatcher-4] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
14:28:45.971 [main] INFO o.apache.kafka.streams.StreamsConfig - StreamsConfig values:
application.id = map-function-scala-example
application.server =
bootstrap.servers = [localhost:9092]
buffered.records.per.partition = 1000
cache.max.bytes.buffering = 10485760
client.id =
commit.interval.ms = 30000
connections.max.idle.ms = 540000
import cats.data.EitherT
import cats.data.Validated
import cats.implicits._
// def ap[A, B](f: F[A => B])(fa: F[A]): F[B]
val l1: EitherT[Option, String, Int] = EitherT.left(Some("error 1"))
val r1: EitherT[Option, String, Int => String] = EitherT.right(Some(f))
val r2: EitherT[Option, String, Int] = EitherT.right(Some(10))
val f: Int => String = i => (i * 2).toString
@conniec
conniec / Cats.scala
Last active October 5, 2017 00:19
Free Monad example with Cats and Scalaz
import cats.free.Free
import cats.~>
import cats._, cats.std.all._
import cats.Functor
// https://github.com/non/cats/blob/master/docs/src/main/tut/freemonad.md
sealed trait Command[+Next]
case class Person(name: String) extends AnyVal
case class Push[Next](person: Person, next: Next) extends Command[Next]
scala> import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.ExecutionContext.Implicits.global
scala> import GetTicketsExample._
import GetTicketsExample._
scala> result
res0: scala.concurrent.Future[String] = null
scala> result.foreach(println)
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
log = [51.45,
68.35,
77.9,
85,
85.15,
@conniec
conniec / gist:3079954
Created July 10, 2012 00:07
village voice delete conv
from lfcore.conv.api import ConvAPI
def delete_conv(conv_id):
c = Conv.objects.get(pk=conv_id)
ConvAPI.delete_conv(c, c.owner, mangle=True)
delete_conv(12213921)
delete_conv(12220145)
@conniec
conniec / gist:3056989
Created July 5, 2012 23:02
disable gravatar
from lfcore.ident.api import IdentAPI
import time, datetime
def disable_gravatar(domain_name):
throttle = 0.07
start_time = datetime.datetime.now()
d = Domain.objects.get(name=domain_name)