Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Krajč mkrajc

  • Košice, Slovakia
View GitHub Profile
@mkrajc
mkrajc / es_query.json
Last active Jul 31, 2020
Query for familyName:Malik givenName:Ranjit Singh
View es_query.json
{
"version": true,
"query": {
"function_score": {
"query": {
"bool": {
"must_not": [{
"term": {
"publisher": {
"value": "Spaactor GmbH"
@mkrajc
mkrajc / BoundedPriorityQueue.scala
Created Mar 25, 2020
Scala BoundedPriorityQueue
View BoundedPriorityQueue.scala
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
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
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
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;
You can’t perform that action at this time.