Skip to content

Instantly share code, notes, and snippets.

View Priyansh2's full-sized avatar
🎯
Focusing

Priyansh Agrawal Priyansh2

🎯
Focusing
View GitHub Profile
@racydata
racydata / clustering.ipynb
Created July 29, 2019 00:38
Clustering of pornhub videos/playlists
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pncnmnp
pncnmnp / news_corpus.txt
Last active February 5, 2024 09:59
22 years (1995 - 2017) worth of news scrapped from Wikipedia
This file has been truncated, but you can view the full file.
Current events of September 3, 1995 (1995-09-03) (Sunday) :
eBay is founded.
Current events of September 6, 1995 (1995-09-06) (Wednesday) :
NATO air strikes against Bosnian Serb forces continue, after repeated attempts at a solution to the Bosnian War fail.
Current events of September 19, 1995 (1995-09-19) (Tuesday) :
The Washington Post and The New York Times publish the Unabomber's manifesto.
Current events of September 22, 1995 (1995-09-22) (Friday) :
American millionaire Steve Forbes announces his candidacy for the 1996 Republican presidential nomination.
Current events of September 23, 1995 (1995-09-23) (Saturday) :
Argentine national Guillermo "Bill" Gaede is arrested in Phoenix, Arizona, on charges of industrial espionage. His sales to Cuba, China, North Korea and Iran are believed to have involved Intel and AMD trade secrets worth US$10–20 million.
@gyli
gyli / sort_nested_dictionary.py
Last active January 8, 2024 22:07
Sort Nested Dictionary By Key in Python
# In CPython implementation of Python 3.6, dictionary keeps the insertion order.
# From Python 3.7, this will become a language feature.
# In order to sort a dictionary by key including nested dictionary inside, we can do:
def sort_dict(item: dict):
"""
Sort nested dict
Example:
Input: {'a': 1, 'c': 3, 'b': {'b2': 2, 'b1': 1}}
Output: {'a': 1, 'b': {'b1': 1, 'b2': 2}, 'c': 3}
@fchollet
fchollet / new_stacked_rnns.py
Last active August 13, 2019 15:23
New stacked RNNs in Keras
import keras
import numpy as np
timesteps = 60
input_dim = 64
samples = 10000
batch_size = 128
output_dim = 64
# Test data.
@sayanriju
sayanriju / fontconverter.py
Created August 24, 2017 17:18
Python Scripts to convert non-unicode Bangla fonts to Unicode
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fontconverter.py
#
# Copyright 2014-17 Sayan "Riju" Chakrabarti <s26c.sayan@gmail.com>
#
# License: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@Dayjo
Dayjo / install-poppler-ubuntu.md
Last active February 20, 2024 23:49
How to install Poppler on Ubuntu

First install all these prerequisites for compiling:

sudo apt install g++ autoconf libfontconfig1-dev pkg-config libjpeg-dev libopenjpeg-dev gnome-common libglib2.0-dev gtk-doc-tools libyelp-dev yelp-tools gobject-introspection libsecret-1-dev libnautilus-extension-dev

First download the encoding files (no need to compile these) to the current working directory

wget https://poppler.freedesktop.org/poppler-data-0.4.7.tar.gz
if __name__ == "__main__":
if len(sys.argv) < 3 or len(sys.argv) > 4:
print "usage: {0} TRAIN TEST VAL".format(sys.argv[0])
sys.exit(1)
train = np.loadtxt(sys.argv[1])
test = np.loadtxt(sys.argv[2])
val = np.loadtxt(sys.argv[3])
@mbejda
mbejda / Indian-Female-Names.csv
Created November 3, 2015 15:12
Dataset of ~14,000 Indian female names for NLP training and analysis. The names have been retrieved from public records. (name,gender,race)
name gender race
shivani f indian
isha f indian
smt shyani devi f indian
divya f indian
mansi f indian
mazida f indian
pooja f indian
kajal f indian
meena f indian
@mbejda
mbejda / Indian-Male-Names.csv
Created November 3, 2015 14:27
Dataset of ~14,000 Indian male names for NLP training and analysis. The names have been retrieved from public records. (name,gender,race)
name gender race
barjraj m indian
ramdin verma m indian
sharat chandran m indian
birender mandal m indian
amit m indian
kushal m indian
kasid m indian
shiv prakash m indian
vikram singh m indian
@kartikkukreja
kartikkukreja / IterativeDeepeningAlphaBetaSearch.py
Created July 11, 2015 18:13
Iterative Deepening Alpha Beta Search
def iterativeDeepeningAlphaBeta(state, evaluationFunc):
startTime = time()
def alphaBetaSearch(state, alpha, beta, depth):
def maxValue(state, alpha, beta, depth):
val = -MaxUtility
for successor in state.getSuccessors():
val = max(val, alphaBetaSearch(successor, alpha, beta, depth))
if val >= beta: return val
alpha = max(alpha, val)