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
@_1 = -> | |
# sum of multiples of 3 or 5 (not both) under 1K | |
answer = 0 | |
for n in [1...1000] | |
if n % 3 == 0 or n % 5 == 0 | |
answer += n |
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
# ======================================================================= | |
# ======================================================================= | |
# ======================================================================= | |
# =============================================================== Info == | |
# This is also known as Bin Packing Problem | |
# http://en.wikipedia.org/wiki/Bin_packing_problem | |
# inspiration: http://www.developerfusion.com/article/5540/bin-packing/ | |
# or maybe Knapsack Problem? |
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
#======================================================================# | |
# Biologicke algoritmy (2) - Evoluční algoritmy # | |
# http://www.root.cz/clanky/biologicke-algoritmy-2-evolucni-algoritmy/ # | |
#======================================================================# | |
# | |
# hledame kruznice, ktere nejvic sedi na danou mnozinu bodu | |
# | |
# ---------------------------------------------------------- | |
# | |
# jedinec = trojice kruznic |
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
# NOTE: some of these will be 404s (30th of February, days with no comics, etc.) | |
# 404s can be removed with `find . -type f -size -1000c -iname "*.gif" -exec rm {} \;` | |
from urllib import urlretrieve | |
for y in range(2000, 2013): | |
for m in range(1, 13): | |
print "starting", y, m |
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
run: | |
erlc binary_search.erl | |
erl -noshell -s binary_search test -s init stop | |
tests: | |
python write_tests.py >binary_search_tests.erl | |
erlc binary_search_tests.erl | |
all: tests run |
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
#! /usr/bin/env python | |
# dependencies: py-gdata | |
# example usage: | |
# ./yt.py "words that have to be in title" | |
import sys | |
import gdata | |
import gdata.youtube |
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 http://www.nadineloveshenry.com/haskell/memofib.html#memoize | |
-- had some problems when function had more arguments though, so saving this for future me :) | |
import Debug.Trace | |
import Data.Map as Map | |
import Control.Monad.State.Lazy as State | |
-------------------------------------------- | |
type StateMap a b = State (Map a b) b |
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
-module(go). | |
-export([prime/3, | |
server/0, | |
server/4, | |
start/0]). | |
prime(OldTick, N, Server) -> | |
receive | |
false -> ok | |
end, |
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
sieve_sundaram = (limit) -> | |
start = 4 | |
half = limit/2 | |
numbers = (n for n in [3...limit+1] by 2) | |
steps = numbers[..] # copy of numbers | |
callback = (start_and_nums,step) -> |
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
PRAISE LIKE FIREWORKS | |
------------ | |
- první "You've given us a heart" - unisono, kluci klidně ve spodní oktávě | |
K+A+S: Gis Gis Gis Gis Gis Gis - hlavní | |
Gis Gis Gis Gis Gis | |
Gis A A A A A |
OlderNewer