This file contains hidden or 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 foo | |
import scodec.bits._ | |
import scodec._ | |
import scodec.codecs._ | |
case class Document(fields: Vector[(String, Field)]) | |
sealed trait Field | |
case class IntField(value: Int) extends Field |
This file contains hidden or 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
# note that I see *EXACT* same results as the original post with the original code. | |
# The fix below makes that not happen anymore (use snapshot mode) | |
# mongo.jar on my machine is the shipped version of 2.7.0, so same exact Java Driver of original test | |
# ( I was lead on the 2.7.0 release and did the build/release ) | |
b-mac mongodb/mongo-java-driver ‹master*› » scala -cp mongo.jar Repro.scala | |
Inserting canary... | |
Inserting test data... | |
Paging through records... | |
Spotted the canary! | |
Updating canary object... |
This file contains hidden or 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
#ruby | |
[1,2,3,4].select{ |x| x.even? } | |
#python | |
[x for x in [1,2,3,4] if not x%2] | |
#or, more norvingly | |
filter(lambda x: not x%2, [1,2,3,4]) | |
#clojure | |
(filter #(even? % ) [1 2 3 4]) |