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/pypy | |
# Change the above #! if you want to use python (slower) rather than pypy | |
import random, re, sys, math | |
from segment import segment | |
# Usage: ./crack.py ciphertext | |
# where ciphertext is (you guessed it) a plaintext file containing the | |
# ciphertext |
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
# coding=UTF8 | |
######################################################################### | |
# This class is to help sklearn to handle statistical process # | |
# Author: Joon Lim from Master of Science in Analytics at Northwestern # | |
# Date: 04.23.2013 # | |
######################################################################### | |
''' this Module is built on top of numpy and sklearn. ''' | |
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/python | |
__author__ = 'umair' | |
FONTS = ( | |
"/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf", | |
"/usr/share/fonts/truetype/droid/DroidSerif-Regular.ttf", | |
"/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf", | |
"/home/umair/Downloads/Dosis/Dosis-ExtraBold.ttf" | |
) |
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 | |
# encoding: utf-8 | |
""" | |
twitrend.py | |
""" | |
import sys | |
import os | |
import tweepy |
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 | |
""" | |
Download all the pdfs linked on a given webpage | |
Usage - | |
python grab_pdfs.py url <path/to/directory> | |
url is required | |
path is optional. Path needs to be absolute |
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
import nltk | |
with open('sample.txt', 'r') as f: | |
sample = f.read() | |
sentences = nltk.sent_tokenize(sample) | |
tokenized_sentences = [nltk.word_tokenize(sentence) for sentence in sentences] | |
tagged_sentences = [nltk.pos_tag(sentence) for sentence in tokenized_sentences] | |
chunked_sentences = nltk.batch_ne_chunk(tagged_sentences, binary=True) |
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
public static void postNewComment(Context context,final UserAccount userAccount,final String comment,final int blogId,final int postId){ | |
mPostCommentResponse.requestStarted(); | |
RequestQueue queue = Volley.newRequestQueue(context); | |
StringRequest sr = new StringRequest(Request.Method.POST,"http://api.someservice.com/post/comment", new Response.Listener<String>() { | |
@Override | |
public void onResponse(String response) { | |
mPostCommentResponse.requestCompleted(); | |
} | |
}, new Response.ErrorListener() { | |
@Override |