Skip to content

Instantly share code, notes, and snippets.

@elben
elben / understanding-transducers.clj
Last active February 14, 2021 10:55
Understanding Transducers. See README below.
(ns my-transducers.core
(:require [clojure.core.async :as async]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Understanding Transducers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This is the source code for the blog post Understanding Transducers, found
;; here: http://elbenshira.com/blog/understanding-transducers
;;
@elben
elben / snake-nibbles.bas
Created October 5, 2012 05:36
The first program I saw my in my life. And it changed my life.
'
' Q B a s i c N i b b l e s
'
' Copyright (C) Microsoft Corporation 1990
'
' Nibbles is a game for one or two players. Navigate your snakes
' around the game board trying to eat up numbers while avoiding
' running into walls or other snakes. The more numbers you eat up,
' the more points you gain and the longer your snake becomes.
'
@elben
elben / README.md
Last active May 8, 2016 12:40
Using core.async for Producer-consumer Systems

Using core.async for Producer-consumer Systems

# Set up input file
repeat 10000 echo "." >> input

# Run inline
time lein run inline < input > output

# Run async
/ .*(?:#{shard}).* /i
stub_request(:get, 'https://graph.facebook.com/search').with(:query => hash_including({"query" => "mytestquery"})).to_return(:body => "{}")
///////////////////
TypeError: can't convert RR::WildcardMatchers::HashIncluding into String
webmock (1.8.7) lib/webmock/request_pattern.rb:97:in `+'
webmock (1.8.7) lib/webmock/request_pattern.rb:97:in `add_query_params'
webmock (1.8.7) lib/webmock/request_pattern.rb:135:in `add_query_params'
import org.specs2._
class HelloWorldSpec extends Specification { def is =
"This is a specification to check the 'Hello world' string" ^
p^
"The 'Hello world' string should" ^
"contain 11 characters" ! e1^
"start with 'Hello'" ! e2^
"end with 'world'" ! e3^
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:55404,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath /Applications/IntelliJ IDEA 10 CE.app/lib/idea_rt.jar:/Applications/IntelliJ IDEA 10 CE.app/plugins/junit/lib/junit-rt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Cla
diff --git a/src/lucandra/IndexReader.java b/src/lucandra/IndexReader.java
index e88e789..5596b87 100644
--- a/src/lucandra/IndexReader.java
+++ b/src/lucandra/IndexReader.java
@@ -34,6 +34,7 @@ import com.google.common.collect.MapMaker;
import org.apache.cassandra.db.*;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
import org.apache.log4j.Logger;
WARN 13:55:38,450 Error reading a field from document : SolrDocument[{id=134336550594031616, order=134336553672511488}]
java.lang.NullPointerException
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:52)
at java.nio.ByteBuffer.wrap(ByteBuffer.java:350)
at org.apache.solr.schema.BinaryField.toObject(BinaryField.java:60)
at org.apache.solr.schema.BinaryField.toObject(BinaryField.java:31)
at org.apache.solr.response.BinaryResponseWriter$Resolver.getDoc(BinaryResponseWriter.java:148)
at org.apache.solr.response.BinaryResponseWriter$Resolver.writeDocList(BinaryResponseWriter.java:122)
at org.apache.solr.response.BinaryResponseWriter$Resolver.resolve(BinaryResponseWriter.java:86)
at org.apache.solr.common.util.JavaBinCodec.writeVal(JavaBinCodec.java:144)
➜ snowflake git:(master) ✗ sbt update
[info] Standard project rules 0.11.6 loaded (2011-03-21).
[info] Building project snowflake 1.0 against Scala 2.8.1
[info] using SnowflakeProject with sbt 0.7.4 and Scala 2.7.7
[info]
[info] == update ==
[warn] Host download.java.net not found. url=http://download.java.net/maven/2/com/twitter/util-core/1.8.1/util-core-1.8.1-sources.jar
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] Host download.java.net not found. url=http://download.java.net/maven/2/com/twitter/util-core/1.8.1/util-core-1.8.1-javadoc.jar
[info] You probably access the destination server through a proxy server that is not well configured.