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 | |
import fileinput | |
import argparse | |
from operator import itemgetter | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int) | |
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+') | |
args = parser.parse_args() |
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
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls | |
smtpserver = smtp.gmail.com |
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 subprocess | |
def print_shell_command(cmd): | |
## run it ## | |
p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE) | |
while True: | |
out = p.stderr.read(1) | |
if out == '' and p.poll() != None: | |
break |
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
/* | |
struct ListNode { | |
int val; | |
ListNode* next; | |
}; | |
*/ | |
/** | |
* return the nth node from the end of the list | |
* in O(N) time, O(1) space |
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
/* | |
* ===================================================================================== | |
* | |
* Filename: reverse_string_stl.cpp | |
* | |
* Description: | |
* | |
* Version: 1.0 | |
* Created: 03/04/2015 09:49:47 AM | |
* Revision: none |
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
/* | |
* ===================================================================================== | |
* | |
* Filename: graph_traversals.cpp | |
* | |
* Description: | |
* | |
* Version: 1.0 | |
* Created: 06/03/2015 02:55:12 PM | |
* Revision: none |
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
/* | |
* ===================================================================================== | |
* | |
* Filename: 290_div2_B_fox_and_two_dots.cpp | |
* | |
* Description: 290_div2_B_fox_and_two_dots.cpp | |
* http://codeforces.com/contest/510/problem/B | |
* | |
* Version: 1.0 | |
* Created: 06/03/2015 12:32:31 PM |
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
/* | |
* ===================================================================================== | |
* | |
* Filename: IA_dijkstra.cpp | |
* | |
* Description: http://www.infoarena.ro/problema/dijkstra | |
Graful este orientat. | |
* | |
* Version: 1.0 | |
* Created: 06/21/2015 13:13:34 |
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
/* | |
* ===================================================================================== | |
* | |
* Filename: merge_k_sorted_lists_with_heap.cpp | |
* | |
* Description: https://leetcode.com/submissions/detail/29638723/ | |
* | |
* Version: 1.0 | |
* Created: 06/08/2015 03:07:49 PM | |
* Revision: none |
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
@Override | |
protected TokenStreamComponents createComponents(String fieldName) | |
{ | |
final Tokenizer source = new StandardTokenizer(); | |
TokenStream tokenStream = source; | |
tokenStream = new StandardFilter(tokenStream); | |
tokenStream = new LowerCaseFilter(tokenStream); | |
tokenStream = new StopFilter(tokenStream, getStopwordSet()); |