Skip to content

Instantly share code, notes, and snippets.

Masatoshi SEKI seki

Block or report user

Report or block seki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View drb.rb.patch
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
@seki
seki / main.m
Created Oct 11, 2017
test tool for AB shutter (Bluetooth Remote Shutter)
View main.m
//
// 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
@seki
seki / mono_rinda.rb
Created May 24, 2017
Fibered TupleSpace
View mono_rinda.rb
# frozen_string_literal: false
require 'rinda/tuplespace'
require 'bartender/bartender'
module Bartender
class Queue
def initialize
@reader = []
@queue = []
end
@seki
seki / http0serv.rb
Last active Aug 16, 2017
http0serv.rb
View http0serv.rb
require 'webrick'
require 'drb/drb'
require 'drb/http0'
require 'thread'
module DRb
module HTTP0
def self.open_server(uri, config)
unless /^http:/ =~ uri
@seki
seki / risp.rb
Created Feb 11, 2017
cons on Rinda
View risp.rb
require 'rinda/tuplespace'
require 'drb'
class Risp
Ptr = Struct.new(:ptr)
class Ptr
def initialize(ptr)
self.ptr = ptr
end
@seki
seki / dot.rb
Last active Aug 16, 2017
Rinda sample for Nagoya RubyKaigi
View dot.rb
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
View bp.rb
# 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 }
@seki
seki / bartender.rb
Created Oct 2, 2016
bartender for mruby
View bartender.rb
# -*- 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]
@seki
seki / gist:641cabb835005c32c140096918db8d5a
Created Oct 2, 2016
これをプルリクするには!
View gist:641cabb835005c32c140096918db8d5a
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)
+{
View driprox.rb
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
You can’t perform that action at this time.