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/ruby | |
| files = Dir["**/*.h"] + Dir["**/*.cc"] + Dir["**/*.hh"] | |
| lic = {} | |
| files.each do |fn| | |
| # puts "fn: #{fn.inspect}" | |
| lines = IO.readlines(fn) | |
| if lines.empty? |
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
| // -*- mode: C++; indent-tabs-mode: t; c-basic-offset: 8 -*- | |
| // | |
| // -- running on self-built 52 | |
| // # ./collation_test | |
| // running memcmp("00000001", "00000023"): 5.6 ns | |
| // running icu_cs("00000001", "00000023"): 508 ns | |
| // running icu_d("00000001", "00000023"): 78.3 ns | |
| // running icu_du("00000001", "00000023"): 94.5 ns | |
| // running memcmp("00000001", "00300023"): 6.2 ns | |
| // running icu_cs("00000001", "00300023"): 260 ns |
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 <stdlib.h> | |
| #include <unistd.h> | |
| int allocs_count = 16384; | |
| int alloc_min = 1024 * 1024; | |
| int alloc_max = 1024 * 1024 * 128; |
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 <stdlib.h> | |
| #include <stdio.h> | |
| /* note: much of tsx code was stolen from glibc */ | |
| /* Official RTM intrinsics interface matching gcc/icc, but works | |
| on older gcc compatible compilers and binutils. | |
| We should somehow detect if the compiler supports it, because | |
| it may be able to generate slightly better code. */ |
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
| #define _GNU_SOURCE | |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <sys/time.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'restclient' | |
| require 'nokogiri' | |
| require 'active_support/core_ext' | |
| require 'uri/http' | |
| def get!(url) | |
| RestClient::Request.execute(:method => :get, :url => url) |
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
| set $mem = malloc(1048576) | |
| p $mem | |
| set language c++ | |
| call MallocExtension::instance()->GetStats($mem, 1048575) | |
| set $fd = open("/tmp/malloc-stats", 512 + 64 + 1, 0644) | |
| call write($fd, $mem, memchr($mem, 0, 1048575) - $mem) | |
| call close($fd) | |
| call free($mem) |
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
| ;; https://github.com/alk/elisp-regex-dsl | |
| (require 'regex-dsl) | |
| ;;; http://cvs.savannah.gnu.org/viewvc/*checkout*/emacs/lisp/json.el?root=emacs | |
| (require 'json) | |
| (setq *alk-membase-default-host* "Administrator:asdasd@lh:9000") | |
| (setq *alk-membase-host-split-re* (redsl-to-regexp '(concat (line-begin) | |
| (\? (concat (cap-group (literal ".*?")) | |
| (\? (concat ":" (cap-group (literal ".*?")))) | |
| "@")) |
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
| var AmbTest = TestCase("AmbTest"); | |
| AmbTest.prototype.testBasic = function () { | |
| function beats(ix, iy, jx, jy) { | |
| return ix == jx || Math.abs(ix-jx) == jy-iy; | |
| } | |
| var result = ambRun(function (amb, fail) { | |
| var queenPos = []; | |
| for (var i = 0; i < 8; i++) { | |
| var lastPos = amb([0,1,2,3,4,5,6,7]); |
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 <stdint.h> | |
| struct KindaAtomic64 { | |
| union data_type { | |
| volatile uint64_t u64; | |
| #ifndef WORDS_BIGENDIAN | |
| struct { | |
| volatile uint32_t low; | |
| volatile uint32_t high; | |
| } u32; |