- 浏览: 60447 次
- 性别:
- 来自: 深圳
最新评论
有时候对一些基础的东西,不知道它的边界在哪里,其实做些小实验就知道了.不知道其他人想过下面这样的问题没?
1.我们创建一个对象,直接保存到数据库,会是什么情况?
完整文字 id(integer) name(string) sex(string) age(integer) birthday(date) created_at(time) updated_at(time)
编辑 删除 1 NULL NULL NULL NULL 2011-04-19 15:32:39 2011-04-19 15:32:39
2.我们从数据库直接读出来会是什么结果呢?
#<User id: 7, name: nil, sex: nil, age: nil, birthday: nil, created_at: "2011-04-19 15:32:39", updated_at: "2011-04-19 15:32:39">
3.如果我们设置了默认值,重复上面的步骤会是什么结果呢?
完整文字 id name sex age birthday created_at updated_at
编辑 删除 1 NULL 男 0 2011-01-31 2011-04-19 15:42:40 2011-04-19 15:42:40
#<User id: 1, name: nil, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:42:40", updated_at: "2011-04-19 15:42:40">
4.我们来做测试下的操作
测试的日志:
a.其他类型(string,integer,date,time,array,hash,nil)到string
>>u = User.new
u = User.new
=> #<User id: nil, name: nil, sex: "男", age: 0, birthday: "2011-01-31", created_at: nil, updated_at: nil>
?>u.name = "abc"
=> "abc"
>>u
=> #<User id: nil, name: "abc", sex: "男", age: 0, birthday: "2011-01-31", created_at: nil, updated_at: nil>
>>u.name = 100
=> 100
>>u
=> #<User id: nil, name: 100, sex: "男", age: 0, birthday: "2011-01-31", created_at: nil, updated_at: nil>
>>u.name.class
=> Fixnum
>>Date.now
NoMethodError: private method `now' called for Date:Class
from (irb):10
>>Date.new
=> Mon, 01 Jan -4712
>>u.name = Date.new
=> Mon, 01 Jan -4712
>>u.save
=> true
>>u
=> #<User id: 2, name: "-4712-01-01", sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:55:15">
>>u.name.class
=> Date
>>u.name = Time.now
=> Tue Apr 19 23:56:59 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: "2011-04-19 23:56:59", sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:57:06">
>>u.name.class
=> Time
>>u.name = ["a","b","c"]
=> ["a", "b", "c"]
>>u.save
=> true
>>u
=> #<User id: 2, name: ["a", "b", "c"], sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:58:19">
>>u.name.class
=> Array
>>u
=> #<User id: 2, name: ["a", "b", "c"], sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:58:19">
>>u.name = {:a => "a",:b => "b",:c => "c"}
=> {:c=>"c", :a=>"a", :b=>"b"}
>>u.save
=> true
>>u
=> #<User id: 2, name: {:c=>"c", :a=>"a", :b=>"b"}, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:59:48">
>>u.name.class
=> Hash
>>u.name
=> {:c=>"c", :a=>"a", :b=>"b"}
>>u.name = nil
=> nil
>>u
=> #<User id: 2, name: nil, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:59:48">
>>u.save
=> true
>>u.name
=> nil
>>u.name = true
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:01:27">
>>u.name.class
=> TrueClass
b.其他类型到integer
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:01:27">
>>u.age = "abc"
=> "abc"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:06:33">
>>u.age = 12.6
=> 12.6
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 12, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:07:14">
>>u.age = Date.new
=> Mon, 01 Jan -4712
>>u.save
u.save
=> true
?>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:08:17">
>>u.age = Time.now
=> Wed Apr 20 00:08:50 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1303229330, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:08:56">
>>u.age = ['a','b','c']
=> ["a", "b", "c"]
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:09:29">
>>u.age = {"a" => "aa","b" => "bb","c" => "cc"}
=> {"a"=>"aa", "b"=>"bb", "c"=>"cc"}
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:09:29">
>>u.age = nil
=> nil
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: nil, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:10:47">
>>u.age = true
=> true
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:11:13">
>>u.age = false
=> false
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:11:13">
c.其他类型到Date
>>u.birthday = 120
=> 120
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: nil, updated_at: "2011-04-19 16:31:49">
>>u.birthday = "abcdef"
=> "abcdef"
>>u.birthday
u.birthday
=> nil
?>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: nil, created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:16:57">
>>u.birthday = "2011-01-25"
=> "2011-01-25"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-25", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:13:12">
>>u.birthday = "2011-02-25 17:28:32"
=> "2011-02-25 17:28:32"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-02-25", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:14:19">
>>u.birthday = Date.new
u.birthday = Date.new
=> Mon, 01 Jan -4712
?>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "-4712-01-01", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:15:28">
>>u.birthday = Time.now
=> Wed Apr 20 00:15:55 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-04-20 00:15:55", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:15:59">
>>u.birthday = nil
=> nil
>>u.save
u.save
=> true
?>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: nil, created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:16:57">
>>u.birthday = true
=> true
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:20:33">
d.其他类型到time
>>u.created_at = "abc"
=> "abc"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.created_at = 12
=> 12
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.created_at = nil
=> nil
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.created_at = true
=> true
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.birthday = false
=> false
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: false, created_at: nil, updated_at: "2011-04-19 16:30:37">
>>u.created_at = "2011-01-25"
=> "2011-01-25"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "2011-01-25 00:00:00", updated_at: "2011-04-19 16:32:28">
>>u.created_at = "2011-02-25 17:28:32"
=> "2011-02-25 17:28:32"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "2011-02-25 17:28:32", updated_at: "2011-04-19 16:32:51">
>>u.created_at = Date.new
=> Mon, 01 Jan -4712
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "-4713-12-31 16:00:00", updated_at: "2011-04-19 16:33:15">
>>u.created_at = Time.now
=> Wed Apr 20 00:33:30 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "2011-04-19 16:33:30", updated_at: "2011-04-19 16:33:40">
>>u.created_at = nil
=> nil
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: nil, updated_at: "2011-04-19 16:34:29">
1.我们创建一个对象,直接保存到数据库,会是什么情况?
完整文字 id(integer) name(string) sex(string) age(integer) birthday(date) created_at(time) updated_at(time)
编辑 删除 1 NULL NULL NULL NULL 2011-04-19 15:32:39 2011-04-19 15:32:39
2.我们从数据库直接读出来会是什么结果呢?
#<User id: 7, name: nil, sex: nil, age: nil, birthday: nil, created_at: "2011-04-19 15:32:39", updated_at: "2011-04-19 15:32:39">
3.如果我们设置了默认值,重复上面的步骤会是什么结果呢?
完整文字 id name sex age birthday created_at updated_at
编辑 删除 1 NULL 男 0 2011-01-31 2011-04-19 15:42:40 2011-04-19 15:42:40
#<User id: 1, name: nil, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:42:40", updated_at: "2011-04-19 15:42:40">
4.我们来做测试下的操作
测试的日志:
a.其他类型(string,integer,date,time,array,hash,nil)到string
>>u = User.new
u = User.new
=> #<User id: nil, name: nil, sex: "男", age: 0, birthday: "2011-01-31", created_at: nil, updated_at: nil>
?>u.name = "abc"
=> "abc"
>>u
=> #<User id: nil, name: "abc", sex: "男", age: 0, birthday: "2011-01-31", created_at: nil, updated_at: nil>
>>u.name = 100
=> 100
>>u
=> #<User id: nil, name: 100, sex: "男", age: 0, birthday: "2011-01-31", created_at: nil, updated_at: nil>
>>u.name.class
=> Fixnum
>>Date.now
NoMethodError: private method `now' called for Date:Class
from (irb):10
>>Date.new
=> Mon, 01 Jan -4712
>>u.name = Date.new
=> Mon, 01 Jan -4712
>>u.save
=> true
>>u
=> #<User id: 2, name: "-4712-01-01", sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:55:15">
>>u.name.class
=> Date
>>u.name = Time.now
=> Tue Apr 19 23:56:59 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: "2011-04-19 23:56:59", sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:57:06">
>>u.name.class
=> Time
>>u.name = ["a","b","c"]
=> ["a", "b", "c"]
>>u.save
=> true
>>u
=> #<User id: 2, name: ["a", "b", "c"], sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:58:19">
>>u.name.class
=> Array
>>u
=> #<User id: 2, name: ["a", "b", "c"], sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:58:19">
>>u.name = {:a => "a",:b => "b",:c => "c"}
=> {:c=>"c", :a=>"a", :b=>"b"}
>>u.save
=> true
>>u
=> #<User id: 2, name: {:c=>"c", :a=>"a", :b=>"b"}, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:59:48">
>>u.name.class
=> Hash
>>u.name
=> {:c=>"c", :a=>"a", :b=>"b"}
>>u.name = nil
=> nil
>>u
=> #<User id: 2, name: nil, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 15:59:48">
>>u.save
=> true
>>u.name
=> nil
>>u.name = true
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:01:27">
>>u.name.class
=> TrueClass
b.其他类型到integer
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:01:27">
>>u.age = "abc"
=> "abc"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:06:33">
>>u.age = 12.6
=> 12.6
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 12, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:07:14">
>>u.age = Date.new
=> Mon, 01 Jan -4712
>>u.save
u.save
=> true
?>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:08:17">
>>u.age = Time.now
=> Wed Apr 20 00:08:50 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1303229330, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:08:56">
>>u.age = ['a','b','c']
=> ["a", "b", "c"]
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:09:29">
>>u.age = {"a" => "aa","b" => "bb","c" => "cc"}
=> {"a"=>"aa", "b"=>"bb", "c"=>"cc"}
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:09:29">
>>u.age = nil
=> nil
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: nil, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:10:47">
>>u.age = true
=> true
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 1, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:11:13">
>>u.age = false
=> false
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-31", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:11:13">
c.其他类型到Date
>>u.birthday = 120
=> 120
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: nil, updated_at: "2011-04-19 16:31:49">
>>u.birthday = "abcdef"
=> "abcdef"
>>u.birthday
u.birthday
=> nil
?>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: nil, created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:16:57">
>>u.birthday = "2011-01-25"
=> "2011-01-25"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-01-25", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:13:12">
>>u.birthday = "2011-02-25 17:28:32"
=> "2011-02-25 17:28:32"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-02-25", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:14:19">
>>u.birthday = Date.new
u.birthday = Date.new
=> Mon, 01 Jan -4712
?>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "-4712-01-01", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:15:28">
>>u.birthday = Time.now
=> Wed Apr 20 00:15:55 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: "2011-04-20 00:15:55", created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:15:59">
>>u.birthday = nil
=> nil
>>u.save
u.save
=> true
?>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: nil, created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:16:57">
>>u.birthday = true
=> true
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: "2011-04-19 15:55:15", updated_at: "2011-04-19 16:20:33">
d.其他类型到time
>>u.created_at = "abc"
=> "abc"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.created_at = 12
=> 12
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.created_at = nil
=> nil
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.created_at = true
=> true
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: true, created_at: nil, updated_at: "2011-04-19 16:23:27">
>>u.birthday = false
=> false
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: false, created_at: nil, updated_at: "2011-04-19 16:30:37">
>>u.created_at = "2011-01-25"
=> "2011-01-25"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "2011-01-25 00:00:00", updated_at: "2011-04-19 16:32:28">
>>u.created_at = "2011-02-25 17:28:32"
=> "2011-02-25 17:28:32"
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "2011-02-25 17:28:32", updated_at: "2011-04-19 16:32:51">
>>u.created_at = Date.new
=> Mon, 01 Jan -4712
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "-4713-12-31 16:00:00", updated_at: "2011-04-19 16:33:15">
>>u.created_at = Time.now
=> Wed Apr 20 00:33:30 +0800 2011
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: "2011-04-19 16:33:30", updated_at: "2011-04-19 16:33:40">
>>u.created_at = nil
=> nil
>>u.save
=> true
>>u
=> #<User id: 2, name: true, sex: "男", age: 0, birthday: 120, created_at: nil, updated_at: "2011-04-19 16:34:29">
发表评论
-
Diaspora 功能特性列表
2013-05-10 14:25 1032Diaspora Function Features List ... -
rails scaffold getting the column list from existing table
2011-09-23 10:02 925之前一直找这个问题的解决办法,但一直没找到,在g上看到了一个人 ... -
ruby语法-传值
2011-08-23 16:49 1061=begin def test1(*a) p a.firs ... -
Rails 3 用 JQuery 替代 Prototype
2011-07-28 22:48 11401.进入到工程目录中修改Gemfile文件,加入如下行: g ... -
Generate a list of Rails controllers and methods
2011-07-01 17:40 862列出项目中的controler和他对应的actions: @c ... -
Ubuntu手动安装JDK
2011-05-20 16:03 580Ubuntu手动安装JDK 安装前可以查看一下jdk版本,进 ... -
bundler
2011-04-25 12:12 835Rails3里多了个Bundler工具。 它是一个Librar ... -
RubyGem version error: rack(1.0.0 not ~> 1.0.1)
2011-04-17 00:09 1366I have this error when I try to ... -
rubyonrails Restful Authentication 插件
2011-04-17 00:01 818restful_authentication是Rails的一个 ... -
XP.CMD命令大全
2011-04-17 00:00 641有关某个命令的详细信 ... -
几个有用的方法
2011-04-16 23:58 594hash.invert Returns a new hash ... -
Firefox键盘快捷方式
2011-04-16 23:55 1223Firefox键盘快捷方式 键盘快捷健 下面是 Mozil ... -
Ubuntu手动安装JDK
2011-04-16 23:53 739Ubuntu手动安装JDK 安装前可以查看一下jdk版本,进 ... -
字符转时间格式转换成时间对象
2011-04-16 23:52 789Time.parse("Wed, 23 Jan 20 ... -
使用Rails时遇到了服务器启动问题 script/server:3
2011-04-16 23:47 1296境 Windows Vista Home Premium c ... -
DoDirectPayment
2011-04-16 23:44 1006DoDirectPayment 1. DoDirectPay ... -
Rails异常处理
2011-04-16 23:43 967异常处理是开发过程中 ... -
ruby和rails中的回调函数
2011-04-16 23:41 1892Ruby中Class,Object,Module这三个类定义了 ... -
深入理解alias, alias_method和alias_method_chain
2011-04-16 23:41 896对 于alias, alias_method, alias_m ... -
Rails3:使用bundler管理gems
2011-04-16 23:39 1404bundler是一套为了 Rails3 所打造的全新 Gem ...
相关推荐
本篇研究文献主要讨论了分光计测量最小偏向角的实验原理以及在数据处理方面的改进。研究中指出,传统的实验方法存在一些不足,例如,在使用等边三棱镜时,找到最小偏向角的位置较为容易,但实际科研和实验中常用的...
"小计天空源码"是一个基于ASP...通过研究"小计天空源码",开发者可以学习到如何构建和维护一个ASP网站,理解服务器端脚本的工作原理,以及如何与数据库进行交互。同时,对于ASP的实践经验和技能提升也是非常有帮助的。
在现代生物技术研究中,小球藻因其快速的生长速度、较高的营养价值以及易于培养的特性,成为了研究的焦点之一。小球藻(Chlorella vulgaris Beij)属于绿藻门、绿藻纲、绿球藻目、卵囊藻科、小球藻属。其细胞内富含...
算机的重要分支,单片机体积小,功能强大,价格低廉,使用方便,发展迅速,在 工业生产中得到了广泛的应用。 有鉴于此,本文将利用微电子技术对泵缸复合流量计样机的测试系统进行改进, 利用单片机对无载液压缸两测...
标题“小计天空黑白版 v2.03”暗示我们正在处理一个名为“小计天空”的软件或应用程序的特定版本,即v2.03,它可能是以黑白风格设计的。这种版本通常代表着软件的更新迭代,可能包含了性能优化、新功能的添加或者...
描述中的知识点:从描述中可得知,激光抽运型原子磁强计相较于传统磁强计有体积小、功耗低及灵敏度高的优势。工作原理部分阐述了激光抽运Mz型原子磁强计的操作方式,包括激光功率和射频场强度对磁共振信号的影响。...
噪声的存在很容易掩盖实际的介损角,尤其是在介损角较小的情况下。为此,本文提出了一种基于离散频谱对称插值算法来计算电压和电流的基波相位角,进而通过电压与电流基波相位差来实现介损角的测量。 除此之外,为...
【小计天空 v5.07 紫色恋人】是一款专为女性用户设计的个人主页模板,它的核心特点是采用了紫色作为主色调,营造出一种既优雅又不失童真的氛围,展现出独特的美感和高雅气质。这款个人主页设计充分考虑了女性用户的...
研究结果显示,与传统的最小二乘法相比,小波神经网络在处理加速度计非线性温度漂移问题上具有更优越的性能。通过小波神经网络,能够更精确地拟合加速度计的温度漂移曲线,有效补偿温度变化引起的输出漂移。特别是在...
针对这一挑战,研究者们提出并设计了一种小型分布式光色度计,旨在精确测量LED光源的空间光度和色度分布,以确保照明产品的质量和用户体验。 在文章《低功率LED光源的小型分布式光色度计研究》中,首先概述了LED...
涡街流量计因其介质适应性强、无可动部件、结构简单、可靠性高、压力损失小、使用寿命长等优点,在众多行业获得了广泛应用。然而,在低流速和管道振动条件下,涡街流量计易受噪声影响,测量精度和量程比受到限制。...
非集计方法直接利用调查得到的个人数据来构造模型,其样本容量相对较小,不需要对个人原始资料进行复杂的处理。而集计方法则是以交通分区为研究单位,将分区内的个人或家庭调查数据进行统计处理,如求平均值、求比例...
本文探讨了基于激光测距仪与里程计融合定位技术的变电站智能巡检机器人的研究,涉及了智能巡检机器人在变电站巡检工作中的定位技术,并对其可行性进行了研究。在变电站巡检机器人中,定位功能是实现机器人智能巡检的...
"小计天空快递跟踪系统 v1.04"是一款专为快递公司设计的跟踪系统,旨在提高物流行业的服务质量和效率。这款系统的核心功能是让快递公司能够通过专业的输单人员输入快件信息,随后客户就能在线实时查询他们的包裹状态...
当前市场上的光功率计存在价格高和精度低的问题,为此陈卓、吴巍两位研究人员提出了一种新的设计方案,旨在提高测量精度的同时大幅度降低功耗。 设计方案中提出了多种技术要点,包括了AD转换器、单片机模块、ICL...
计及分布式电源的配电网储能配置研究 本研究探讨了分布式电源对配电网的影响,并分析了储能装置对配电网的影响。为确保配电网的安全运行,需要配置相应的储能装置。通过建立多目标函数模型,考虑了配电网节点电压...