`
deferling
  • 浏览: 16855 次
  • 性别: Icon_minigender_1
  • 来自: 东京
文章分类
社区版块
存档分类
最新评论
文章列表
class Interpreter def do_a() print "there, "; end def do_d() print "Hello "; end def do_e() print "!\n"; end def do_v() print "Dave"; end Dispatcher = { ?a => instance_method(:do_a), ?d => i ...
これは標準出力を同期出力に設定するためのもの。非同期出力だと、プログラムは標準出力にデータを出力すると応答を待たずにさっさと先に進んでしまう。 Ajax の非同期通信と似たようなものだ。非同期入出力ならウェブの記事の更新が完了するのを待たずにマウスを動かして次の作業に移ることができるので便利だ。しかし、対話的に操作するプログラムでは表示が完了してから次の入力などの動作に移るようにしないとまずい。 を読まないと分からないのだろうが、これも、今回の目的ではないのでスキップ! 这个是为了使得标准出力成为同期处理而设定的东西,不同期的出力是程序不等待数据在标准出力,往前面走下去。这和Ajax的非同期 ...
require "rexml/document" include REXML    # so that we don’t have to prefix everything # with REXML::... $path = File.dirname(__FILE__) class Readxml     def initialize(file)     @file = file     @total = 0     @doc  = Document.new File.new("#{$path}/../xmlfile/#{@file}")   end ...
require 'iconv' $KCODE='u' class String def String.safe_iconv(str_utf8) sentan="" koutan= str_utf8.to_s while sentan.to_s.size < str_utf8.to_s.size begin return sentan = sentan.to_s + Iconv.iconv('SHIFT_JIS','UTF-8', koutan)[0] rescue Iconv::Fail ...
一直在网上找这个问题的解决方法,可是都是只有Netbenas5.5的解决方案,而且并没有根本的解决,今天上官方看了下,原来官方就有解决方法~哈哈~这招可以解决目前所有的版本,全部文件将用UTF-8解码.所以转移工作平台就更加简单咯~ 这是原文: For those who need to use international and multibyte characters, NetBeans can support UTF-8 editing. To enable it, go to your NetBeans installation directory and find the etc fo ...
开发中遇到一个问题 ReportRequest是一个表对应一个model:report_request.rb model report_request.rb 里面 class ReportRequest < ActiveRecord::Base model TeikiRecountRequest.rb 里面 class TeikiRecountRequest < ActiveRecord::Base model spot_report_request.rb 里面 class SpotReportRequest < ReportRequest 现在用 ReportRequ ...
Global site tag (gtag.js) - Google Analytics