Skip to content

Instantly share code, notes, and snippets.

View pcapriotti's full-sized avatar

Paolo Capriotti pcapriotti

View GitHub Profile
module m where
open import sum
open import equality
open import function
open import sets.nat
open import sets.unit
open import hott.level.core
module _ (A : Set)(B : A → Set) where
@pcapriotti
pcapriotti / extensions.cpp
Created July 2, 2009 16:39
Show a ruby backtrace on a native code crash
#include "extensions.h"
#include <QCoreApplication>
#include <kdemacros.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <ruby.h>
Extensions::Extensions(QObject* parent)
@pcapriotti
pcapriotti / reactive.rb
Created June 23, 2010 22:21
Reactive programming in ruby
# This is a simple example of how to employ reactive programming techniques
# in ruby using Qt.
#
# This example uses Kaya's toolkit framework to keep things more compact, but
# it's possible to translate it back to pure QtRuby very easily.
#
# To try it out, download Kaya (http://github.com/pcapriotti/kaya), copy this
# file in its root directory and run:
# ruby -Ilib reactor.rb
From f6a5dd3d1c508bcc3911fda862a53f5eaab7f38a Mon Sep 17 00:00:00 2001
From: Paolo Capriotti <p.capriotti@gmail.com>
Date: Sat, 10 Jul 2010 00:23:23 +0100
Subject: [PATCH 2/2] Fix spec for rb_class2name accepting a Module argument.
---
vm/capi/class.cpp | 8 --------
vm/capi/module.cpp | 8 ++++++++
2 files changed, 8 insertions(+), 8 deletions(-)
From fd64fb7a97d980432161152934035d7d9c724a07 Mon Sep 17 00:00:00 2001
From: Paolo Capriotti <p.capriotti@gmail.com>
Date: Sat, 10 Jul 2010 12:34:15 +0100
Subject: [PATCH] Add spec for C API rb_throw.
---
spec/ruby/optional/capi/ext/kernel_spec.c | 11 +++++++++++
spec/ruby/optional/capi/ext/rubyspec.h | 1 +
spec/ruby/optional/capi/kernel_spec.rb | 20 ++++++++++++++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
From e604de446c3b2a4a18b7fd8bbd8189f7d117bd3e Mon Sep 17 00:00:00 2001
From: Paolo Capriotti <p.capriotti@gmail.com>
Date: Fri, 9 Jul 2010 22:59:50 +0100
Subject: [PATCH 2/2] Add rb_throw to the C API.
---
vm/capi/include/ruby.h | 7 +++++++
vm/capi/kernel.cpp | 7 +++++++
2 files changed, 14 insertions(+), 0 deletions(-)
From 1bdd22b0a38aafe5ec7c3f58d2460fa390163a2f Mon Sep 17 00:00:00 2001
From: Paolo Capriotti <p.capriotti@gmail.com>
Date: Sat, 10 Jul 2010 00:22:24 +0100
Subject: [PATCH 1/2] New spec: rb_class2name should accept a Module argument.
---
spec/ruby/optional/capi/ext/module_spec.c | 10 ++++++++++
spec/ruby/optional/capi/module_spec.rb | 6 ++++++
2 files changed, 16 insertions(+), 0 deletions(-)
From 6efed7c47bb0f0b2af835061a3993c705ba058b7 Mon Sep 17 00:00:00 2001
From: Paolo Capriotti <p.capriotti@gmail.com>
Date: Sat, 10 Jul 2010 15:50:21 +0100
Subject: [PATCH] Initial port to rubinius.
---
src/CMakeLists.txt | 3 +++
src/Qt.cpp | 6 +++++-
src/qtruby.cpp | 3 +++
3 files changed, 11 insertions(+), 1 deletions(-)
#0 0x0821ef47 in rubinius::ObjectHeader::zone (this=0xb79cf468) at vm/oop.hpp:290
#1 0x083211bd in rubinius::ObjectHeader::young_object_p (this=0xb79cf468) at vm/oop.hpp:377
#2 0x083bef53 in rubinius::BakerGC::collect (this=0x8dbe2f8, data=..., stats=0xbfff42b8)
at vm/gc/baker.cpp:178
#3 0x0822af6f in rubinius::ObjectMemory::collect_young (this=0x8dbe150, data=..., stats=0xbfff42b8)
at vm/objectmemory.cpp:177
#4 0x08326f9d in rubinius::VM::collect_maybe (this=0x8dbdfe0, call_frame=0xbfff435c) at vm/vm.cpp:356
#5 0x0841f4d8 in rbx_prologue_check (state=0x8dbdfe0, call_frame=0xbfff435c) at vm/llvm/jit_util.cpp:675
#6 0xb63fed84 in ?? ()
#7 0x0827152a in rubinius::Dispatch::send (this=0xbfff4408, state=0x8dbdfe0, call_frame=0xbfff46f4,
Index: ruby/qtruby/src/Qt.cpp
===================================================================
--- ruby/qtruby/src/Qt.cpp (revision 1148646)
+++ ruby/qtruby/src/Qt.cpp (working copy)
@@ -99,7 +99,7 @@
int do_debug = qtdb_none;
#endif
-typedef QHash<void *, VALUE *> PointerMap;
+typedef QHash<void *, SmokeValue> PointerMap;