Skip to content

Instantly share code, notes, and snippets.

View mkrajc's full-sized avatar

Martin Krajč mkrajc

  • Košice, Slovakia
View GitHub Profile
@mkrajc
mkrajc / es_query.json
Last active July 31, 2020 11:38
Query for familyName:Malik givenName:Ranjit Singh
{
"version": true,
"query": {
"function_score": {
"query": {
"bool": {
"must_not": [{
"term": {
"publisher": {
"value": "Spaactor GmbH"
@mkrajc
mkrajc / BoundedPriorityQueue.scala
Created March 25, 2020 10:05
Scala BoundedPriorityQueue
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
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
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;
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;