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
//suhas sg | |
//[email protected] | |
//http://www.spoj.pl/problems/ONP/ | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
bool isChar(char a) { | |
a = int(a); |
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
#include <iostream> | |
#include <string> | |
#define OVERFLOW 2 | |
#define ROW b_len | |
#define COL a_len+b_len+OVERFLOW | |
using namespace std; | |
int getCarry(int num) { | |
int carry = 0; |
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
// Suhas SG | |
// http://suhas.co | |
// INPUT: | |
// T - test cases followed by T lines of a number n. | |
// OUTPUT: | |
// Factorial of each n, in that order. | |
#include <iostream> | |
#include <string> | |
#define OVERFLOW 2 |
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 nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" " alternatively, pass a path where Vundle should install plugins | |
" "call vundle#begin('~/some/path/here') | |
" | |
" " let Vundle manage Vundle, required |
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
### Keybase proof | |
I hereby claim: | |
* I am jargnar on github. | |
* I am suhas (https://keybase.io/suhas) on keybase. | |
* I have a public key whose fingerprint is 2D74 46F7 A8D9 351C 5ADE 8318 2568 336C 3487 B687 | |
To claim this, I am signing this object: |
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
''' | |
Get all primes till N (using Sieve of Eratosthenes) | |
The MIT License (MIT) | |
Copyright (c) 2016 Suhas S G <[email protected]> | |
''' | |
import math | |
def primes(n): |
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 options and add mapping such that Vim behaves a lot like MS-Windows | |
" | |
" Maintainer: Bram Moolenaar <[email protected]> | |
" Last change: 2012 Jul 25 | |
" bail out if this isn't wanted (mrsvim.vim uses this). | |
if exists("g:skip_loading_mswin") && g:skip_loading_mswin | |
finish | |
endif |
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 nocompatible | |
source $VIMRUNTIME/mswin.vim | |
behave mswin | |
filetype off | |
set rtp+=$HOME/vimfiles/bundle/Vundle.vim/ | |
call vundle#begin('$HOME/vimfiles/bundle/') | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'scrooloose/nerdtree' |
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
''' | |
Get all function calls from a python file | |
The MIT License (MIT) | |
Copyright (c) 2016 Suhas S G <[email protected]> | |
''' | |
import ast | |
from collections import deque | |
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 ast | |
class RemoveMethod(ast.NodeTransformer): | |
''' | |
Removes all occurences of a method from the AST | |
Example: | |
--- | |
tree = RemoveMethod('bar').visit(tree) | |
x = foo.bar() => x = foo |
OlderNewer