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 <stdio.h> | |
// first couple of triangular numbers | |
// http://en.wikipedia.org/wiki/Triangular_number | |
const int triag[] = {0, 1, 3, 6, 10, 15, 21}; | |
// returns numbers of elements in first `h` rows of pascal's triangle that are | |
// not divisible by 7 | |
// http://projecteuler.net/problem=148 | |
long not7(long h) { |
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
" pairs | |
for mapmode in [ "o", "x" ] | |
for delimiter in [ "{}", "()", "[]", "<>" ] | |
let opening = delimiter[0] | |
let closing = delimiter[1] | |
for modifier in [ "i", "a" ] | |
for trigger in [ opening, closing ] | |
execute mapmode . "noremap <silent> " . modifier . "n" . trigger . " :<C-U>normal! f" . opening . "v" . modifier . closing . "<CR>" | |
execute mapmode . "noremap <silent> " . modifier . "l" . trigger . " :<C-U>normal! F" . closing . "v" . modifier . opening . "<CR>" | |
endfor |
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
SOURCES=test.c | |
EXECUTABLE=test | |
CC=g++ | |
CFLAGS=-c -Wall | |
LDFLAGS= | |
OBJECTS=$(SOURCES:.cpp=.o) | |
all: $(SOURCES) $(EXECUTABLE) | |
run: all |
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
# https://wiki.gentoo.org/wiki/Zsh/HOWTO | |
# TODO: split in separate files like https://github.com/ivyl/zsh-config | |
autoload -U compinit | |
compinit | |
export CORRECT_IGNORE='_*' | |
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
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
java.lang.AssertionError: java.security.NoSuchAlgorithmException: MessageDigest MD5 implementation not found | |
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.X509_NAME_hash(NativeCrypto.java:188) | |
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.X509_NAME_hash_old(NativeCrypto.java:181) | |
at org.apache.harmony.xnet.provider.jsse.TrustedCertificateStore.hash(TrustedCertificateStore.java:417) | |
at org.apache.harmony.xnet.provider.jsse.TrustedCertificateStore.findCert(TrustedCertificateStore.java:377) | |
at org.apache.harmony.xnet.provider.jsse.TrustedCertificateStore.isTrustAnchor(TrustedCertificateStore.java:326) | |
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.findTrustAnchorBySubjectAndPublicKey(TrustManagerImpl.java:307) | |
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.cleanupCertChainAndFindTrustAnchors(TrustManagerImpl.java:237) | |
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:184) | |
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.che |
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
nnoremap <silent> y :<C-U>call MarkAndSetOpfunc()<CR>g@ | |
vnoremap <silent> y :<C-U>call MarkYankAndJump()<CR> | |
function! MarkAndSetOpfunc() | |
let g:save_cursor = getpos(".") | |
set opfunc=YankAndJumpBack | |
endfunction | |
function! MarkYankAndJump() | |
let g:save_cursor = getpos(".") |
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
function! Group() | |
normal! l"ry$"ly0 | |
redir => message | |
execute "silent %g/\\V" . escape(@l, '/') . "/d" | |
redir END | |
let cnt = matchstr(message, '\d\+') | |
execute "normal! ggO" . cnt . ' ' . @l . ' || ' . @r . "\<Esc>0" | |
endfunction | |
nnoremap <silent> <leader>g :call Group()<CR> |
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
# We have scroll bars in the year 2012! | |
set pagination off | |
# Attach to both parent and child on fork | |
set detach-on-fork off | |
# Stop/resume all processes | |
set schedule-multiple on |
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
nnoremap <silent> <Leader>a :set opfunc=Append<CR>g@ | |
nnoremap <silent> <Leader>i :set opfunc=Insert<CR>g@ | |
function! Append(type, ...) | |
call feedkeys("`]a", 'n') | |
endfunction | |
function! Insert(type, ...) | |
call feedkeys("`[i", 'n') | |
endfunction |
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 php | |
<?php | |
/* | |
+----------------------------------------------------------------------+ | |
| PHP Version 5 | | |
+----------------------------------------------------------------------+ | |
| Copyright (c) 1997-2010 The PHP Group | | |
+----------------------------------------------------------------------+ | |
| This source file is subject to version 3.01 of the PHP license, | | |
| that is bundled with this package in the file LICENSE, and is | |