Skip to content

Instantly share code, notes, and snippets.

View singhpratyush's full-sized avatar

Pratyush Singh singhpratyush

View GitHub Profile
@singhpratyush
singhpratyush / plot_kaizen_probability.py
Last active June 29, 2017 17:27
A small code to illustrate the behaviour of how KaizenHarvester from loklak server project
"""
Kaizen Harvester - https://github.com/loklak/loklak_server/blob/development/src/org/loklak/harvester/strategy/KaizenHarvester.java
loklak server project - https://github.com/loklak/loklak_server
"""
import random
from matplotlib import pyplot
m = []
@singhpratyush
singhpratyush / request_loklak.py
Last active June 14, 2017 04:50
A small script that keeps requesting random searches from a loklak instance
import os
import requests
link = 'http://api.wordnik.com/v4/words.json/randomWords?hasDictionaryDef=tru'
'e&minCorpusCount=0&minLength=5&maxLength=15&limit=1&api_key='
+ os.environ.get('WORDNIK_KEY')
loklak_host = 'http://35.188.118.126'
while True:
@singhpratyush
singhpratyush / plot_top.py
Created May 13, 2017 16:48
A program to plot output of top command, dumped in several files for different processes.
"""
This program plots output of top commands dumped in different files
"""
import sys
import numpy
from matplotlib import pyplot
def clean(line):