Skip to content

Instantly share code, notes, and snippets.

name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
GLX_EXT_create_context_es2_profile, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
@takikawa
takikawa / libedit
Last active August 29, 2015 14:10
Symbols in libeditline/libedit
Symbol table '.dynsym' contains 538 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 000000000000b6d0 0 SECTION LOCAL DEFAULT 9
2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND getenv@GLIBC_2.2.5 (2)
3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND iswlower@GLIBC_2.2.5 (2)
4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND sigprocmask@GLIBC_2.2.5 (2)
5: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __snprintf_chk@GLIBC_2.3.4 (3)
6: 0000000000000000 0 FUNC GLOBAL DEFAULT UND free@GLIBC_2.2.5 (2)
7: 0000000000000000 0 FUNC GLOBAL DEFAULT UND wcscmp@GLIBC_2.2.5 (2)
optimizable to a single wrapper with B+, B-
(box/c int?)
|----------------| A+ B- |---------------|
| >-| ---------> | b' |
| | | | |
| A | | | B |
| | | | |
| | | | |
| ^-| <--------- | b = (box 3) |
|----------------| A- B+ |---------------|
@takikawa
takikawa / 01
Last active August 29, 2015 14:03
Translations of Pharo examples from https://medium.com/@svenvc/elegant-pharo-code-bb590f0856d0
#lang racket
;; 1. Get the HTML source of a web page
(require net/url)
(port->string (get-pure-port (string->url "http://www.racket-lang.org")))
Racket:
Welcome to Racket v6.0.1.3.
-> (let () (+ x 3) (define x 3) 5)
; x: variable used before its definition [,bt for context]
->
Typed Racket:
Welcome to Racket v6.0.1.3.
@takikawa
takikawa / gist:10555205
Last active August 29, 2015 13:59
Submodule + syntax state behavior
#lang racket
(require (for-syntax racket/dict syntax/id-table))
;; track stuff in this table
(begin-for-syntax
(define tbl (make-free-id-table)))
;; a binding we can use in the table
(define x 3)
@takikawa
takikawa / gist:9962841
Created April 3, 2014 21:00
Profiling hamt
Profiling results
-----------------
Total cpu time observed: 96304ms (out of 96456ms)
Number of samples taken: 1699 (once every 57ms)
(Hiding functions with self<1.0% and local<2.0%: 7 of 54 hidden)
==================================================================
Caller
Idx Total Self Name+src Local%
ms(pct) ms(pct) Callee
/* from libxcb, see license there */
int xcb_popcount(uint32_t mask)
{
uint32_t y;
y = (mask >> 1) & 033333333333;
y = mask - y - ((y >> 1) & 033333333333);
return ((y + (y >> 3)) & 030707070707) % 077;
}
<?hh
trait Foo {
abstract protected function foo() : int;
public function getVal(): int {
return $this->foo();
}
}
class MyClass {
use Foo;
#lang racket/base
(require quickcheck
typed-racket/base-env/base-types
typed-racket/base-env/base-types-extra
typed-racket/base-env/case-lambda
(for-syntax racket/base
racket/lazy-require
racket/match
racket/syntax