Skip to content

Instantly share code, notes, and snippets.

View shriphani's full-sized avatar

Shriphani Palakodety shriphani

View GitHub Profile
@shriphani
shriphani / gaiaonline_forums_list.py
Created May 1, 2013 20:55
Grabs and prints a list of top-level forums on Gaia online
'''
Grab a list of Gaia Online forums
'''
import os
import re
import requests
from BeautifulSoup import BeautifulSoup, SoupStrainer
@shriphani
shriphani / cleaner.py
Created May 4, 2013 03:53
Clean text
"""
Cleaner exports a set of functions to do stemming etc.
"""
#!/usr/bin/env python
import string
from nltk.stem import porter
;(custom-set-variables
; ;; custom-set-variables was added by Custom.
; ;; If you edit it by hand, you could mess it up, so be careful.
; ;; Your init file should contain only one such instance.
; ;; If there is more than one, they won't work right.
; '(menu-bar-mode t)
; '(scheme-program-name "mzscheme")
; '(tool-bar-mode nil)
; '(widget-image-enable nil))
(custom-set-faces
import java.io.File;
import java.io.IOException;
import org.apache.lucene.codecs.*;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.*;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.util.BytesRef;
public class IndexReaderTest {
spalakod@compute-1-13 TrecFedSearch]$ wget "http://www.amazon.com/Gospel-Music/b?ie=UTF8&node=2231705011&page=3"
--2013-07-17 16:33:51-- http://www.amazon.com/Gospel-Music/b?ie=UTF8&node=2231705011&page=3
Resolving www.amazon.com... 176.32.98.166
Connecting to www.amazon.com|176.32.98.166|:80... connected.
HTTP request sent, awaiting response... 301 MovedPermanently
Location: http://www.amazon.com/Gospel-Music/b?ie=UTF8&node=2231705011 [following]
--2013-07-17 16:33:51-- http://www.amazon.com/Gospel-Music/b?ie=UTF8&node=2231705011
Connecting to www.amazon.com|176.32.98.166|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
(("C# 4.0 in a Nutshell (In a Nutshell (O'Reilly))"
"https://kindle.amazon.com/work/4-0-nutshell-in-oreilly-ebook/B0031LMNOQ/B0043D2DN2"
"Joseph Albahari, Ben Albahari")
("Cat's Cradle (Kurt Vonnegut Series)"
"https://kindle.amazon.com/work/cats-cradle-vonnegut-series-ebook/B000AGP4I2/B003XRELGQ"
"Kurt Vonnegut")
("The Communist Manifesto"
"https://kindle.amazon.com/work/the-communist-manifesto-ebook/B000AI8C7K/B000JQUHLC"
"Karl Marx, Friedrich Engels")
("The Complete Sherlock Holmes: with an introduction from Robert Ryan"
("All this responsibility at such an early age made her a bitchy flibbertigibbet."
"This was a fairly pretty girl, except that she had legs like an Edwardian grand piano."
"A chaplain’s assistant is customarily a figure of fun in the American Army. Billy was no exception. He was powerless to harm the enemy or to help his friends."
"He didn’t look like a soldier at all. He looked like a filthy flamingo."
"“Get out of the road, you dumb motherfucker.” The last word was still a novelty in the speech of white people in 1944. It was fresh and astonishing to Billy, who had never fucked anybody—and it did its job. It woke him up and got him off the road."
"The gun made a ripping sound like the opening of the zipper on the fly of God Almighty."
"A blood gutter, Billy learned, was the shallow groove in the side of the blade of a sword or bayonet."
"One of the inventions was sticking a dentist’s drill into a guy’s"
"“You stake a guy out on an anthill in the desert—see? He’s facing upward, and you put honey all
(com.cnn.www, contents, t1 - <CNN Homepage Content>)
(com.cnn.www, anchor:src-page1, t1 - target_page_link)
.
.
.
@shriphani
shriphani / gist:6127911
Last active December 20, 2015 11:59
Racket mmap
(define-cstruct _mmap_obj ([fd _int]
[loaded_size _uint32]
[content _pointer]))
(define-cstruct _wp_index ([pathname_base _pointer]
[num_segments _uint16]
[sizeof_segments _uint16]
[docid_offsets _pointer]
[segments _pointer]
[open _uint8]
#include <cstdio>
#include <cstdlib>
using namespace std;
int main(int argc, char ** argv) {
int u1;
int u2;
int tid;