A Pen by Pruthvi Raj on CodePen.
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 networkx as nx | |
import matplotlib.pyplot as plt | |
class Vertex: | |
def __init__(self, node): | |
self.id = node | |
self.adjacent = {} |
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 heapq | |
import math | |
numTests = int(input())+1 | |
def getminind(l): | |
return heapq.nsmallest(1, ((k, i) for i, k in enumerate(l)))[0][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 numpy as np | |
import matplotlib.pyplot as plt | |
from collections import defaultdict | |
from matplotlib import animation | |
import matplotlib.patches as patches | |
import math | |
global_R = 0 | |
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
sets = [ [0], #see this dummy set it is important, this is set_0 | |
#because initially we add -arr[0] or arr[0] to 0 | |
[10,-10], | |
[30,-10,10,-30], | |
[100,20,40,-40,60,-20,-80,0,-60,-100], | |
[60,0,20,-40,-20,-60]] | |
# my array is 1 based so ignore the zero | |
arr = [0,10,20,40,30] |
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.*; | |
import java.util.*; | |
import java.text.*; | |
import java.math.*; | |
import java.util.regex.*; | |
public class temp | |
{ | |
public static void main(String[] args) | |
{ |
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/python | |
#Depends on: https://github.com/defunkt/gist and git | |
#install them first | |
#then run python clone-all-gists.py | |
import subprocess,re | |
gists = subprocess.check_output(['gist','-l']) | |
gists = re.findall('^.*com\/(.*?)(?:\s|$)',gists,re.M) | |
for gist in gists: | |
url = 'https://gist.github.com/%s.git' % gist |
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
fd |
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
//ATOM CONFIG |
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/env python | |
#Author: Pruthvi Raj ( [email protected] ) | |
#Date: 10-March-2016 | |
import re, copy, random | |
class TicTacToe: | |
def __init__(self): | |
self.magic_square = [8, 1, 6, 3, 5, 7, 4, 9, 2] |
NewerOlder