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 up slime-js | |
;; | |
;; To install, see https://github.com/swank-js/swank-js/wiki/Installation | |
;; | |
;; This is what I did: | |
;; | |
;; npm install swank-js -g | |
;; M-x package-install slime-js | |
;; | |
;; The slime-js version in marmalade requires swank 2010.04.04, or at least |
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> | |
#include <x86intrin.h> | |
int main(int argc, char** argv) { | |
__v16si a = {1,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0}; | |
__v16si b = {9,10,11,12,13,14,15,16,1,1,1,1,1,1,1,1}; | |
__v16si c; | |
c = a+b; |
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
AC_DEFUN_ONCE([_AX_GCC_X86_CPU_INIT], | |
[AC_LANG_PUSH([C]) | |
AC_CACHE_CHECK([for gcc __builtin_cpu_init function], | |
[ax_cv_gcc_check_x86_cpu_init], | |
[AC_RUN_IFELSE( | |
[AC_LANG_PROGRAM([#include <stdlib.h>], | |
[__builtin_cpu_init ();]) | |
], | |
[ax_cv_gcc_check_x86_cpu_init=yes], | |
[ax_cv_gcc_check_x86_cpu_init=no])]) |
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
(require 'package) | |
(setq package-archives | |
'(("org" . "http://orgmode.org/elpa/") | |
("gnu" . "http://elpa.gnu.org/packages") | |
("marmalade"."http://marmalade-repo.org/packages/") | |
("melpa"."http://melpa.org/packages/"))) | |
(package-initialize) | |
(defun ensure-package-installed (&rest packages) | |
"Download the package if it were not installed" |
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 <sys/mman.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stddef.h> | |
int main() | |
{ | |
ptrdiff_t offset = 1L << 36; | |
void* addr = NULL + offset; | |
void* map_addr; |
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
// gcc -O2 -Wall -pthread tls_bench.c -o tls_bench | |
// ./tls_bench <num_threads> <loop> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <pthread.h> | |
#include <assert.h> | |
#include <stdatomic.h> | |
__thread int tls = -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 <stdlib.h> | |
#include <stdio.h> | |
#include <pthread.h> | |
#include <stdatomic.h> | |
#include <stdbool.h> | |
static atomic_bool lock = false; | |
static volatile int counter = 0; | |
void* thread_start(void *arg) |
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
typedef enum GenericType GenericType; | |
typedef struct A A; | |
typedef struct B B; | |
enum GenericType | |
{ | |
TYPE_A = 0, | |
TYPE_B = 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
heap->occupy_bmap[0] = 0x01; | |
/* becomes | |
598 .loc 2 134 3 is_stmt 1 ## lookup_helper_test.c:134:3 | |
599 leaq 72(%r13), %rsi | |
600 .loc 2 134 24 is_stmt 0 ## lookup_helper_test.c:134:24 | |
601 movq $1, -56(%rbp) | |
602 leaq -56(%rbp), %rdx | |
603 movl $8, %edi | |
604 movl $5, %ecx |
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
# Install homebrew | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
# Install python and nodejs | |
brew install python3 | |
brew install nodejs | |
# Install python packages | |
pip3 install numpy | |
pip3 install scipy |