This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shubham Agarwal, April 2017 | |
# This script converts string (sequence of characters) to a sequence of integer values of the | |
# unicode characters | |
# | |
# To run this script provide data and output file path. Also provide fileEncoding | |
# Run as: | |
# python convertTextToSequency.py --readFilePath='path/to/text/' --writeFilePath='path/to/output' | |
# Default to 'utf-8' encoding | |
# Or use --fileEncoding='utf-8' | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# based on https://github.com/google/seq2seq/blob/master/bin/tools/generate_beam_viz.py | |
import numpy as np | |
import networkx as nx | |
import pickle | |
import argparse | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 536bb852a72b1ac17dbf27a7c02b8e8ba8831439 | |
Author: shubhamagarwal92 <[email protected]> | |
Date: Thu Aug 17 09:30:26 2017 -0500 | |
Correcting file path related to input id | |
commit 19672507fa068276ea76d6cca7a07e6a78ddfac7 | |
Merge: 02f7a03 f062e43 | |
Author: shubhamagarwal92 <[email protected]> | |
Date: Thu Aug 17 09:28:31 2017 -0500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__='shubhamagarwal92' | |
""" | |
This script allows to convert excel line (space separated line) | |
to latex table line format | |
Usage: | |
Input: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wordcloud import WordCloud, STOPWORDS | |
from PIL import Image | |
import urllib | |
import requests | |
import numpy as np | |
import matplotlib.pyplot as plt | |
words = 'access guest guest apartment area area bathroom bed bed bed bed bed bedroom block coffee coffee coffee coffee entrance entry francisco free garden guest home house kettle kettle kitchen kitchen kitchen kitchen kitchen kitchenliving located microwave neighborhood new park parking place privacy private queen room san separate seperate shared space space space street suite time welcome' | |
mask = np.array(Image.open(requests.get('http://www.clker.com/cliparts/O/i/x/Y/q/P/yellow-house-hi.png', stream=True).raw)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[letter]{article} | |
\pdfoutput=1 | |
\usepackage{hyperref} | |
\hypersetup{ | |
pdfinfo={ | |
Title={title}, | |
Author={author}, | |
} | |
} | |
\usepackage{pdfpages} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sometimes we want to convert jupyter notebook to markdown or | |
# html when we want to write a blog/README | |
# Jupyter Notebook Conversion (nbconvert) comes to the rescue | |
# conda install jupyter will automatically install it | |
# Run as ./jupyter_converter.sh <filename> | |
# jupyter nbconvert --to html $1 | |
jupyter nbconvert --to markdown $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as | |
# json_beautify.sh bad_json.json beautify.json | |
# https://stackoverflow.com/questions/352098/how-can-i-pretty-print-json-in-a-shell-script | |
python -m json.tool $1 > $2 | |
# if the JSON is from an internet source such as an API, you can use | |
# curl http://my_url/ | python -m json.tool | |
# For further processing json in python, a good source | |
# https://www.dataquest.io/blog/python-json-tutorial/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This example shows for the current date. Modify it to get the day for | |
# any particular date of the format | |
# date(year, month, day) | |
from datetime import date | |
import calendar | |
def sample_date2day(): | |
my_date = date.today() | |
# my_date = date(year, month, day) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://milindpadalkar.wordpress.com/2016/03/04/installing-torch-without-root-privileges/ | |
# Install conda and create an environment 'torch-env' | |
source activate torch-env | |
conda install lua=5.2 lua-science -c alexbw |
OlderNewer