This file contains hidden or 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 java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.HashSet; | |
| import java.util.Hashtable; | |
| import java.util.Iterator; | |
| import java.util.List; | |
| import java.util.Map; |
This file contains hidden or 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
| " An example for a vimrc file. | |
| " | |
| " Maintainer: Bram Moolenaar <[email protected]> | |
| " Last change: 2008 Dec 17 | |
| " | |
| " To use it, copy it to | |
| " for Unix and OS/2: ~/.vimrc | |
| " for Amiga: s:.vimrc | |
| " for MS-DOS and Win32: $VIM\_vimrc | |
| " for OpenVMS: sys$login:.vimrc |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # An example hook script to verify what is about to be committed. | |
| # Called by "git commit" with no arguments. The hook should | |
| # exit with non-zero status after issuing an appropriate message if | |
| # it wants to stop the commit. | |
| # | |
| # To enable this hook, rename this file to "pre-commit". | |
| find . \( ! -regex '.*/\..*' \) -and -iname '*~' -exec rm {} \; |
This file contains hidden or 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
| # | |
| # /etc/makepkg.conf | |
| # | |
| ######################################################################### | |
| # SOURCE ACQUISITION | |
| ######################################################################### | |
| # | |
| #-- The download utilities that makepkg should use to acquire sources | |
| # Format: 'protocol::agent' |
This file contains hidden or 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/python2 | |
| # -*- coding: utf-8 -*- | |
| import random,nltk,string,itertools | |
| from nltk.corpus import stopwords | |
| from nltk.corpus import movie_reviews | |
| from nltk.corpus.reader.plaintext import CategorizedPlaintextCorpusReader | |
| from nltk.stem.porter import PorterStemmer | |
| web_words = ['www','http','ftp','com','html','org'] | |
| eng_stopwords = stopwords.words('english') | |
| stemmer = PorterStemmer() |
This file contains hidden or 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
| #!/bin/bash | |
| args=("$@") | |
| GRAPHS="\"< sed 's/^/$#\t/g' '${args[$i]}'\" using 2:1 title \"Posts\" with lp" | |
| for ((i=1; i < ${#}; i++)) { | |
| j=`echo $# - $i | bc` | |
| GRAPHS="$GRAPHS, \"< sed 's/^/$j\t/g' '${args[$i]}'\" using 2:1 title \"${args[$i]}\" with lp" | |
| } |
This file contains hidden or 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
| :-lib(ic). | |
| :-lib(branch_and_bound). | |
| search(Students,Projects,Ranks,Capacity,Assignments,Cost) :- | |
| minimize( | |
| ( | |
| delete(_,Projects,Projects1), | |
| delete(_,Projects1,RemainingProjects), | |
| writeln(RemainingProjects), |
This file contains hidden or 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 ConfigParser | |
| from collections import namedtuple | |
| sections = ['dirs'] | |
| def subconf(section): | |
| Conf = namedtuple(section,(k for k,_ in c.items(section))) | |
| conf = Conf(**dict(c.items(section))) | |
| return conf | |
| c = ConfigParser.RawConfigParser(allow_no_value=True) | |
| c.readfp(open('config','r')) | |
| PConf = namedtuple('Configuration',sections) |
This file contains hidden or 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
| ''' | |
| Created on Sep 24, 2012 | |
| @author: shawn | |
| ''' | |
| import __builtin__ | |
| _open = __builtin__.open | |
| def marked_open(*params): | |
| global _open | |
| print "Opening file with marked_open", params[1] |
This file contains hidden or 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 cPickle as pickle | |
| class pickled_globals(object): | |
| def __init__(self,pg_dir): | |
| self.pg_dir = pg_dir | |
| def __getattr__(self, attr_name): | |
| """ | |
| Loads the file from pg_dir into an object, | |
| then caches the object in memory. | |
| """ | |
| obj = pickle.load(open('%s/%s'%(self.pg_dir,attr_name),'rb')) |