摘要: 周六加班,停。周日上午复习SQL语法。 什么是档案? 所有正在执行中的程序和数据,都是放在内存(memory)之中。内存存取速度快,但是容量小而且一关机数据就不见了。 档案则是存在硬盘上,容量大但存取慢,但是关机重来还是继续保存着。 所谓的读取档案就是将数据从硬盘放进内存里面,让程序可以操作。反之写 阅读全文
posted @ 2018-01-07 16:40 Mr-chen 阅读(159) 评论(0) 推荐(0)
摘要: Object 也是一种数据类型,可以有属性,有method. 反之,在Ruby中,每一种数据类型都是Object。如String,Integer,Float,Array,Hash. IN Ruby everything is a object! http://chentianwei-blog.log 阅读全文
posted @ 2018-01-05 09:35 Mr-chen 阅读(203) 评论(0) 推荐(0)
摘要: 早上git加星了webapp的教程 > h = Hash.new('Go Fishing') => {} // 创建一个空hash,设定"Go Fishing"为默认的值。 > h['c'] => "Go Fishing" > h => {} //但并没有存入hash。仍然是空的。 创建一个空has 阅读全文
posted @ 2018-01-04 09:58 Mr-chen 阅读(263) 评论(0) 推荐(0)
摘要: 运行clone的.rb档案。用ruby name.rb 1.输入,处理,输出。 print "请输入你的\"名字\",然后按 Enter: " your_name = gets puts "hi,#{your_name}" 解释: print 输出变量在荧屏,不会换行 puts 输出变量但会换行。 阅读全文
posted @ 2018-01-01 11:32 Mr-chen 阅读(220) 评论(0) 推荐(0)
摘要: https://en.wikibooks.org/wiki/SQL_Exercises/The_computer_store 两个相连的表格 Manufactures: code, name products: code, name, price, manufacturer //黄色是关联。 15. 阅读全文
posted @ 2017-12-31 16:37 Mr-chen 阅读(308) 评论(0) 推荐(0)
摘要: Udacity: Intro to Relational Databases The syntax of the select statement with a where clause: select columns from tables where condition ; keyword + 阅读全文
posted @ 2017-12-27 11:29 Mr-chen 阅读(250) 评论(0) 推荐(0)
摘要: SQL 基础学习(2) Joining 可以同时关联(joining)多张表进行复杂的查询。 相比于用Rails捞出数据再用Ruby进行过滤组合,使用SQL更加高效,节能。 以下是 users has_many events的情景,打开DB Browser for SQLite 并新建一个文件dem 阅读全文
posted @ 2017-12-26 09:36 Mr-chen 阅读(352) 评论(0) 推荐(0)
摘要: Update_columns(attributes) //等同于update_column 直接更新database. 使用UPdate SQL 语法。 ⚠️ :忽略了validations, Callbacks. 所以速度最快。但不能更新只读属性,或called on new objects. 完 阅读全文
posted @ 2017-12-22 10:26 Mr-chen 阅读(227) 评论(0) 推荐(0)
摘要: destroy_all and delete_all Destroy the records by instantiating each record and calling its #destroy method.在删除前实例化每条记录,并回调callback execution. ⚠️ :如果想 阅读全文
posted @ 2017-12-21 09:09 Mr-chen 阅读(330) 评论(0) 推荐(0)
摘要: 1.lean guide:helper method query ,✅🍅🍅🍅🍅 2.完成2周作业,并回顾一下(25分钟)✅,🍅🍅 3.再做一遍前两周的 (选择)至少50分钟 4.回顾日记,写周总结。 5.看了guide:belongs_to ✅,🍅 Formbuilder form_f 阅读全文
posted @ 2017-12-17 09:27 Mr-chen 阅读(223) 评论(0) 推荐(0)