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
.magic { | |
background: linear-gradient(0deg, #888 0%, #444 100%); | |
border-radius: 100%; | |
height: 300px; | |
left: 0; | |
margin: 25px; | |
position: absolute; | |
top: 0; | |
transition: width 0.25s, height 0.25s, top 0.25s, left 0.25s; | |
width: 300px; |
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
function findLargestRectangle(hist) { | |
var h, pos; | |
var tempH, tempPos; | |
var hStack = []; | |
var posStack = []; | |
var maxSize = -Infinity; | |
var tempSize = 0; | |
function popThatShit() { | |
tempH = hStack.pop(); |
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
function findBestFittingSubrange( | |
original, replacement) { | |
var ii; | |
var jj; | |
var distance; | |
var distanceSum; | |
var smallestDistanceSum = Infinity; | |
var smallestDistanceSumIndex; |
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 itertools | |
def findDinnerParty(friends, tableSize): | |
groups = combineFriends(friends, tableSize) | |
print "%d groups" % len(groups) | |
print groups | |
recursions = 0; | |
def combineFriends(friends, tableSize, groups=[], group=[], pos=0): | |
global recursions |
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
<?php | |
$calendar = array( | |
array(1, 2, 'a'), | |
// These two conflict | |
array(2, 4, 'b'), | |
array(3, 5, 'c'), | |
array(6, 8, 'd'), |
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 <vector> | |
using namespace std; | |
void print(const vector<int>& vec) { | |
vector<int>::const_iterator it = vec.begin(); | |
while(it < (vec.end() - 1)) { | |
cout << *it << ','; | |
advance(it, 1); | |
} |
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
A | |
/ \ | |
B C | |
/ \ | |
D E | |
\ | |
F |