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
/* example ex4.c */ | |
/* compile with: gcc -g -Wall ex4.c -o ex4 -lvirt */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <libvirt/libvirt.h> | |
#include <string.h> | |
static int authCreds[] = { | |
VIR_CRED_AUTHNAME, | |
VIR_CRED_PASSPHRASE, |
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
class User | |
attr_reader :name, :age | |
def initialize(name, age) | |
@name, @age = name, age | |
end | |
end | |
class Filter | |
attr_reader :method, :value | |
def initialize(method, 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
From 33a17a694473bcfd95b4a04390a898f23923489c Mon Sep 17 00:00:00 2001 | |
From: David Calavera <[email protected]> | |
Date: Fri, 21 Jan 2011 11:19:00 +0100 | |
Subject: [PATCH] Dir.glob uses #to_path when the receiver responds to it | |
--- | |
core/dir/shared/glob.rb | 21 ++++++++++++++++----- | |
1 files changed, 16 insertions(+), 5 deletions(-) | |
diff --git a/core/dir/shared/glob.rb b/core/dir/shared/glob.rb |
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
From a7b32e77cd16772bb20df95813c674ac2de3d30c Mon Sep 17 00:00:00 2001 | |
From: David Calavera <[email protected]> | |
Date: Sun, 16 Jan 2011 15:39:07 +0100 | |
Subject: [PATCH] allow to use an existent JRuby runtime | |
--- | |
.../jruby/rack/DefaultRackApplicationFactory.java | 7 +++++-- | |
src/main/java/org/jruby/rack/RackContext.java | 1 + | |
2 files changed, 6 insertions(+), 2 deletions(-) |
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
su - dcalavera -c "cd /home/dcalavera/dev/ttest ; jruby -S trinidad -t -p 3001 -ldaemon --daemonize /home/dcalavera/dev/ttest/tmp/trinidad.pid 1> /home/dcalavera/dev/ttest/log/stdout.log 2>/home/dcalavera/dev/ttest/log/stderr.log" | |
$ cat ttest/log/stdout.log | |
prepare for a fork | |
Exe: /proc/23076/exe. Exist? true | |
Fork result: 0 | |
Starting Trinidad as a daemon | |
Writing log into: log/trinidad.log | |
To stop it, kill -s SIGINT 23088 | |
start a new process session |
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
$ jdev --1.9 -S jirb | |
ruby-1.9.2-p0 > a = /[\x00-\x20%\x7F-\xFF]/ | |
SyntaxError: invalid multibyte escape: /[\x00-\x20%\x7F-\xFF]/ | |
from org/jruby/RubyKernel.java:1096:in `eval19' | |
$ irb19 | |
ruby-1.9.2-p0 > a = /[\x00-\x20%\x7F-\xFF]/ | |
SyntaxError: (irb):1: invalid multibyte escape: /[\x00-\x20%\x7F-\xFF]/ | |
from /Users/david/.rvm/rubies/ruby-1.9.2-p0/bin/irb:16:in `<main>' |
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
$ jdev --1.9 -S bundle install | |
/Users/david/dev/jruby/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:28:in `run': undefined method `size' for #<Bundler::LazySpecification:0x3225753d> (NoMethodError) | |
from /Users/david/dev/jruby/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' | |
from /Users/david/dev/jruby/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch' | |
from /Users/david/dev/jruby/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start' | |
from /Users/david/dev/jruby/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13:in `(root)' | |
from org/jruby/RubyKernel.java:1076:in `load19' | |
[exited with 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
def score(dice) | |
compute_singles(dice) + compute_triples(dice) | |
end | |
def compute_singles(diceRoll) | |
diceRoll.inject(0) do |result, roll| | |
result += single_value(roll) | |
end | |
end |
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
From e548d8e62065232151e80bd1a58234885c14db64 Mon Sep 17 00:00:00 2001 | |
From: David Calavera <[email protected]> | |
Date: Tue, 4 Jan 2011 19:16:28 +0100 | |
Subject: [PATCH 1/2] Module.const_defined? accepts a flag to search into the receiver superclasses | |
--- | |
core/module/const_defined_spec.rb | 8 ++++++++ | |
1 files changed, 8 insertions(+), 0 deletions(-) | |
diff --git a/core/module/const_defined_spec.rb b/core/module/const_defined_spec.rb |
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
public class Foo { | |
public void bar(String baz) {} | |
} |