Skip to content

Instantly share code, notes, and snippets.

View ijuma's full-sized avatar

Ismael Juma ijuma

View GitHub Profile
@ijuma
ijuma / gist:11222642
Last active August 29, 2015 14:00
git
object SolrClient {
object Response {
// This was fine in 2.10, but had to be renamed in 2.11
def apply[T](queryResponse: QueryResponse, page: Page)(documentsMapper: SolrDocument => T = identity[SolrDocument] _): Response[T] = ...
}
case class Response[T](
println("head: " + events.sortBy(d => d.importedAt.desc).map(_.importedAt).run.head)
println("firstOption: " + events.sortBy(d => d.importedAt.desc).map(_.importedAt).first)
println("run: " + events.map(_.importedAt).sortBy(_.desc).take(1).first)
Output in 2.1.0-M1:
head: 1394563161061
firstOption: 1394116251466
run: 1394563161061
In 2.0.1, all of them print "1394563161061"
method ValidationFlatMapDeprecated in object Validation is deprecated: flatMap does not accumulate errors, use `scalaz.\/` or `import scalaz.Validation.FlatMap._` instead
view-source:http://graffiti.internal.timeout.com/public/v1/sites/us-lasvegas/search?when=today&locale=en-US
{"meta":{"url":"http://graffiti.internal.timeout.com/public/v1/sites/us-lasvegas/search?when=today&locale=en-US","total_items":40,"page":{"number":1,"size":10,"next_url":"http://graffiti.internal.timeout.com/public/v1/sites/us-lasvegas/search?when=today&locale=en-US&page_number=2&page_size=10"},"sort":"relevance"},"body":[{"categorisation":{"primary":{"name":"Film","concept":{"name":"film genres"}},"secondary":{"name":"Drama","concept":{"name":"drama"}}},"uid":"Content-Film-156539","id":"156539","name":"Boyhood","description":"Looking at it one way, Boyhood represents a spectacularly cheap way of saving on actors’ salaries: To capture his rambling yet absorbing Texas family drama,...","type":"film","url":"http://graffiti.internal.timeout.com/public/v1/sites/us-lasvegas/films/156539?locale=en-US","has_offer":false,"image_url":"http://media.timeout.com/images/101611109/image.jpg","image":{"id":101611109,
~/d/p/doobie git:master ❯❯❯ sbt clean test ✱ ◼
[info] Loading project definition from /Users/jumajuma/dev/projects/doobie/project
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
[info] Set current project to doobie (in build file:/Users/jumajuma/dev/projects/doobie/)
[warn] Credentials file /Users/jumajuma/.bintray/.credentials does not exist
[warn] Credentials file /Users/jumajuma/.bintray/.credentials does not exist
~/d/p/doobie git:master ❯❯❯ sbt clean test ✱ ◼
[info] Loading project definition from /Users/jumajuma/dev/projects/doobie/project
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
Missing bintray credentials /Users/jumajuma/.bintray/.credentials. Some bintray features depend on this.
[info] Set current project to doobie (in build file:/Users/jumajuma/dev/projects/doobie/)
[warn] Credentials file /Users/jumajuma/.bintray/.credentials does not exist
[warn] Credentials file /Users/jumajuma/.bintray/.credentials does not exist
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
JDK 7u80: 142 MB/s
JDK 8u60: 160 MB/s
OpenSSL: 431 MB/s
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
JDK 7u80: Not supported
JDK 8u60: 45 MB/s (it will improve once JDK-8046943 is done)
OpenSSL: 815 MB/s
@ijuma
ijuma / FastMathTestPerformance.java
Created February 23, 2011 13:17
Modified from the version in Commons Math to fix some micro-benchmarking problems.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
[ijuma@localhost]~/src/xsbt% sbt update "project Launcher" proguard "project Simple Build Tool" "publish-local"
Getting Scala 2.7.7 ...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
4 artifacts copied, 0 already retrieved (11409kB/268ms)
Getting org.scala-tools.sbt sbt_2.7.7 0.7.4 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
15 artifacts copied, 0 already retrieved (4096kB/182ms)
[info] Recompiling project definition...
@ijuma
ijuma / gist:976802
Created May 17, 2011 16:32
IDEA JVM settings
-Xms128m
-Xmx1024m
-server
-XX:MaxPermSize=250m
-ea
-XX:+TieredCompilation
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:ReservedCodeCacheSize=96m