新手
iteye_8417
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
中文数字转换阿拉伯数字
[code="ruby"]require 'rubygems'require 'jcode'$KCODE='u'def main(str) num=0 if str.to_s.match("亿") str.to_s.match(/(.+)亿(.+)/) num1=conv($1.to_s)*100000000 num2=conv($2...2011-08-09 14:40:13 · 643 阅读 · 0 评论 -
mongo备份
./mongorestore -h 192.168.1.1 -d db_name --directoryperdb ~/wenjianjia/db_data mongodump -d db_name -o ~/wenjianjia原创 2011-12-21 19:06:13 · 116 阅读 · 0 评论 -
mysql 中文乱码
create table xxxxx(id int not null primary key auto_increment,created_on datetime,updated_on datetime,weibo_name char(255),weibo_image char(255),weibo_type int,weibo_id char(255),app_id int,weibo_desp...原创 2011-11-01 13:59:56 · 234 阅读 · 0 评论 -
ruby转换中文html Unicod
require 'htmlentities' coder = HTMLEntities.new str=coder.decode(str)原创 2011-11-01 16:39:23 · 199 阅读 · 0 评论 -
nginx——install
启动 sudo ./nginx配置文件 conf / vhost 配置路径 端口sudo gem install passengersudo ./passenger-install-nginx-module sudo ldconfig sudo ln -s /usr/local/lib/libpcre.so.1 /lib--with-http_...原创 2012-03-02 15:57:06 · 121 阅读 · 0 评论 -
unicode
requirt 'cgi'def to_utf8(unicode_string) unicode_string.gsub(/\\u\w{4}/) do |s| str = s.sub(/\\u/, "").hex.to_s(2) if str.length < 8 CGI.unescape(str.to_i(2).to_s(16).inser...原创 2011-12-06 16:32:38 · 164 阅读 · 0 评论 -
mysql utf8建表
create table weibo_verifieds(id int not null primary key auto_increment,uid char(255),uname char(255),uimg char(255),url char(255)) charset default utf8;原创 2011-12-06 18:08:28 · 237 阅读 · 0 评论 -
ruby环境
下载yaml-0.1.4.tar.gz, http://pyyaml.org/wiki/LibYAML解压libyaml,然后编译安装sudo aptitude install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev sudo apt-get install lib...原创 2012-08-21 17:35:11 · 152 阅读 · 0 评论 -
正则小计
s.split(/\d+|[a-zA-Z]|[[:punct:]]+/)[[:punct:]]匹配标点符号原创 2012-09-06 14:02:56 · 170 阅读 · 0 评论
分享