Skip to content

Instantly share code, notes, and snippets.

View marius92mc's full-sized avatar

Marius-Constantin Melemciuc marius92mc

  • Bucharest, Romania
View GitHub Profile
#! /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()
@marius92mc
marius92mc / .gitconfig
Created December 9, 2016 18:35 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[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
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
/*
struct ListNode {
int val;
ListNode* next;
};
*/
/**
* return the nth node from the end of the list
* in O(N) time, O(1) space
/*
* =====================================================================================
*
* Filename: reverse_string_stl.cpp
*
* Description:
*
* Version: 1.0
* Created: 03/04/2015 09:49:47 AM
* Revision: none
/*
* =====================================================================================
*
* Filename: graph_traversals.cpp
*
* Description:
*
* Version: 1.0
* Created: 06/03/2015 02:55:12 PM
* Revision: none
/*
* =====================================================================================
*
* 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
/*
* =====================================================================================
*
* Filename: IA_dijkstra.cpp
*
* Description: http://www.infoarena.ro/problema/dijkstra
Graful este orientat.
*
* Version: 1.0
* Created: 06/21/2015 13:13:34
/*
* =====================================================================================
*
* 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
@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());