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 java.lang.reflect.Field; | |
import sun.misc.Unsafe; | |
public class Test { | |
private static final int N = 128 * 1024 * 1024; | |
public static void main(String[] args) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { | |
{ | |
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); |
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
snippet gobject | |
/* class: ${1:CAPITAL_CASE}, ${2:CamelCase}, ${3:lower_case}, ${4:simple_name} */ | |
/* base: ${5:G_TYPE_OBJECT}, ${6:GObject} */ | |
/* prefix: ${7:EGG} */ | |
/* ===== Header ===== */ | |
#ifndef _$1_H_ | |
#define _$1_H_ |
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 sys | |
print ''' | |
#include <stdlib.h> | |
#include <stdio.h> | |
const char *prg = "{0}"; | |
int main(int argc, char **argv) {{ | |
char *tmp = tempnam("/tmp", "hoge-"); | |
FILE *fp = fopen(tmp, "w"); | |
fprintf(fp, "%s", prg); | |
fclose(fp); |
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 <iostream> | |
template <int i> | |
struct fib { | |
static const int value = fib<i-1>::value + fib<i-2>::value; | |
}; | |
template <> | |
struct fib<0> { | |
static const int value = 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 <iostream> | |
#include <boost/mpl/range_c.hpp> | |
#include <boost/mpl/int.hpp> | |
#include <boost/mpl/plus.hpp> | |
#include <boost/mpl/fold.hpp> | |
using namespace boost; | |
int | |
main(int argc, char **argv) |
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
/* | |
* BK-tree implementation in C++ | |
* Copyright (C) 2012 Eiichi Sato | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
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
03:26:12.795292 IP6 2002:8533:5452:b:68d0:41eb:532e:7b52.52698 > 2404:6800:4004:b::6.www: Flags [S], seq 4145269032, win 65535, options [mss 1440,nop,wscale 2,nop,nop,TS val 723215303 ecr 0,sackOK,eol], length 0 | |
03:26:12.795490 IP6 2002:8533:5452:b:68d0:41eb:532e:7b52.52698 > 2404:6800:4004:b::6.www: Flags [S], seq 4145269032, win 65535, options [mss 1440,nop,wscale 2,nop,nop,TS val 723215303 ecr 0,sackOK,eol], length 0 | |
03:26:12.795494 IP6 2002:8533:5452:b:68d0:41eb:532e:7b52.52698 > 2404:6800:4004:b::6.www: Flags [S], seq 4145269032, win 65535, options [mss 1440,nop,wscale 2,nop,nop,TS val 723215303 ecr 0,sackOK,eol], length 0 | |
03:26:12.795673 IP6 2002:8533:5452:b:68d0:41eb:532e:7b52.52698 > 2404:6800:4004:b::6.www: Flags [S], seq 4145269032, win 65535, options [mss 1440,nop,wscale 2,nop,nop,TS val 723215303 ecr 0,sackOK,eol], length 0 | |
03:26:12.795677 IP6 2002:8533:5452:b:68d0:41eb:532e:7b52.52698 > 2404:6800:4004:b::6.www: Flags [S], seq 4145269032, win 65535, options [mss 1440,nop,wscale 2,nop,nop,TS val 72 |
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
#!/bin/zsh | |
int_short=0.1 | |
int_long=$(($int_short * 3)) | |
int_between_char=$(($int_short * 3)) | |
int_between_word=$(($int_short * 7)) | |
ledon() { | |
setleds +num +caps +scroll < /dev/tty7 | |
} |
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
[pid 11671] <... select resumed> ) = 1 (in [4]) | |
[pid 11731] <... write resumed> ) = 8192 | |
[pid 11671] read(4, "L\273q\f*\306\3353\17\337sCd\206/\321[\276M\320Gy\374\372\373\236\304\207,\323Y\271"..., 16384) = 16384 | |
[pid 11731] write(1, "\317g\335\351\334\357\242c\264\r\303\204\367\377]\20\371\263:\327\22%}\343\355,n<\276\314\322\305"..., 8192 <unfinished ...> | |
[pid 11671] select(7, [3 4], [3], NULL, NULL <unfinished ...> | |
[pid 11731] <... write resumed> ) = 8192 | |
[pid 11671] <... select resumed> ) = 1 (in [4]) | |
[pid 11671] read(4, "i#\264Sg\244$\276\2&+\362\360\n@\354\276\240\310\363\237\304y\301\0g\321\266\2\244\272N"..., 16384) = 16384 | |
[pid 11731] write(1, "\255fM\324\t[\256w\254\247\306\261\221*\267\32*\355Z\305^_D\213\260\341^\375!\232\rF"..., 8192 <unfinished ...> | |
[pid 11671] mremap(0x7f74db754000, 2068480, 2101248, MREMAP_MAYMOVE <unfinished ...> |
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
#!/bin/bash | |
export G_SLICE=always-malloc | |
export G_DEBUG=gc-friendly | |
valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=20 "$@" |
NewerOlder