View intersection.py
from random import randint
def random_array(n):
f = lambda i : randint(10, 100)
return map(f, range(n))
A = sorted(random_array(10))
B = sorted(random_array(10))
def intersection(A, B):
View chickens.cfg
//-----
//smokechickens.cfg
//-----
//Customise keybinds at the bottom of the config file
//-----
//Press [default: X] to spawn a chicken at your crosshair and make it glow so you can see it through walls.
//Press [default: Z] to kill all chickens on the map. (you monster)
//Press [default: C] to toggle the glow on the chickens.
//-----
//Known bugs:
View version 2 - bookmarklet
javascript:(function(){var user=$("meta[name='user-login']").attr('content');function removeNonFollowers(following){$("div.member_add").each(function(i,item){var actor=$(this).find("a")[0].innerHTML;if(following.indexOf(actor)<0)$(this).remove();});};var following=[];$.ajax("https://api.github.com/users/"+user+"/following").done(function(data){$.each(data,function(i,item){following.push(item.login);});removeNonFollowers(following);});setInterval(function(){removeNonFollowers(following);},1000);})();
View movie_spoiler.py
import bs4 as bs
from requests import get
from time import sleep
import sqlite3
class SpoilerDB:
def __init__(self):
self.conn = sqlite3.connect('movie_spoilers.db')
self.db = self.conn.cursor()
View invisible1v1
r_drawothermodels 0
sv_cheats 1
sv_infinite_ammo 2
ammo_grenade_limit_total 5
mp_warmup_end
mp_freezetime 0
mp_roundtime 3
mp_roundtime_defuse 3
mp_limitteams 0
mp_autoteambalance 0
View new_gist_file_0
// Server config
sv_cheats 1
mp_limitteams 0
mp_autoteambalance 0
mp_roundtime 60
mp_roundtime_defuse 60
mp_maxmoney 60000
mp_startmoney 60000
mp_freezetime 0
mp_buytime 9999
View Laser-Maze-Solution.java
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
View Lazer-Maze.md

#Laser Maze

###55 points

Standard mazes lose their mystery as one grows older. But throw in some lasers, and suddenly you've got yourself a recipe for cross-generational appeal. The object in any maze is to find your way from your starting point to some goal. In a Laser Maze you must additionally contend with laser turrets.

A laser turret is a stationary pillar that both blocks your movement and fires lasers from one side. Every time you take a step (either up, down, left, or right), every laser turret in the maze then rotates 90 degrees clockwise, and then shoots a momentary laser blast in the direction that it is facing. Needless to say, if you find yourself in the path of one of these lasers, you won't be around long enough to find a way out. A wall is a stationary pillar that blocks your movement, but does not fire lasers.

Lasers are powerful, but they do not pass through walls or laser turrets. The laser turrets respond to your movements, so you can't stand still and wait for the turrets to turn. If

View New-Year-Resolution-Solution.java
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
View New-Year-Resolution.md

#New Year's Resolution

###30 points

Alex's New Year's resolution for 2015 is to eat healthier foods. He's done some research and has found out that calories come from three main sources, called macronutrients: protein, carbohydrates, and fat. Alex wants to get the right balance of protein, carbohydrates, and fat to have a balanced diet. For each available food, Alex can only choose to eat it or not eat it. He can't eat a certain food more than once, and he can't eat a fractional amount of a food.

###Input

Input begins with an integer T, the number of test cases. For each test case, the first line consists of three space-separated integers: GP, GC, and GF, which represent the amount of protein, carbohydrates, and fat that Alex wants to eat. The next line has the number of foods for that test case, an integer N. The next N lines each consist of three space-separated integers: P, C, and F, which represent the amount of protein, carbohydrates, and fat in that food, respectively.