DataBases: https://github.com/traildb/traildb
PipeLine: https://github.com/spotify/luigi
Batch Monitoring: https://github.com/AdRoll/batchiepatchie
/** | |
This class is used to provide following utilities in primitive array | |
1- swap elements | |
2- reverse array between startIndex and endIndex | |
3- leftRotate array by a shift | |
*/ | |
class ArrayUtil | |
{ | |
public static final boolean checkIndexOutOfRange(int[] array, int index) | |
{ |
import java.util.Comparator; | |
import java.util.PriorityQueue; | |
class RunningMedianHeaps{ | |
PriorityQueue<Integer> minHeap = new PriorityQueue<Integer>(); | |
PriorityQueue<Integer> maxHeap = new PriorityQueue<Integer>(Comparator.reverseOrder()); | |
public double getMedian() { | |
int size = minHeap.size() + maxHeap.size(); |
class HashedTrie { | |
private static class TrieNode { | |
private Map<Character, TrieNode> children; | |
boolean isLeafNode; | |
int count; | |
public TrieNode() { | |
children = new HashMap<Character, TrieNode>(); | |
count = 0; |
class ArrayTrie { | |
private static class TrieNode { | |
public static final int NUMBER_OF_CHARACTERS = 26; | |
TrieNode children []; | |
boolean isLeafNode; | |
int count; | |
public TrieNode() { | |
children = new TrieNode[NUMBER_OF_CHARACTERS]; |
class PrimeGenerator{ | |
static boolean isprime[]; | |
static List<Integer> primeList; | |
static int N = 1000000; | |
static{ | |
isprime = new boolean[N]; | |
Arrays.fill(isprime, true); | |
isprime[0] = isprime[1] = false; | |
primeList = new ArrayList<Integer>(); | |
} |
class GRID { | |
private static final int eightDirections[][] = { { -1, -1 }, { -1, 0 }, { -1, 1 }, { 0, -1 }, { 0, 1 }, { 1, -1 }, | |
{ 1, 0 }, { 1, 1 } }; | |
private static final int fourDirections[][] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } }; | |
private int rows, columns; | |
private int grid[][]; | |
private boolean visited[][]; |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.StringTokenizer; | |
class FastReader { | |
BufferedReader br; | |
StringTokenizer st; | |
public FastReader() { |
public class SegmentTree { | |
private int tree[]; | |
private int leafCount; | |
public SegmentTree(int[] array) { | |
this.leafCount = array.length; | |
int heightOfTree = (int) (Math.ceil(Math.log(leafCount)/Math.log(2))); | |
int size = 2*(int)Math.pow(heightOfTree,2) -1; | |
this.tree = new int[size]; | |
constructSTUtil(array, 0, leafCount-1, 0); | |
} |
DataBases: https://github.com/traildb/traildb
PipeLine: https://github.com/spotify/luigi
Batch Monitoring: https://github.com/AdRoll/batchiepatchie
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Nov 29 15:51:29 2017 | |
@author: hgupta | |
""" | |
import sys | |
import hashlib | |
import json |