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 Data.List (insert) | |
fst3 (x,_,_) = x | |
snd3 (_,x,_) = x | |
trd3 (_,_,x) = x | |
toTuple2Int :: String -> (Int, Int) | |
toTuple2Int s = (read $ takeWhile (/=' ') s :: Int, read $ dropWhile (==' ') $ dropWhile (/=' ') s :: Int) | |
toTupleTuple2Int :: String -> (Int, (Int, Int)) |
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
// Copyright 2004-present Facebook. All Rights Reserved. | |
/** | |
* Immutable data encourages pure functions (data-in, data-out) and lends itself | |
* to much simpler application development and enabling techniques from | |
* functional programming such as lazy evaluation. | |
* | |
* While designed to bring these powerful functional concepts to JavaScript, it | |
* presents an Object-Oriented API familiar to JavaScript engineers and closely | |
* mirroring that of Array, Map, and Set. It is easy and efficient to convert to |
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
FROM ubuntu | |
RUN apt-get install -y wget | |
RUN wget -O - http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz | tar xzf - -C /usr/local/ | |
RUN ln -s /usr/local/go/bin/go /usr/local/bin/go | |
RUN ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt | |
RUN ln -s /usr/local/go/bin/godoc /usr/local/bin/godoc |
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 <cstdio> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int H, k; | |
vector<int> houses; | |
bool possible(int w) |
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
from bs4 import BeautifulSoup | |
import urllib2 | |
def main(): | |
page = urllib2.urlopen("http://www.weersvoorspelling.nl/weer-nederland/culemborg/per-uur/8387") | |
doc = BeautifulSoup(page.read()) | |
for row in doc.find(class_='forecastTable').find_all('tr'): |
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 <cstdio> | |
using namespace std; | |
int N; | |
int number; | |
bool first; | |
int main() | |
{ |
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 <vector> | |
#include <cmath> | |
#include <cstdio> | |
using namespace std; | |
struct state | |
{ | |
int depth; | |
int parent; |
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 re | |
import copy | |
import sys | |
board = None | |
moves_done = 0 | |
columns = 0 | |
rows = 0 | |
moves = [] |
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
class Songtext | |
def refrain(*args, &block) | |
if block | |
@refrain = block | |
else | |
if args.first[0].downcase == 'x' | |
puts | |
args.first[1..-1].to_i.times do | |
@refrain.call() | |
puts |
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
mapping = { | |
'>': '++p;', | |
'<': '--p;', | |
'+': '++*p;', | |
'-': '--*p;', | |
'.': 'putchar(*p);', | |
',': '*p=getchar();', | |
'[': 'while (*p) {', | |
']': '}' | |
} |