`
wuhuizhong
  • 浏览: 671498 次
  • 性别: Icon_minigender_1
  • 来自: 中山
社区版块
存档分类
最新评论
文章列表
在開發的網頁中使用 jQuery ,為 jQuery 增加一個 log function: jQuery.fn.log = function (msg) { console.log("%s: %o", msg, this); return this; }; 這樣只需要對 $(...) 這樣的 jQuery object 呼叫 .log("Debug message") 就可以在 firebug 的 console 看到該物件的 context 了.
I’m currently preparing the deployment of our RoR application (a kind of portal for our enterprise) in Oracle App Server 10g. Our application is currently deployed under Litespeed Web Server, running with Ruby MRI: we encounter some problems of performances with Database connections and we also have ...
(NOTE: JRubyWorks keeps moving forward and this article may not be up to date.) How to run your Rails application with J2EE web servers (such as Jetty and Tomcat )? Here’s a solution: 1. Set JRUBY _HOME environment variable properly. export JRUBY_HOME=/usr/lib/jruby 2. Install ActiveRecord-JDBC . ...
Rails 內置 Prototype 和 scriptaculous  。   jRails is a drop-in jQuery replacement for the Rails Prototype/script.aculo.us helpers. == Resources Install * .script/plugin install http://ennerchi.googlecode.com/svn/trunk/plugins/jrails Project Site * http://code.google.com/p/ennerchi/ Web Site * htt ...
jQuery 中文社区 jQuery 中文社区官方论坛 《精通JavaScript+jQuery》视频教程(共16讲) - 来自:前沿视频教室 jQuery 1.2 中文参考文档 Visual jQuery1.1文档 - 中文版(按功能排序) jQuery中文入门指南,翻译加实例,jQuery的起点教程 jQuery技巧总结 jQuery 學習心得 小试牛刀——一篇jQuery小教程 jQuery简单入门(系列)
 当你需要采用动态树型视图的时候,你会自然的使用xloadtree(主页:http://webfx.eae.net/dhtml/xloadtree/xloadtree.html),那么在rails中如何使用xloadtree呢,我这里有一些经过测试的步骤,提供给大家参考:1.下载xtree2下载地址:http://webfx.eae.net/dhtml/xtree2b/下载文件:js/xtree2.js,js/xloadtree2.js,css/xtree2.css,以及images/*.*然后,把xtree2.js,xloadtree2.js放置在你的项目的public/javascripts ...
Quest公司提供的免费PLSQL代码库,提供了不少增强型功能,如果是做Oracle数据库开发的人,可以拿来学习或者直接使用。一、说明The PL/Vision Code Library provides over 1,000 PL/SQL functions and procedures that extend the capabilities of the PL/SQL language.PL/Vision Code Library is a freeware product. Quest Support does not support this product. If you have ...
CREATE OR REPLACE PACKAGE p -- Adapted from PL/Vision library copyright 2002 Quest Software Inc. IS c_linelen CONSTANT PLS_INTEGER := 80; -- Set line length before wrap PROCEDURE set_linelen (len IN PLS_INTEGER := c_linelen); FUNCTION linelen RETURN PLS_INTEGER; PROCEDURE l ...
原E文地址:http://blog.hasmanythrough.com/2006/04/20/many-to-many-dance-off   我已注意到使用 Rails 关联在创建多对多关系的两种方式上有些混乱。出现混乱是可以理解的,因为has_many :through 还有些新,写它的文章并不多。Has_and_belongs_to_many 出现的较早,确定的角色与资料超出了你为什么使用多对多关系的假设。事实上,许多人似乎并没有抓住本质上的区别。就像我们从观看经典影片所学到的,告诉我们两个预期选择之间的区别最好方式是它们的舞蹈。你得观察每个人的表演。那么我们必须在两者之间选择哪个演员呢 ...
  ==判断的是值;eql?()判断的是值以及类型;equal?()判断的是地址。 irb> 0==0 => true irb> 0==0.0 => true irb> "0"=="0" => true irb> 0.eql?(0) => true irb> 0.eql?(0.0) => false irb> "0".eql?("0") => true irb> 0.equal?(0) => true irb> 0.equal? ...
rchardet,是python-chardet的port. 而python-chardet, 是mozilla browser的encoding auto-detection实现的port.关于细节, 可以看这里: http://nextlib.lifegoo.com/user/sishen/article/2605 : A composite approach to language/encoding detection   安装: $gem install rchardet  使用: $irb -rubygems irb(main):001:0> require 'rchardet' ...
CREATE OR REPLACE FUNCTION num2rmb(je NUMBER) RETURN VARCHAR2 IS result varchar2(100); i pls_integer; snum varchar2(20) := ltrim(replace(to_char(abs(je), '9999999999999990.99'), '.')); len pls_integer := length(snum); sch varchar2(20) := '零壹贰叁肆伍陆柒捌玖'; sjin varchar2(50) := '分角圆拾佰仟万拾佰仟亿拾佰仟万拾佰仟'; srmb v ...

一些Ruby小函数

    博客分类:
  • ROR
#does ruby guy notice about this pain? #翻转斜杠 def reverse_slash(str) str.gsub(/\//) { |x| "\\" } end #加上双引号 #double-quote str def dquote(str) "\"#{str}\"" end #execute and wait for each line #执行命令行工具并捕获命令行输出 def execute_and_watch(str) putsflush " comma ...
  #比如: 138 <=> 一百三十八 $KCODE = 'u' require 'jcode' require 'iconv' $cn_nums = %w{零 一 二 三 四 五 六 七 八 九} $cn_decs = %w{十 百 千 万 十 百 千 亿} $conv = Iconv.new('gbk', 'utf-8') $cn_nums_map = { '〇' => 0, '一' => 1, '二' => 2, '三' => 3, '四' => 4, '五' => 5, '六' ...
1. 表单:<% form_for([:admin, @album], :html => {:multipart => true}) do |f| %>;文件上传控件: <%= file_field :file, :album_img%>.曾试过将文件控件也写出与Model相关联的方式: <%= f.file_field :album_img%>, 但在修改记录时处理有些麻烦, 所以将文件上传的控件与Model属性分类开. 2. 获得文件: @file = params[:file][:album_img]* 判断是否上传文件 if(@file= ...
Global site tag (gtag.js) - Google Analytics