Skip to content

Instantly share code, notes, and snippets.

View wecacuee's full-sized avatar

Vikas Dhiman wecacuee

View GitHub Profile
@wecacuee
wecacuee / diff_substr.py
Created July 30, 2019 03:32
Remove common parts and keep only the differences
def common_substr(strs, return_diffs=False):
"""
>>> common_substr("abcd", "xbcd")
'bcd'
"""
strs = list(strs)
min_len = min(map(len, strs))
max_len = max(map(len, strs))
first = strs[0]
comm = type(first)()
@wecacuee
wecacuee / Makefile
Created March 25, 2016 18:13
Makefile to download, install and run VQA evaluation (and training) code https://github.com/VT-vision-lab/VQA_LSTM_CNN
.PHONY: all clean evaluate downloaddata torch
SHELL:=bash -l
########################################################################
# Makefile to download, install and run VQA evaluation (and training) code https://github.com/VT-vision-lab/VQA_LSTM_CNN
# Usage:
# make evaluate # Runs evaluation code from downloaded models
# make downloaddata # Downloads MSCOCO dataset to required directory format
# make evaluate DO_TRAINING=1 # Runs training code before evaluation
# make clean # Removes the downloaded models