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
#!/bin/sh | |
# | |
# Shell script that configures gnome-terminal to use solarized theme | |
# colors. Written for Ubuntu 11.10, untested on anything else. | |
# | |
# Solarized theme: http://ethanschoonover.com/solarized | |
# | |
# Adapted from these sources: | |
# https://gist.github.com/1280177 | |
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/ |
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 <stdarg.h> | |
typedef struct type_a { | |
union { | |
double f; | |
void *p; | |
int i; | |
short sym; | |
} value; |
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
$ clang stack-manipulation.c | |
$ ./a.out | |
Entering stack_manipulate_func, level: 0 | |
Setjmp normal execution path, level: 0 | |
Entering stack_manipulate_func, level: 1 | |
Perform longjmp at level 1 | |
Setjmp error execution path, level: 0 | |
Exiting stack_manipulate_func, level: 0 |
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
$ clang++ stack-manipulation-exception.cc | |
$ ./a.out | |
Entering stack_manipulate_func, level: 0 | |
Normal execution path, level: 0 | |
Entering stack_manipulate_func, level: 1 | |
Throws exception at level 1 | |
Error execution path, level: 0 | |
Exiting stack_manipulate_func, level: 0 |
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
$ clang setjmp-test.c | |
$ ./a.out | |
setjmp normal execution path, level: 0, prev_jmp: 0x0 | |
setjmp normal execution path, level: 1, prev_jmp: 0x7fff5df345f0 | |
level is 2, perform longjmp! | |
setjmp exception execution path, level: 1, prev_jmp: 0x7fff5df345f0 | |
prev_jmp is not empty, continue with longjmp! | |
setjmp exception execution path, level: 0, prev_jmp: 0x0 | |
Exiting setjmp function, level: 0, prev_jmp: 0x0 |
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
$ clang++ setjmp-cpp-test.cc | |
$ ./a.out | |
setjmp normal execution path, level: 0, prev_jmp: -1 | |
setjmp normal execution path, level: 1, prev_jmp: 0 | |
level is 2, perform longjmp! | |
setjmp exception execution path, level: 1, prev_jmp: 0 | |
prev_jmp is not empty, continue with longjmp! | |
setjmp exception execution path, level: 0, prev_jmp: -1 | |
Exiting setjmp function, level: 0, prev_jmp: -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
$ clang setjmp-twice.c | |
$ ./a.out | |
Normal execution path of first function! | |
Exception execution path of first function! | |
Exception execution path of first function! | |
Calling longjmp the second time! |
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
$ clang -O2 setjmp-twice.c | |
$ ./a.out | |
Normal execution path of first function! | |
Exception execution path of first function! | |
Exception execution path of first function! | |
Calling longjmp the second time! |
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 | |
# %% -*- ruby -*- | |
# This script adds a wrapper to emcc: when the value of -o option is an | |
# executable file without extensions(such as mrbc), we would first use | |
# emcc to generate a .js file, then adds a "#!/usr/bin/env node" line at | |
# the top, finally removes the extension and mark the file mode as | |
# executable to pretend creating a binary file. | |
WEBRUBY_ROOT = File.join(File.dirname(__FILE__), '..') |
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 <emscripten/emscripten.h> | |
void EMSCRIPTEN_KEEPALIVE c_func_calling_from_js() { | |
printf("This is a c function calling from js!"); | |
} | |
extern void js_func(); |
OlderNewer