This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyPhase extends PluginPhase { | |
import tpd._ | |
val phaseName = "overrider" | |
override val runsAfter = Set(Pickler.name) | |
override def transformTypeDef(tree: TypeDef)(implicit ctx: Context): Tree = | |
if tree.isClassDef && !tree.rhs.symbol.isStatic then // only look at classes & traits, not objects | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReflectionWorker extends StandardPlugin { | |
val name: String = "reflectionWorker" | |
override val description: String = "heavy-lift reflection worker" | |
def init(options: List[String]): List[PluginPhase] = | |
new ReflectionWorkerPhase :: Nil | |
} | |
class ReflectionWorkerPhase extends PluginPhase { | |
import tpd._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mcp_can.h> | |
#include <SPI.h> | |
#define lo8(x) (uint8_t)((x) & 0xFF) | |
#define hi8(x) (uint8_t)(((x)>>8) & 0xFF) | |
const int SPI_CS_PIN = 17; // CANBed V1 | |
MCP_CAN CAN(SPI_CS_PIN); // Set CS pin | |
uint8_t checkSum = 0xE2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.blocke.reflect | |
import scala.tasty.file._ | |
import scala.tasty.Reflection | |
object Main extends App { | |
val p = Person("Fred", 53) | |
ReflectClass.showInfo(p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class SpeedGraphRC(system: ActorSystem, host: String, groupId: String, topic: String) extends GraphHolder[String] { | |
val count = new LinkedBlockingQueue[Int]() | |
val flow = RunnableGraph.fromGraph(GraphDSL.create() { implicit builder: GraphDSL.Builder[akka.NotUsed] => | |
import GraphDSL.Implicits._ | |
type In = CommittableMessage[Array[Byte], String] | |
val consumerSettings = ConsumerSettings(system, new ByteArrayDeserializer, new StringDeserializer) | |
.withBootstrapServers(host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cof.kafka | |
import scala.collection.JavaConversions._ | |
import org.apache.kafka.clients.producer.{ ProducerRecord, KafkaProducer, Callback, RecordMetadata } | |
import kafka.admin.AdminUtils | |
import kafka.utils.ZkUtils | |
case class LateProducer() { | |
def populate(num: Int, host: String, topic: String) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cof.kafka | |
import org.apache.kafka.common.serialization.{ ByteArrayDeserializer, Deserializer, StringDeserializer } | |
import java.util.concurrent.LinkedBlockingQueue | |
import org.apache.kafka.common.TopicPartition | |
import org.apache.kafka.clients.consumer.{ ConsumerRebalanceListener, OffsetCommitCallback, ConsumerRecord, KafkaConsumer, OffsetAndMetadata } | |
import scala.concurrent.Promise | |
import java.util.concurrent.TimeUnit | |
import scala.collection.JavaConversions._ | |
import scala.concurrent.Await |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------- build.gradle (Project: gcm) | |
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:1.5.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object PrimaryFlow extends App { | |
implicit val system = ActorSystem() | |
implicit val materializer = ActorMaterializer() | |
val sj = ScalaJack() | |
val graph = FlowGraph.closed() { implicit builder: FlowGraph.Builder[Unit] => | |
import FlowGraph.Implicits._ | |
val in = Source(List.empty[String]) // hook this up to RabbitMQ | |
val out = Sink.foreach( (mc:Command) => println("Command:" +mc) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@e427cd230b83:/# cat /var/log/mongodb/mongodb.log | |
Tue Sep 15 00:01:55 [initandlisten] MongoDB starting : pid=12 port=27017 dbpath=/var/lib/mongodb 64-bit host=e427cd230b83 | |
Tue Sep 15 00:01:55 [initandlisten] db version v2.0.6, pdfile version 4.5 | |
Tue Sep 15 00:01:55 [initandlisten] git version: nogitversion | |
Tue Sep 15 00:01:55 [initandlisten] build info: Linux z6 3.8-trunk-amd64 #1 SMP Debian 3.8.3-1~experimental.1 x86_64 BOOST_LIB_VERSION=1_49 | |
Tue Sep 15 00:01:55 [initandlisten] options: { command: [ "run" ], config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", journal: "true", logappend: "true", logpath: "/var/log/mongodb/mongodb.log", unixSocketPrefix: "/var/run/mongodb" } | |
Tue Sep 15 00:01:55 [initandlisten] Assertion: 13651:Couldn't fsync directory '/var/lib/mongodb': errno:22 Invalid argument | |
0x5d74b3 0x5ddcd9 0x5dc3a9 0x7cc596 0x8d12c3 0x8d22d8 0x58f02c 0x7f42509b8ead 0x58f8e9 | |
/usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x23) [0x5d74b3] | |
/usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0xb9) [0x5d |
NewerOlder