#Cursor API
var db = new unqlite.Database('/path/to/db');
db.open(function(){
var cursor = db.cursor();
for(cursor.first(); cursor.isValid(); cursor.next()){
cursor.getKeyValue(function(err, key, value) {
...
MIN_NUM_BITS: 1024 | |
MAX_NUM_BITS: 1073741824 | |
NUM_TRIALS: 11 | |
NUM_QUERIES: 1048576 | |
ONES_RATIO: 0.5 | |
#bits hsds(get) hsds(rank) hsds(select) hsds_f(get) hsds_f(rank) hsds_f(select) | |
1024 0.00244131 0.0132391 0.0261678 0.00247951 0.0132627 0.0327091 | |
2048 0.00253885 0.0134974 0.0286714 0.00242721 0.013378 0.0313551 | |
4096 0.00243108 0.01322 0.0307464 0.002447 0.0132657 0.0299397 | |
8192 0.00264367 0.0146645 0.0412597 0.00242221 0.0132331 0.0316086 |
#include <cstdio> | |
void hexDump(const void *buf, int size) | |
{ | |
int i,j; | |
unsigned char *p = (unsigned char *)buf, tmp[20]; | |
printf("+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F| -- ASCII --\r\n"); | |
printf("--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+----------------\r\n"); | |
for (i=0; p-(unsigned char *)buf<size; i++) { | |
for (j=0; j<16; j++) { |
perl -e 'sprintf("%b",$_)=~/^(0|1(01*0)*1)+$/&&print$_,$/for 0..1e2' |
use Test::More; | |
use Config; | |
use File::Spec::Functions qw(catdir catfile rel2abs); | |
use File::Path; | |
use File::Temp qw(tempdir); | |
use File::Copy::Recursive 'dircopy'; | |
use Cwd::Guard qw(cwd_guard); | |
use Capture::Tiny qw(capture); | |
my $perl = $Config{perlpath}; |
Rate sha md5 murmur3 | |
sha 808/s -- -92% -92% | |
md5 10000/s 1138% -- -2% | |
murmur3 10204/s 1163% 2% -- |
# Check if SSE instructions are available on the machine where | |
# the project is compiled. | |
MACRO (FindSSE) | |
IF(CMAKE_SYSTEM_NAME MATCHES "Linux") | |
EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) | |
STRING(REGEX REPLACE "^.*(sse2).*$" "¥¥1" SSE_THERE ${CPUINFO}) | |
STRING(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE) |
/* NO-OP for little-endian platforms */ | |
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) | |
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ | |
# define BYTESWAP(x) (x) | |
# endif | |
/* if __BYTE_ORDER__ is not predefined (like FreeBSD), use arch */ | |
#elif defined(__i386) || defined(__x86_64) \ | |
|| defined(__alpha) || defined(__vax) | |
# define BYTESWAP(x) (x) |
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use JSON; | |
use Furl; | |
use constant { | |
METACPAN_URL => 'http://api.metacpan.org', | |
API_FAV => '/v0/favorite/_search?q=distribution:', | |
API_USER => '/v0/author/_search?q=user:', |
http://api.metacpan.org/v0/favorite/_search?q=author:HIDEAKIO&fields=user,distribution
以下のようなレスポンスが得られる。
{
"timed_out": false,