`
xu_wccq
  • 浏览: 132097 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论
文章列表

fcitx

去除fcitx的多余输入法: 1、去除五笔、二笔、仓额等。 zhancang@ubuntu:~$ sudo gedit /usr/share/fcitx/data/tables.conf [sudo] password for zhancang: #####以#打头的为注释(把不用的全添上#号)   例如: #[码表] #名称=五笔字型 #码表=wbx.mb #调频=0 #拼音=1 #拼音键=z #自动上屏=1 #模糊=1 #模糊键=z #自动词组=1 #自动词组长度=4 #词组参与自动造词=1 #保存自动词组=0 #精确匹配=0 #提示编码=0 #符 ...
1 。 在(ruby on rails) 的项目下面,确保public/目录中的 dispatch.fcgi , dispatch.cgi  ,  dispatch.rb 三个文件中          1: 确保第一行内容为本机的ruby的安装目录 。(例如:我本机的是  #!/usr/local/ruby/bin/ruby )             而在5.102上面,因为ruby 是默认安装,所以需把这一行改为 #!/usr/bin/ruby  )                      2. 在lighttpd.conf文件中,确保以下内容的正确性          必需以具有 ro ...
ruby 代码   # Here is HTTP request class hierarchy.    #    #   Net::HTTPRequest    #       Net::HTTP::Get    #       Net::HTTP::Head    #       Net::HTTP::Post    #       Net::HTTP::Put    #       Net::HTTP::Proppatch    #       Net::HTTP::Lock    #       Net: ...
MPlayer install: [皮肤]Abyss-1.6.tar.bz2----->/usr/local/mplayer/Skin [解码]all-20061022.tar.bz2---->/usr/local/mplayer/codecs ./configure --prefix=/usr/local/mplayer --enable-gui --with-codecsdir=/usr/local/mplayer/codecs --with-win32libdir=/usr/local/mplayer/codecs --with-reallibdir= ...
javascript 摸拟 class 以及 实例变量,实例方法; 类变量,类方法 function Circle(r){ this.r = r; // this.r 这里它变就实例变量 } Circle.PI = 3.14 // 类方法,只能在Circle上调用 Circle.prototype.area=function(){ return this.r * Circle.PI; } // 实例方法 Circle.max = function(a,b){ return a.r > b.r ? a : b } // 类方法   有时候我们大概也需要用到 私有属性 : 第一 ...
 如何使用类名来获得类? 如果我有classname = "String时,如何生成SomeClass类的实例呢?主要有两个解决方法。" ruby 代码   [1] eval(classname).new   [2] Object.const_get(classname).new   第1种方法既简单又可以处理嵌套类(Net::HTTP等),但如果在CGI环境中滥用它的话,将十分危险。 而第2种方法却又无法处理嵌套类的问题。但如果进行以下处理的话,就可以处理嵌套类了。 ruby 代码 # 如果只考虑Ruby 1.8之后的版本的话,可以 ...
 topic.to_xml(:skip_instruct => true, :except => [ :id, :bonus_time, :written_on, :replies_count ]) 更多方法参考API --> to_xml ActiveRecord::XmlSerialization @model[:pc] = ..... 可以賦 任何值。 哈希表里包含多层的话可以先把哈希表转为xml 格式,再把它赋给model的一个属性,最后把model转 ...

从域名到IP转换

    博客分类:
  • ruby
#!/usr/bin/env ruby require 'open-uri' LOOKUP_URL = 'http://toolbar.netcraft.com/site_report?url=%s' MATCH_RE = /<td><b>IP address<\/b><\/td><td.*?>([\d\.]+)<\/td>/ host = ARGV.select { |arg| arg !~ /^\-/ }.first open(LOOKUP_URL % host).read = ...
sql 代码   #!/bin/bash      # none 1,2,3,15,20 signal   trap '' 1 2 3 15 20      #clear screen ,close redisplay   clear   stty -echo      #set password   echo -n "Enter your codeword: "   read secretcode   echo      #confirm passwo ...
  #response to client respond_to do |wants|     wants.html { redirect_to(person_list_url) }     wants.js     wants.xml  { render :xml => @person.to_xml(:include => @company) }   end     #获取params里传来的xml数据: #get data from parameters channel_info_hash ...

gem command

当不能使用rake 命令 |||> rake --trace goldberg:install <||| how to build task 'db:migrate:plugins' gem install plugin_migrations gem install RedCloth <web文本编辑器辅助工具> gem install railroad <A DOT diagram generator for Ruby on Rail applications>
赵毋恤很感动,但仍命士兵包围豫让,豫让请求赵毋恤把衣服给他刺杀,以致报仇之意。
apache 项目中的与log4j对应的ruby版为->log4r ruby 代码 log = Logger.new(STDOUT) log.level = Logger::WARN log.debug("Created logger") log.info("Program started") log.warn("Nothing to do!") begin File.each_line(path) do |line| unless line =~ /^(\w+) = (.*)$/ ...
字符串截取, 英文单词单数复数转换(Agile Web Development with Rails [Chapter 15||||||||||||||Active Support[P251]) ruby 代码 string = "Now is the time" puts string.at(2) #=> "w" puts string.from(8) #=> "he time" puts string.to(8) #=> ...
  <!--[if IE]> <style type="text/css"> .live_tree {padding: 1px !important;} table(ID或是html tag_name) {behavior: url(<%= stylesheet_path "csshover.htc" %>);} </style> <![endif]-->    
Global site tag (gtag.js) - Google Analytics