`
CharlesCui
  • 浏览: 432710 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
ActiveSupport::JSON decode(json) Converts a JSON string into a Ruby object. [ hide source ] # File vendor/rails/activesupport/lib/active_support/json/decoding.rb, line 11 11: def decode(json) 12: YAML.load(convert_json_to_yaml(json)) 13: rescue ArgumentError => ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="K ...
每种协议都可能会有各种各样的实现方法,不同的厂家来支持。 如果跟着这些厂家的不同实现来学,看他们提供的API,这将是一种治标不治本的做法,而且得不到最深入的理解。 要到维护该协议的组织那里去找文档! 以JavaScript的xmlhttprequest为例,gotapi找不到详细的说明,ms没给出更好的解释,但在w3c官网就有相当详细的说明! http://www.w3.org/TR/XMLHttpRequest/
要把sqlite3-ruby的可执行文件和DLL都放到环境变量path指定的任意目录! 我只把sqlite3.exe放进去是不行的,还有个DLL和def也要放进去,否则rails启动后会报unknow error的问题!
session[:to_url]=request.env["REQUEST_URI"]
Demo如下,大家拍砖吧! 请看下面介绍: 程序代码: 下面代码负责实现和旺旺IM通讯的接口,这里只响应了onClick事件。 using System.Linq; using System; using System.Collections.Generic; using System.Threading; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Text; using wwsdkcomLib; using System.Xml; nam ...
修改网卡参数: A、修改ip地址 即时生效: # ifconfig eth0 192.168.0.20 netmask 255.255.255.0 启动生效: 修改/etc/sysconfig/network-scripts/ifcfg-eth0 B、修改default gateway 即时生效: # route add default gw 192.168.0.254 启动生效: 修改/etc/sysconfig/network-scripts/ifcfg-eth0 C、修改dns 修改/etc/resolv.conf 修改后可即时生效,启动同样有效 D、修改host name 即 ...
Httparty是一个很好用的基于Ruby的net库的gem,自身非常小巧,用法很灵活。 但是他有个毛病,就是发送完http请求之后返回的是http小的html部分,而不是消息头,比如set-cookie,status code,location等。 为了满足需求,又要保持Httparty源代码和官方同步,下面写了这个补丁: "httpartyHack.rb" # # To change this template, choose Tools | Templates # and open the template in the editor. module Ht ...
Ruby可以打开一个对象,但能够打开一个函数么? Ruby打开一个对象的meta class并向其中重写方法,比如: 这是定义TT2这个类 class TT2 class << self def pa out end def out(a) p a end private :out end end 下面向TT2这个类对象添加一个新的out方法 class << TT2 alias_method :_out,:out def out(a) p &qu ...
现有如下类Test,请注意类方法talk02和类方法talk03 class Test def self.talk01 puts "kaishi" end def self.talk02 self.talk01 end def self.talk03 talk01 end end 下面分别调用类方法talk02和类方法talk03 puts "TestAPIToken.talk02:" TestAPIToken.talk02 puts "TestAPIToken.talk03 ...
module DM def self.included(c) puts c.class c.extend MM end def set(a) @a=a end module MM def set(a) @abc=a end def get @abc end end end class TT Abc=123 include DM def self.setUrl(a) @baseUrl=a end d ...
Jobs: Scribd is looking for a Flex Developer. See more on the Job Board. (http://www.37signals.com/svn/posts/1330-introducing-wysihat-an-eventually-better-open-source-wysiwyg-editor) 什么意思?37signals开始打算用Flex做表示层了?
rake需要安装:     gem install rake       apache需要安装,并且需要设定环境变量:   export APXS2=/usr/local/apache2/bin/apxs     然后在passenger bin目录下面运行./bin/passenger-install-apache2-module    报错说需要APR,于是继续设定环境变量:     export APR_CONFIG=/usr/local/apache2/bin/apr-1-config     再次执行passenger-install的脚本,继续报错:     mod_passe ...
同样的环境,大小差不了几个字节的页面, Nginx的worker_connections  1024; Apache的MaxClients          150,worker模式; 照理说压Nginx如果用1024个并发压效果是最好的,同样压apache并发150的话效果也是最好的。 Nginx的测试结果: [root@localhost nginx-0.7.19]# ab -t 60 -c 1024 http://192.168.1.101:8080/ This is ApacheBench, Version 2.0.40-dev <$Revision: 1.116 $> ...
我的配置如下: <IfModule mpm_worker_module>     StartServers          2     MaxClients          150     MinSpareThreads      25     MaxSpareThreads      75      ThreadsPerChild      25     MaxRequestsPerChild   0 </IfModule>   ServerLimit没写就是16,它决定系统最多启动几个httpd进程。 ThreadLimit 没写默认是64, ThreadsP ...
Global site tag (gtag.js) - Google Analytics