Skip to content

Instantly share code, notes, and snippets.

View shkr's full-sized avatar
:shipit:
Ship it

Shashank Shekhar shkr

:shipit:
Ship it
View GitHub Profile
import cv2
# variables
# distance from camera to object(face) measured
Known_distance = 30 #centimeter
# width of face in the real world or Object Plane
Known_width =14.3
# Colors
GREEN = (0,255,0)
RED = (0,0,255)
WHITE = (255,255,255)
import logging
import os, sys
import abc
import gym
import numpy as np
import json
from os import listdir
from os.path import isfile, join
gym.scoreboard.api_key = "sk_hJMbMlYzSpSsucakOMOULg"
#!/bin/bash
# stop on error
set -e
############################################
# Dependencies
sudo apt-get install build-essential checkinstall
import org.apache.spark.sql.Column
/**
* Optimized Median calculation for a distributed dataframe built on three findings :
* 1. Real world datasets are made from low cardinality domains
* 2. Median calculation requires sort which is O(N * log N), it implies that computation time increase by a factor significantly greater than 2 for a list twice as long.
* 3. Hive UDF support only primitive data types hence in the algo the datastructure transferred to a single node is a Seq[String] instead of Seq[Struct{}]
**/
def insertMedianOnKey(inputDF: DataFrame,
key: Seq[Column],
@shkr
shkr / springer-free-maths-books.md
Created December 29, 2015 09:36 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@shkr
shkr / My global .gitignore
Last active August 29, 2015 14:06
My global .gitignore used for Python, OSX, Java, Scala, SBT, JetBrains and Play! Framework
###Python###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging