This file contains hidden or 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
(setl ffip-file-exts '("py" "el")) |
This file contains hidden or 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 Base1 | |
{ | |
public: | |
Base1() { | |
m_base1 = 1; | |
} | |
virtual ~Base1() {} | |
virtual Base1* clone() | |
{ | |
return 0; |
This file contains hidden or 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
def interleave(a, b): | |
if len(a) == 0 and len(b) == 0: | |
return [] | |
elif len(a) == 0: | |
return [b] | |
elif len(b) == 0: | |
return [a] | |
first = [a[0] + s for s in interleave(a[1:], b)] | |
second = [b[0] + s for s in interleave(a, b[1:])] |
This file contains hidden or 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 | |
import sys | |
import os | |
if __name__ == '__main__': | |
for f in sys.argv[1:]: | |
os.system('mv -v %s %s.bak' % (f, f)) |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
int st[ 101 ], visited[ 101 ]; | |
int find, num, length, size; | |
int cmp( const int *f, const int *s ) | |
{ | |
if ( *f > *s ) | |
{ |
This file contains hidden or 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
def max_rect(histogram): | |
rect_stack = [] | |
result = {"max_area": 0, "range": (-1, -1)} | |
for i, h in enumerate(histogram + [0]): | |
if len(rect_stack) == 0 or rect_stack[-1][0] < h: | |
rect_stack.append((h, i)) | |
elif rect_stack[-1][0] > h: | |
while len(rect_stack) > 0 and rect_stack[-1][0] > h: | |
(last_h, last_i) = rect_stack.pop() |
This file contains hidden or 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 | |
from distutils.core import setup | |
setup(name='clang', | |
version='3.2', | |
description='libclang python bindings', | |
author='clang', | |
author_email='[email protected]', | |
url='http://clang.llvm.org', |
This file contains hidden or 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 | |
""" | |
A pre-commit hook for git that uses Pylint for automated code review. | |
If any python file's rating falls below the ``PYLINT_PASS_THRESHOLD``, this | |
script will return nonzero and the commit will be rejected. | |
This script must be located at ``$REPO/.git/hooks/pre-commit`` and be | |
executable. |
This file contains hidden or 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
The initial stack of the minix kernel when passing control from boot monitor. | |
--------- | |
addr of boot image component headers(32) | |
--------- | |
size of the array of boot parameters(32) | |
--------- | |
addr of array of boot parameters(32) | |
--------- | |
boot monitor's code segment(16) |
This file contains hidden or 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 markdown | |
def inc_header(): data = [0] | |
def fun(x, *rest): | |
header = 'toc_%d' % data[0] | |
data[0] += 1 | |
return header | |
return fun | |