valuedomainの設定欄に以下を記入
mx @ 10
a * <IP address>
| class Roomba | |
| { | |
| float x; | |
| float y; | |
| float rad; | |
| float r; | |
| static final color c_lgray = #c0c0d0; | |
| static final color c_gray = #acacbc; | |
| static final color c_dgray = #909090; | |
| static final color c_lblack = #303030; |
| # coding: utf-8 | |
| module NetworkSetup | |
| def self.network_services | |
| result = `networksetup -listallnetworkservices`.each_line.map{|l|l.strip} | |
| result.shift | |
| return result | |
| end |
| # coding: utf-8 | |
| require 'mini_exiftool' | |
| require 'twitter' | |
| require_relative 'simplestore' | |
| # https://gist.github.com/4482749 | |
| require_relative 'networksetup' | |
| # https://gist.github.com/4481049 | |
| store = SimpleStore.new(File.dirname(__FILE__)+"/store.yaml") |
| # coding: utf-8 | |
| require 'yaml' | |
| class SimpleStore < BasicObject | |
| attr_reader :file | |
| def initialize(file) | |
| @file = file | |
| if(::File::exist?(file)) |
| # coding: utf-8 | |
| class MPQueue | |
| def initialize | |
| @wcout,@wcin = IO.pipe # lock for write | |
| @rcout,@rcin = IO.pipe # lock for read | |
| @lout,@lin = IO.pipe | |
| @dout,@din = IO.pipe |
| module ArgsValidator | |
| def self.validate_args name, args, rules, klass | |
| ([args.length,rules.length].min).times do |i| | |
| arg = args[i] | |
| rule = rules[i] | |
| next if rule == :any | |
| rule = rule.class unless rule.class <= Class | |
| unless arg.class <= rule | |
| th = %w[st nd rd][i%10] || 'th' |
| class IO | |
| def self.named_pipe(path, create=true) | |
| if !File.exist?(path)&& create | |
| system "mkfifo #{path}" | |
| end | |
| raise IOError.new("it is not named pipe") if File.ftype(path) != "fifo" | |
| pout = File.open(path, "r+") | |
| pin = File.open(path, "w+") | |
| return pout, pin |
| require 'mechanize' | |
| class HumanlikeMechanize < Mechanize | |
| def initialize min,max | |
| raise ArgumentError.new("min > max") if min > max | |
| raise ArgumentError.new("min < 0") if min < 0 | |
| raise ArgumentError.new("max < 0") if max < 0 | |
| @sleep_min = min | |
| @sleep_max = max |
| # coding: utf-8 | |
| require_relative 'protocol' | |
| # TODO: チェックサムを確認する | |
| class IPv4Header | |
| attr_reader :version,:header_length,:packet_length,:identification,:frag_dont,:frag_more,:frag_offset,:ttl,:protocol,:checksum,:sndr_addr,:dest_addr, | |
| :data_length | |
| def initialize(packet,offset=0) |