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 java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
/** | |
* @author mtk - Mohammed Tareque Khan | |
* More details: http://mtktechiecode.blogspot.in/2015/04/google-codejam-15-standing-ovation.html | |
* | |
* Algo description: | |
* if number of people for next shynesslevel is not zero then: |
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
public class Test { | |
public static void main(String[] args){ | |
System.out.println("Hello, World !"); | |
} | |
} |
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
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
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
In [1]: L1=[ 1, 2, 3, 4, [11, 22, 33, 44] ] | |
In [2]: L2=L1 | |
In [3]: L3=L1[:] | |
In [4]: L1, L2, L3 | |
Out[4]: | |
([1, 2, 3, 4, [11, 22, 33, 44]], |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
public class ThreadCreationTimeIncreasesWithNumberOfThreads { | |
public static void main(String[] args) { | |
long threadCreationTime = 0, noOfThreadsCreated=1; | |
while (true) { | |
long time = System.currentTimeMillis(); | |
new Thread() { | |
public void run() {} | |
}.start(); | |
time = System.currentTimeMillis() - time; | |
if (time > threadCreationTime) { |
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 nltk | |
with open('sample.txt', 'r') as f: | |
sample = f.read() | |
sentences = nltk.sent_tokenize(sample) | |
tokenized_sentences = [nltk.word_tokenize(sentence) for sentence in sentences] | |
tagged_sentences = [nltk.pos_tag(sentence) for sentence in tokenized_sentences] | |
chunked_sentences = nltk.batch_ne_chunk(tagged_sentences, binary=True) |
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 sys | |
""" | |
usage: python attribute_flattener.py [include-keys=yes] [override filename] | |
generates <file_name>.out file | |
contents are all attributes are flattened to single line per key | |
NOte: Keep attributes.csv in current folder and run | |
python attribute_flattener.py | |
""" |
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
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
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
set ts=4 | |
set sw=4 | |
set et | |
set ai | |
set hls | |
so ~/.vim/Align.vim | |
" https://github.com/tpope/vim-pathogen To install vim plugins |
OlderNewer