`
xuchunming
  • 浏览: 30308 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
                          rails项目体验     在过去的16个月中我的同事们和我一直忙碌于一个比较大的rails项目中。  在经历了无数个加班和n个通宵之后终于看到我们的项目部署在6台IBM服务器上,在过去的一周中 ...
nterface Component { void traverse(); } // 1. "lowest common denominator" class Primitive implements Component { // 2. "Isa" relationship private int value; public Primitive( int val ) { value = val; } public void traverse() { System.out.print( val ...
public class InterpreterDemo { public static boolean precedence( char a, char b ) { String high = "*/", low = "+-"; if (a == '(') return false; // if (a == '(' && b == ')') return false; if (a == ')' && b == '(') { System.out.println( ...
namespace :db do namespace :fixtures do desc 'Create YAML test fixtures from data in an existing database. Defaults to development database. Set RAILS_ENV to override.' task :dump => :environment do sql = "SELECT * FROM %s" skip_tables = ["s ...
# immediate values # e.g. true, false and Integers a = true # => true b = true # => true def a.foo "bar" end a.foo # => "bar" b.foo # => "bar" # referenced values c = "foo" # => "foo" d = "foo" # => &quo ...
require "before_and_after" class Message include BeforeAndAfter def initialize message @message = message end def display puts @message end def before_display puts "BEFORE DISPLAY" end def after_display puts "AFTER DISP ...
花了几天时间学习了一下rails下的REST. 现在把自己的理解记录下来,以备后用。 REST不用说了,网上一堆介绍。rails对REST的支持主要体现在route,helper,resouces format几个部分。由于之前对route不是特别了解,我对REST的疑问也主要是在这部分的。REST风格的程序简化了URL长度,这中简化是通过增加对资源的请求方式来实现的,非REST的HTTP method 只有post和get两种。 REST需要4种,增加了put和delete。 我理解的REST的好处:  代码简洁,开发效率很高 ,SEO 1 route部分rails的支持。   rail ...
好消息啊,一直以来关注mysql,两年前就开始学习mysql,看了几本关于mysql的书.  一直看好这东西. 现在我比较强项的 java 与 mysql联手.  窃喜啊.  不知道sun 的mysql能否象oracle一样成功.  个人感觉mysql的设计和实现很经典.  好东西.
import java.net.*; class Test{     public static void main(String args[]) {        //查询www.xiaonei.com 的ip         try {             InetAddress ip[] = InetAddress.getAllByName("http://www.xiaonei.com");             for (int i=0;i<ip.length;i++) {                 System.out.println(ip[i ...
Reguler Expression \d [0-9] Digit character \D [^0-9] Any character except a digit \s [\s\t\r\n\f] Whitespace character \S [^\s\t\r\n\f] Any character except whitespace \w [A-Za-z0-9_] Word character \W [^A-Za-z0-9_] Any character except a word character [:alnum:] Alphanumeric [:alpha:] Uppercase or ...
Access Control When designing a class interface, it’s important to consider just how much access to your class you’ll be exposing to the outside world. Allow too much access into your class, and you risk increasing the coupling in your application—users of your class will be tempted to rely on detai ...
经典Singletons Sometimes you want to override the default way in which Ruby creates objects. As an example, let’s look at our jukebox. Because we’ll have many jukeboxes, spread all over the country, we want to make maintenance as easy as possible. Part of the requirement is to log everything that happ ...
class variables & class methods A class variable is shared among all objects of a class, and it is also accessible to the class methods that we’ll describe later. Only one copy of a particular class variable exists for a given class. Class variable names start with two “at” signs, such as @@coun ...
1  Notation Conventions Throughout this book, we use the following typographic notations. Literal code examples are shown using a typewriter-like font. class SampleCode def run #... end end Within the text, Fred#do_something is a reference to an instance method (in this case do_something) of class ...
今天看了csdn的<<程序员>>   发现了很多有价值的文章  尤其是关于开源软件 和 软件测试的文章  很有意思 给予tdd的extreme programming 还有robbin的关于web frame  及 ror的文章  准备好好学习一下  估计在我大学期间想全部学习是不大可能了  熟悉一下框架  毕竟java基础类库还算熟悉   框架这东西以后用在学就可以了   熟悉一下ruby  买了两本书   ruby cookbook 及 regular expression 不错的两本o'really的书 抽时间好好研读一下  ruby 已经学到 module了  ...
Global site tag (gtag.js) - Google Analytics