Skip to content

Instantly share code, notes, and snippets.

View catleeball's full-sized avatar
🏳️‍⚧️

Cat Ball catleeball

🏳️‍⚧️
View GitHub Profile
@chokkan
chokkan / pcky.py
Created October 24, 2012 17:12
Probabilistic Cocke-Kasami-Younger (PCKY) algorithm
import collections
import math
def build(CNF):
G = collections.defaultdict(list)
for left, right, p in CNF:
G[right].append((left, math.log(p)))
return G
def show_cell(T, i, j):
@davej
davej / delete_all_tweets.py
Last active March 27, 2024 03:12
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script will delete all of the tweets in the specified account.
You may need to hit the "more" button on the bottom of your twitter profile
page every now and then as the script runs, this is due to a bug in twitter.
You will need to get a consumer key and consumer secret token to use this
script, you can do so by registering a twitter application at https://dev.twitter.com/apps
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1)