Skip to content

Instantly share code, notes, and snippets.

@shouyu
shouyu / gist:1360617
Created November 12, 2011 14:47
Explicit Instantiation
// program.cpp
#include <stdio.h>
template<class T> T samplefunc(T val);
int main() {
printf("%d\n", samplefunc(10));
return 0;
}
@shouyu
shouyu / limits.cpp
Created July 2, 2012 03:35
limits check
$ uname -a [/tmp]
Linux SVZ1311AJ 3.4.4-2-ARCH #1 SMP PREEMPT Sun Jun 24 18:59:47 CEST 2012 x86_64 GNU/Linux
$ ./a.out [/tmp]
2147483647
4294967295
9223372036854775807
18446744073709551615
9223372036854775807
@shouyu
shouyu / bt.patch
Created July 11, 2012 18:42
bt patch
--- a/drivers/bluetooth/ath3k.c 2012-05-21 07:29:13.000000000 +0900
+++ b/drivers/bluetooth/ath3k.c 2012-07-12 01:49:24.550019750 +0900
@@ -77,6 +77,7 @@
{ USB_DEVICE(0x04CA, 0x3005) },
{ USB_DEVICE(0x13d3, 0x3362) },
{ USB_DEVICE(0x0CF3, 0xE004) },
+ { USB_DEVICE(0x0489, 0xE04D) },
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE02C) },
@shouyu
shouyu / gist:3512134
Created August 29, 2012 13:00
dalli vs memcached
Linux SVZ1311AJ 3.5.3-1-ARCH #1 SMP PREEMPT Sun Aug 26 09:14:51 CEST 2012 x86_64 GNU/Linux
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
Ruby 1.9.2p290
Loaded memcached 1.4.3
Loaded remix-stash 1.1.3
Loaded memcache-client 1.8.5
Loaded dalli 2.1.0
PID is 20388
Loops is 50000
@shouyu
shouyu / gist:3524345
Created August 30, 2012 08:46
dalli vs memcached
LC_ALL="en_US"
application-8bf43318ff670eb80e738691da7f7cbf.css
application-8bf43318ff670eb80e738691da7f7cbf.css.gz
application.css
application.css.gz
application-e039ffd4d6f45439286c9d8efbc6b661.js
application-e039ffd4d6f45439286c9d8efbc6b661.js.gz
application.js
application.js.gz
require 'pp'
c1 = 63
r1 = 1
c2 = 100
r2 = 91
gcdr = []
gcdc = []
rems = []