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
template <typename T> | |
class foo {}; | |
int main() { | |
foo<1> x; | |
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
#!/usr/bin/env python | |
import sys | |
import threading | |
import os | |
class MyThread(threading.Thread): | |
def run(self): | |
sys.exit(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
#include <execinfo.h> | |
#include <sys/time.h> | |
#include <stdio.h> | |
void foo(int i) { | |
if (i == 0) { | |
void* array[128]; | |
backtrace(array, 128); | |
} else { | |
foo(i - 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
" from http://vim.wikia.com/wiki/Highlight_unwanted_spaces | |
highlight ExtraWhitespace ctermbg=lightgray guibg=lightgray | |
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=lightgray guibg=lightgray | |
match ExtraWhitespace /\s\+$/ | |
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
autocmd InsertLeave * match ExtraWhitespace /\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
function! ResCur() | |
if line("'\"") <= line("$") | |
normal! g`" | |
return 1 | |
endif | |
endfunction | |
augroup resCur | |
autocmd! | |
autocmd BufWinEnter * call ResCur() |
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 printer.*; | |
import unix; | |
record LargeRecord ( | |
a: Array[RawPointer, 1024], | |
); | |
foo() { | |
var a = LargeRecord(); | |
// call any function that is guaranteed to be not inlined |
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 <unistd.h> | |
struct large_struct { | |
void* a[1024]; | |
}; | |
static void foo() { | |
struct large_struct r; | |
// call any function that is guaranteed to be not inlined |
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 printer.*; | |
private external backtrace(array:Pointer[RawPointer], size:Int) : Int; | |
record Backtrace ( | |
callstack: Array[RawPointer, 128], | |
); | |
showBacktraceMine() { | |
var bt = Backtrace(); |
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
############################### | |
overload GenericOSError?(#GenericOSError) = true; | |
[E, I, S when GenericOSError?(E) and Integer?(I) and StringLiteral?(S)] | |
-----------------------------^ | |
overload E(code:I, #S) --> returned:E { | |
returned.code = Int(code); | |
############################### | |
/Users/yozh/devel/left/clay/lib-clay/os/errors/errors.clay(13,29): error: unholy recursion detected | |
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
# tested in zsh | |
# Don't try this at home. | |
command_not_found_handler() { | |
replaced=false | |
set -A args "$@" | |
# aliases like gcc-O2='gcc -O2' |