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 'drip' | |
class Driprox | |
def initialize(drip, port, remote_host, remote_port) | |
@drip = drip | |
@server = TCPServer.new(port) | |
@hostname = remote_host | |
@port = remote_port | |
@origin = @drip.write(nil, 'start') | |
end |
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
diff --git a/src/io.c b/src/io.c | |
index c9b1a8e..f0f8ff2 100644 | |
--- a/src/io.c | |
+++ b/src/io.c | |
@@ -1042,6 +1042,113 @@ mrb_io_sync(mrb_state *mrb, mrb_value self) | |
} | |
void | |
+mrb_fd_set_nonblock(mrb_state *mrb, int fd) | |
+{ |
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
# -*- coding: utf-8 -*- | |
module Bartender | |
class App | |
class FDMap | |
def initialize; @map = {}; end | |
def []=(fd, v) | |
@map[fd.to_i] = [fd, v] | |
end | |
def [](fd) | |
_, v = @map[fd.to_i] |
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
# based on http://d.hatena.ne.jp/pcl/20110625/p1 | |
srand(0) | |
class Perceptron | |
def initialize(n_hidden, eta) | |
@n_hidden = n_hidden | |
@n_output = nil | |
@eta = eta | |
@wih = Hash.new{ rand } |
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 'drb' | |
require 'rinda/tuplespace' | |
module Rinda | |
module_function | |
def rinda_eval(ts) | |
ts = DRbObject.new(ts) unless DRbObject === ts | |
pid = fork do | |
Thread.current['DRb'] = nil | |
DRb.stop_service |
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 'rinda/tuplespace' | |
require 'drb' | |
class Risp | |
Ptr = Struct.new(:ptr) | |
class Ptr | |
def initialize(ptr) | |
self.ptr = ptr | |
end |
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 'webrick' | |
require 'drb/drb' | |
require 'drb/http0' | |
require 'thread' | |
module DRb | |
module HTTP0 | |
def self.open_server(uri, config) | |
unless /^http:/ =~ uri |
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
# frozen_string_literal: false | |
require 'rinda/tuplespace' | |
require 'bartender/bartender' | |
module Bartender | |
class Queue | |
def initialize | |
@reader = [] | |
@queue = [] | |
end |
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
// | |
// main.m | |
// abs3 | |
// | |
// Created by Masatoshi SEKI on 2017/10/12. | |
// Copyright © 2017年 Masatoshi SEKI. All rights reserved. | |
// | |
#if 0 | |
- Connected to device UUID: C9529529-C937-45B4-B3B6-D1476FFB111B Named: AB Shutter3 | |
- UUID 2A50 Read Value: 0x028A2466820100 |
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
eleven:ruby mas$ svn diff lib/drb/drb.rb | |
Index: lib/drb/drb.rb | |
=================================================================== | |
--- lib/drb/drb.rb (revision 61162) | |
+++ lib/drb/drb.rb (working copy) | |
@@ -1673,6 +1673,7 @@ | |
client.close unless succ | |
if Thread.current['DRb']['stop_service'] | |
Thread.new { stop_service } | |
+ break |