View es_query.json
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
{ | |
"version": true, | |
"query": { | |
"function_score": { | |
"query": { | |
"bool": { | |
"must_not": [{ | |
"term": { | |
"publisher": { | |
"value": "Spaactor GmbH" |
View BoundedPriorityQueue.scala
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.merlonintelligence.commons.stream | |
import java.io.Serializable | |
import java.util | |
import java.util.PriorityQueue | |
import scala.collection.JavaConverters._ | |
object BoundedPriorityQueue { | |
// since heap does not preserve order for the elements of the same priority, | |
// each element will be wrapped together with its incremental ordinal number |
View Pangrams.scala
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 Pangrams { | |
import scala.io.StdIn | |
def main(args: Array[String]): Unit = { | |
println(isPangram(StdIn.readLine().toLowerCase())) | |
} | |
private val pangram = 67108863 | |
def isPangram(s: String): String = { | |
var i = 0 | |
var bitmask = 0 |
View RxDynamicTimer.java
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 org.mech; | |
import java.util.concurrent.TimeUnit; | |
import io.reactivex.Observable; | |
import io.reactivex.Scheduler; | |
import io.reactivex.disposables.Disposable; | |
import io.reactivex.observables.ConnectableObservable; | |
import io.reactivex.schedulers.Schedulers; |
View gist:4336016129711265217b74346dad7d9e
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 org.mech; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.Executors; | |
import io.reactivex.Observable; | |
import io.reactivex.Observer; | |
import io.reactivex.annotations.NonNull; | |
import io.reactivex.disposables.Disposable; | |
import io.reactivex.schedulers.Schedulers; |