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
| write("fact", 1, 1) | |
| n = 2 | |
| while n <= 10 | |
| eval("fact", n, take("fact", n - 1, nil)[2] * n) | |
| n = n + 1 | |
| end | |
| p take("fact", 10, nil) |
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
| require 'my_drip' | |
| MyDrip.invoke | |
| def root | |
| Root.new | |
| end | |
| class Root | |
| class VersionMismatchError < RuntimeError; 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
| ** テーマ『自画自讃』 | |
| とちぎテストの会議05を開催します。 | |
| ** 概要 | |
| - 日時: 2018/05/12(土) 11:00 | |
| - 場所: [http://nasu-hh.com:title=那須野が原ハーモニーホール] | |
| - 定員: 50名 | |
| ** タイムテーブル | |
| - 11:00 開場 |
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 Array | |
| def keys | |
| 0...size | |
| end | |
| end | |
| def find(it, key, &blk) | |
| it.keys.each do |k| | |
| v = it[k] | |
| k == key ? yield(v) : find(v, key, &blk) |
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
| require "minruby" | |
| def mark_tail(tree, genv) | |
| case tree && tree[0] | |
| when "func_call" | |
| mhd = genv[tree[1]] | |
| if mhd == nil || mhd[0] == "user_defined" | |
| tree[0] = "tail" | |
| end | |
| when "stmts" |
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
| 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 |
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
| // | |
| // 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 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
| # frozen_string_literal: false | |
| require 'rinda/tuplespace' | |
| require 'bartender/bartender' | |
| module Bartender | |
| class Queue | |
| def initialize | |
| @reader = [] | |
| @queue = [] | |
| 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
| 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 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
| require 'rinda/tuplespace' | |
| require 'drb' | |
| class Risp | |
| Ptr = Struct.new(:ptr) | |
| class Ptr | |
| def initialize(ptr) | |
| self.ptr = ptr | |
| end |