This file contains 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 'rubygems' | |
require 'nokogiri' | |
@indent = ' ' * 2 | |
@typedefs = {} | |
doc = Nokogiri::XML(File.open(ARGV[0])) | |
def get_symname(node) | |
node.xpath("attributelist/attribute[@name='sym_name']").first['value'] |
This file contains 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
module GL | |
extend FFI::Library | |
ffi_lib '/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib' | |
end | |
module GLU | |
extend FFI::Library | |
ffi_lib '/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib' | |
end | |
module GLUT | |
extend FFI::Library |
This file contains 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
# This binding is generated against libSDL 1.2.13 headers. | |
require 'rubygems' | |
require 'ffi' | |
module SDL | |
extend FFI::Library | |
ffi_lib "/usr/local/lib/libSDL.so" | |
SDL_INIT_TIMER = 0x00000001 | |
SDL_INIT_AUDIO = 0x00000010 |
This file contains 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
module H5 | |
extend FFI::Library | |
H5_CLEAR_MEMORY = 1 | |
H5_CONVERT_DENORMAL_FLOAT = 1 | |
H5_DEV_T_IS_SCALAR = 1 | |
H5_FP_TO_INTEGER_OVERFLOW_WORKS = 1 | |
H5_FP_TO_ULLONG_ACCURATE = 1 | |
H5_GETTIMEOFDAY_GIVES_TZ = 1 | |
H5_HAVE_ALARM = 1 |
This file contains 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 'ffi-inliner' | |
module MyLib | |
extend Inliner | |
inline <<-c | |
void say_hello(char* name) { printf("Hello, %s\n", name); } | |
c | |
end | |
MyLib.say_hello('boys') |
This file contains 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 'rubygems' | |
require 'ffi' | |
class Info | |
extend FFI::Library | |
BOOT_TIME = 2 | |
attach_function :setutxent, [], :void | |
attach_function :getutxent, [], :pointer |
This file contains 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
[random:uniform(2) - 1 || X <- lists:seq(1,10)]. |
This file contains 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
package makengo | |
import ( | |
"os" | |
"exec" | |
"bytes" | |
"io" | |
"strings" | |
) |
This file contains 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
// Parallel algorithm for PI calculation | |
// | |
// Sources of inspiration: | |
// | |
// * https://computing.llnl.gov/tutorials/parallel_comp/#ExamplesPI | |
// * http://dos.iitm.ac.in/Vishwa/GCCourse/suneetha/picalc.html | |
// | |
// Thanks to aht for fixing the random generator issue: | |
// http://groups.google.com/group/golang-nuts/browse_thread/thread/f5c12ca69b46a931 |
This file contains 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
package z80 | |
import ( | |
"container/vector" | |
"fmt" | |
) | |
/* The flags */ | |
const FLAG_C = 0x01 |
OlderNewer