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
class Program | |
{ | |
/* The triangle */ | |
static int[][] triangle = null; | |
/* Saves respective optimal sums of nodes in the triangle */ | |
static int[][] optimalSums = null; | |
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
from itertools import chain | |
intersection = [] | |
sets = [[0,4,5,2,1],[1,3,6,2,4],[4,1,2,5,7,0]] | |
merged = list(chain.from_iterable(sets)) | |
merged.sort() |
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
String.prototype.format = function() | |
{ | |
var args = arguments; | |
return this.replace(/{(\d+)}/g, function(match, number) | |
{ | |
return typeof args[number] != 'undefined'? args[number]:match; | |
}); | |
}; |
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
# Parses each string patterns to list of strings and lists(options) | |
def parse_patterns(patterns): | |
lines = [] | |
def getclosing(i,pattern): | |
for x in xrange(i,len(pattern)): | |
if pattern[x] == ")": | |
return x | |
return -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
/* Tomorrow Night Eighties Theme */ | |
/* Original theme - https://github.com/chriskempson/tomorrow-theme */ | |
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ | |
/* Edited by Ayman Farhat(http://aymanfarhat.com) for supporting inline code tags without pre */ | |
.tomorrow-comment, code .comment, code .title { | |
color: #999999; | |
} | |
.tomorrow-red, code .variable, code .attribute, code .tag, code .regexp, code .ruby .constant, code .xml .tag .title, code .xml .pi, code .xml .doctype, code .html .doctype, code .css .id, code .css .class, code .css .pseudo { | |
color: #f2777a; |
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
function urlObject(options) { | |
"use strict"; | |
/*global window, document*/ | |
var url_search_arr, | |
option_key, | |
i, | |
urlObj, | |
get_param, | |
key, |
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
/** JS of the index **/ | |
(function(){ | |
var data = $('#dev_list').html(); | |
for(var i = 0; i < 10; i++) | |
$("#dev_list").append(data); | |
/* Tab swiping init and next/prev functions */ |
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
def get_total(n,p): | |
if n < p: | |
return 0 | |
elif n == p: | |
return 1 | |
else: | |
return 1 + get_total(n-2,p) | |
n = int(raw_input("money:")) |
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 re | |
import random | |
# Load the file into a graph represented by a dict of lists | |
def load_graph(): | |
g = {} | |
f = open('kargerMinCut.txt') | |
lines = f.readlines() | |
f.close() |
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
f = open('input.txt') | |
lines = f.readlines() | |
lines = list(map(lambda x: int(x.strip()), lines)) | |
f.close() | |
d = {} | |
found = {} | |
for line in lines: | |
if line in d: |
OlderNewer