Skip to content

Instantly share code, notes, and snippets.

View xman's full-sized avatar

xman xman

View GitHub Profile
@xman
xman / sendmore.c
Last active January 13, 2016 13:44
SEND MORE MONEY (code adopted from erl and python code provided by NNH)
#include <stdio.h>
int main()
{
for (int s = 0; s < 10; s++) {
for (int e = 0; e < 10; e++) {
for (int n = 0; n < 10; n++) {
for (int d = 0; d < 10; d++) {
for (int m = 0; m < 10; m++) {
for (int o = 0; o < 10; o++) {
@xman
xman / cpp_device_query_output.txt
Created May 9, 2011 11:20
SGC Ruby CUDA Device Query with Runtime API
There are 2 devices supporting CUDA
Device 0: "GeForce GTX 285"
CUDA Driver Version / Runtime Version 4.0 / 4.0
CUDA Capability Major/Minor version number: 1.3
Total amount of global memory: 1024 MBytes (1073545216 bytes)
(30) Multiprocessors x ( 8) CUDA Cores/MP: 240 CUDA Cores
GPU Clock Speed: 1.48 GHz
Memory Clock rate: 1242.00 Mhz
Memory Bus Width: 512-bit
@xman
xman / fix_ffi_struct.patch
Created May 6, 2011 16:29
Test delegate with FFI struct.
diff --git a/src/org/jruby/ext/ffi/Struct.java b/src/org/jruby/ext/ffi/Struct.java
index e6125f5..a851305 100644
--- a/src/org/jruby/ext/ffi/Struct.java
+++ b/src/org/jruby/ext/ffi/Struct.java
@@ -13,6 +13,7 @@ import org.jruby.exceptions.RaiseException;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
+import static org.jruby.runtime.Visibility.*;