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
### Keybase proof | |
I hereby claim: | |
* I am drexin on github. | |
* I am drexin (https://keybase.io/drexin) on keybase. | |
* I have a public key whose fingerprint is C489 C117 BC2C E2FA 446F 607F E529 608B D444 8B81 | |
To claim this, I am signing this object: |
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
protocol Monoid { | |
func unit() -> Self | |
func append(b: Self) -> Self | |
} | |
operator infix |+| { associativity left precedence 140 } | |
func |+|<A: Monoid>(a: A, b: A) -> A { | |
return a.append(b) | |
} |
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 RefactorPuzzle { | |
case class IntRdr[+A](read: Int => A) { | |
def map[B](f: A => B): IntRdr[B] = | |
IntRdr(f compose read) | |
def flatMap[B](f: A => IntRdr[B]): IntRdr[B] = | |
IntRdr(n => f(read(n)).read(n)) | |
} | |
object IntRdr { |
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
// This actor receives AMQP messages from the connection actor | |
// and forwards them to the receiver (in my case a channel) | |
class Forwarder(receiver: ActorRef) extends Actor { | |
def receive = { | |
case AMQPMessage(deliveryTag, key, data) => | |
val connectionActor = sender | |
receiver ! Message( | |
event = data, | |
ack = true, |
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
import java.io.File | |
import language.experimental.macros | |
import scala.reflect.macros.Context | |
object Macros { | |
def LINE: Int = macro lineImpl | |
def lineImpl(c: Context): c.Expr[Int] = { | |
import c.universe._ |
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
module Foo | |
def bar(fun) | |
baz do (b) | |
fun(b) % not in scope | |
end | |
end | |
end |
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
import akka.actor._ | |
import org.jruby.Ruby | |
import org.jruby.RubyClass | |
import org.jruby.RubyModule | |
import org.jruby.RubyObject | |
import org.jruby.anno.JRubyMethod | |
import org.jruby.anno.JRubyClass | |
import org.jruby.runtime.ObjectAllocator | |
import org.jruby.runtime.ThreadContext |
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
2011-04-13 11:40:54 | |
Full thread dump Java HotSpot(TM) 64-Bit Server VM (17.1-b03 mixed mode): | |
"824137379@qtp-1281689746-12 - /rest/graph/paths/from_user/3156271/to_company/28008" prio=10 tid=0x00007f2fe27b2800 nid=0x6497 runnable [0x0000000042a01000] | |
java.lang.Thread.State: RUNNABLE | |
at java.util.concurrent.ConcurrentHashMap$Segment.get(ConcurrentHashMap.java:344) | |
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:769) | |
at org.neo4j.kernel.impl.cache.SoftLruCache.get(SoftLruCache.java:66) | |
at org.neo4j.kernel.impl.core.NodeManager.getRelForProxy(NodeManager.java:522) | |
at org.neo4j.kernel.impl.core.RelationshipProxy.getOtherNode(RelationshipProxy.java:60) |
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
2011-04-13 10:27:32 | |
Full thread dump Java HotSpot(TM) 64-Bit Server VM (19.1-b02-334 mixed mode): | |
"Attach Listener" daemon prio=9 tid=10a841000 nid=0x10d610000 waiting on condition [00000000] | |
java.lang.Thread.State: RUNNABLE | |
"Timer-6" daemon prio=5 tid=102a4a000 nid=0x10d307000 in Object.wait() [10d306000] | |
java.lang.Thread.State: TIMED_WAITING (on object monitor) | |
at java.lang.Object.wait(Native Method) | |
- waiting on <7f40a0078> (a java.util.TaskQueue) |
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
import org.neo4j.graphdb.GraphDatabaseService | |
import org.neo4j.graphdb.Node | |
import org.neo4j.server.plugins._ | |
import org.neo4j.graphalgo.GraphAlgoFactory | |
import org.neo4j.kernel.OrderedByTypeExpander | |
import org.neo4j.graphdb.RelationshipType | |
import org.neo4j.graphdb.Path | |
import org.neo4j.helpers.collection.NestingIterable | |
import org.neo4j.helpers.collection.NestingIterator | |
import collection.JavaConversions.{asJavaIterable, asScalaIterable} |
NewerOlder