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
processor : 0 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 26 | |
model name : Intel(R) Xeon(R) CPU X5550 @ 2.67GHz | |
stepping : 5 | |
cpu MHz : 2666.760 | |
cache size : 8192 KB | |
fpu : yes | |
fpu_exception : yes |
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
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
"""Usage: ./fizzbuzz.py <filename>""" | |
def fizzbuzz(f, b, l): | |
return [(i % f == 0 and 1 or 0) * 'F' \ | |
+ (i % b == 0 and 1 or 0) * 'B' \ | |
or '%d' % i \ |
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
sudo curl -o /opt/local/etc/bash_completion.d/mercurial "http://selenic.com/hg/raw-file/cd31a1cc1521/contrib/bash_completion" | |
sudo curl -o /opt/local/etc/bash_completion.d/git "http://git.kernel.org/?p=git/git.git;a=blob_plain;f=contrib/completion/git-completion.bash;hb=HEAD" |
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
@echo off | |
REM Save this file to /path/to/python/scripts | |
python -c "from dotcloud.cli import cli;cli.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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""SRM500 - div2 - level two | |
N friends (numbered from 0 to N-1) play a game called Mafia. | |
The exact rules of the game are not important for this problem. | |
What's important is that at some point in the game they will | |
need to choose one player who will lose and leave the game. |
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 | |
# -*- coding: utf-8 -*- | |
"""SRM498 - div2 - level two | |
Fox Ciel likes sequences. One day, she invented | |
a new type of sequence and named it the fox sequence. | |
A sequence seq containing N elements is called a fox | |
sequence if and only if there exist four integers | |
a, b, c and d such that 0 < a < b <= c < d < N-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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""SRM480 - div2 - level two | |
TopCoder Security Agency (TSA, established today) is going | |
to search for dangerous content in the internet. | |
There are N candidate websites numbered 0 through N-1. Each | |
website has an address given as address[i]. It also has one |
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 | |
# -*- coding: utf-8 -*- | |
"""SRM481 - div2 - level two | |
This time, instead of solving an easy problem with a | |
known solution, you will be in charge in solving an | |
old problem with a solution which was unknown to | |
this date. The old question is whether the egg or | |
the chicken came first. This question has been very |
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 | |
# -*- coding: utf-8 -*- | |
"""SRM482 - div2 - level two | |
A hallway is filled with lockers numbered 1 through N, | |
initially all closed. Out of boredom, Dave and Earl | |
decide to open all the lockers. They make multiple | |
passes through the hallway, each beginning at locker 1. | |
On the first pass, they open the first unopened locker, |
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 | |
# -*- coding: utf-8 -*- | |
"""SRM483 - div2 - level two | |
Elly and some of her friends (possibly none) are going | |
to the movies. Their company consists of numFriends people, | |
including Elly. Since they don't want to be spread across | |
the entire hall, they decided to sit either in the same | |
row or in the same column (though not necessarily next |