Skip to content

Commit 4b06a75

Browse files
committed
delete article go_rust_toolchain
1 parent 4165ad3 commit 4b06a75

40 files changed

+79
-140
lines changed

2019/10/ruby_restudy.md 2019/10/learn_ruby.md

+10-55
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
# [再次学习Ruby](/2019/10/ruby_restudy.md)
1+
# [再次学习Ruby](/2019/10/learn_ruby.md)
22

3-
以前在soloLearn上面学过一次ruby,虽然后面mixin等学得一知半解
3+
以前在soloLearn上面学过一次ruby,虽然后面mixin等学得一知半解,而且也没metaprogramming, unittest等高级内容的介绍
44

5-
很多ruby岗位的JD上面都提到metaprogramming(元编程),好像soloLearn的课程没有介绍
5+
如今由于工作需要再次学习rails(以前看软件那些事的视频曾经学过一次)
66

7-
如今由于工作需要再次学习rails,回顾一下曾经用过的资料:
8-
9-
- 官方API文档
10-
- 软件那些事出过的几集ruby视频
11-
- 台湾高見龍的「為你自己學 Ruby on Rails」
12-
- https://guides.rubyonrails.org/getting_started.html
7+
现在回头来看还是高見龍的「為你自己學 Ruby on Rails」讲的最好
138

149
打算就先按高見龍的教程过一遍,等我熟悉rails后再把默认的模板引擎换成vuejs
1510

16-
## 试着用scoop安装rails
17-
18-
scoop就不适合安装这种依赖复杂的cli软件,毕竟scoop安装ruby的时候就提示我要额外安装这个那个的依赖
19-
20-
ruby本身就对非UnixLike系统不友好,windows只能用官方推荐的【rubyInstaller】进行安装
21-
22-
而且安装完后win10还会有gem install sqlite的问题,可以参照[medium上这篇文章去解决](https://medium.com/@declancronje/installing-and-troubleshooting-ruby-on-rails-sqlite3-windows-10-fix-87c8886d03b)
23-
2411
## 学习目标
2512

2613
最终完成一个Rails+Vue的在线做题网站,数据库就用SQLite就行了。
@@ -29,26 +16,24 @@ ruby本身就对非UnixLike系统不友好,windows只能用官方推荐的【r
2916

3017
关于标准指法,根据typeclub.com的测试结果我标准指法只有7WPM的速度,而同样100%正确率自己习惯的打法速度在50-60WPM之间,而且我能盲打很熟悉每个键的位置,参考[v2ex.com/t/221161](https://www.v2ex.com/t/221161),指法问题先放下。
3118

19+
---
20+
3221
## ruby元编程API
3322

3423
### define_method
3524

36-
TODO
25+
个人感觉不如Rust普通宏定义方法来的灵活
3726

3827
### send API
3928

40-
send的作用是将字符串的运算符给eval了,
29+
send能将入参字符串当作运算符给eval了
4130

42-
例如:
31+
例如:1.send ">", 2 # false
4332

44-
> 1.send ">", 2 # false
45-
46-
> 1.send "<", 2 # true
33+
---
4734

4835
## ruby运算回顾
4936

50-
ruby的多行注释是在=begin和=end之间
51-
5237
```ruby
5338
# ruby常量ID以大写字母开头
5439
class Calc
@@ -120,18 +105,6 @@ ruby的class method的前缀是self.
120105

121106
常量以大写字母开头,內容是可以修改的,
122107

123-
```ruby
124-
age = 18
125-
126-
def age
127-
20
128-
end
129-
130-
# 局部变量和方法名冲突时,优先局部变量
131-
puts age # 18
132-
puts age # 20
133-
```
134-
135108
### hash and symbol
136109

137110
ruby的键通常都用不可变immutable字符串Symbols表示,如:age
@@ -154,20 +127,6 @@ hash1.each { |key, value|
154127
155128
### ruby.block-yield
156129

157-
如果想要讓附掛的 Block 執行,可使用 yield 方法,暫時把控制權交棒給 Block,
158-
等 Block 執行結束後再把控制權交回來:
159-
```ruby
160-
def say_hello
161-
puts "開始"
162-
yield 123 # 把控制權暫時讓給 Block,並且傳數字 123 給 Block
163-
puts "結束"
164-
end
165-
166-
say_hello { |x| # 這個 x 是來自 yield 方法
167-
puts "這裡是 Block,我收到了 #{x}"
168-
}
169-
```
170-
171130
```ruby
172131
#自己实现.select方法/过滤器
173132
def pick(list)
@@ -177,10 +136,6 @@ hash1.each { |key, value|
177136
end
178137
result
179138
end
180-
181-
p pick([*1..10]) { |x| x % 2 == 0 } # => [2, 4, 6, 8, 10]
182-
p pick([*1..10]) { |x| x < 5 } # => [1, 2, 3, 4]
183-
184139
```
185140

186141
p([*1..10].map) do |i| i * 2 end

2019/10/mac_init.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [mac init(配置等)](/2019/10/mac_init.md)
22

3-
相关文章 - [禁用option/alt键的特殊符号](/2019/11_2/ukelele/disable_alt_symbol_ukelele)
3+
相关文章 - [禁用option/alt键的特殊符号](/2019/11/ukelele/disable_alt_symbol_ukelele)
44

55
公司给我配的mbp到了,记录下配置开发环境的过程
66

@@ -14,11 +14,9 @@
1414

1515
主题改为pro,字体大小改为16,设置选项里`Use Option As Metakey`
1616

17-
### ~~启用root用户
17+
### ~~启用root用户~~
1818

19-
mac和linux的权限管理不太一样,mac10.15的普通用户在terminal上加上sudo就够用了,没必要创建root用户
20-
21-
~~[HowtoGeek的启用root用户教程](https://www.howtogeek.com/howto/35132/how-to-enable-the-root-user-in-mac-os-x/)~~
19+
sudo基本能解决99%需要root权限的场合,没必要启用root用户
2220

2321
### gcc/cli_tools
2422

@@ -46,10 +44,6 @@ mac和linux的权限管理不太一样,mac10.15的普通用户在terminal上
4644

4745
> defaults write com.apple.systempreferences AttentionPrefBundleIDs 0
4846
49-
> killall Dock
50-
51-
但这个不是最有效的方法,根本上停止更新可通过ignore
52-
5347
#### ignore Update
5448

5549
> [!NOTE|label:ignoreCatalinaUpdate]

2019/11_2/account_first.md 2019/11/account_first.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [account.first](/2019/11_2/account_first.md)
1+
# [account.first](/2019/11/account_first.md)
22

33
## where之后想取数据要加first
44

2019/11_2/active_record_association.md 2019/11/active_record_association.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [ActiveRecord关联的命名约定/规范](/2019/11_2/active_record_association.md)
1+
# [ActiveRecord关联的命名约定/规范](/2019/11/active_record_association.md)
22

33
[belongs_to - apidock](https://apidock.com/rails/ActiveRecord/Associations/ClassMethods/belongs_to)
44

File renamed without changes.

2019/11_2/checkbox_jquery_validate.md 2019/11/checkbox_jquery_validate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [jQuery验证checkbox](/2019/11_2/checkbox_jquery_validate.md)
1+
# [jQuery验证checkbox](/2019/11/checkbox_jquery_validate.md)
22

33
相关文章 - [model数据验证与消息闪现(flash)](/2019/11_1/validates.md)
44

File renamed without changes.

2019/11_2/crontab.md 2019/11/crontab.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [crontab定时任务](/2019/11_2/crontab.md)
1+
# [crontab定时任务](/2019/11/crontab.md)
22

33
## CRON表达式
44

File renamed without changes.
File renamed without changes.

2019/11_2/k-line-vue.md 2019/11/k_line.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# [k线画图工具(基于vue)](2019/11_2/k-line-vue)
1+
# [怎么看懂k线图](/2019/11/k_line.md)
22

3-
## 股票k线图知识
4-
5-
[维基百科]()搜索`Candlestick Charts`可以找到相关词条
3+
维基百科搜索`Candlestick Charts`可以找到相关词条
64

75
[火币的币币交易](https://www.huobi.com/en-us/exchange/)为模板进行讲解
86

@@ -26,7 +24,11 @@
2624

2725
- MA=Moving Average
2826

29-
## vue.config.js::devServer.proxy
27+
---
28+
29+
由于要接手公司某个k线图相关的项目,所以要临时补下k线图相关知识
30+
31+
vue.config.js::devServer.proxy
3032

3133
> [!NOTE|label:作用]
3234
> 将 没匹配到静态文件的请求 代理到该字段指向的地方
@@ -47,6 +49,4 @@ module.exports = {
4749
}
4850
```
4951

50-
## $http
51-
5252
在main.js中引入 vue-resource 就可以全局使用$http
File renamed without changes.
File renamed without changes.
File renamed without changes.

2019/11_2/puma_production.md 2019/11/puma_production.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [puma服务器生产环境与开发环境的区别](/2019/11_2/puma_production.md)
1+
# [puma服务器生产环境与开发环境的区别](/2019/11/puma_production.md)
22

33
<i class="fa fa-hashtag"></i>
44
不会自动编译css和js代码
File renamed without changes.

2019/11_2/rubymine_not_recognize_rb.md 2019/11/rubymine_not_recognize_rb.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [rubymine无法识别ruby文件](/2019/11_2/rubymine_not_recognize_rb.md)
1+
# [rubymine无法识别ruby文件](/2019/11/rubymine_not_recognize_rb.md)
22

33
在rubymin新建.rb文件有时候不会被识别为ruby文件
44

File renamed without changes.

2019/11_2/try_return_nil.md 2019/11/try_return_nil.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [返回CSV更友好的nil如果对象不存在](/2019/11_2/try_return_nil.md)
1+
# [返回CSV更友好的nil如果对象不存在](/2019/11/try_return_nil.md)
22

33
常用的判断对象/属性存在的方法:
44

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

2019/11_2/ukelele/disable_alt_symbol_ukelele.md 2019/11/ukelele/disable_alt_symbol_ukelele.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [禁用option/alt键的特殊符号](/2019/11_2/ukelele/disable_alt_symbol_ukelele.md)
1+
# [禁用option/alt键的特殊符号](/2019/11/ukelele/disable_alt_symbol_ukelele.md)
22

33
相关文章 - [mac init(配置等)](2019/10/mac-init)
44

2019/11_1/validates.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [model数据验证与消息闪现(flash)](/2019/11_1/validates.md)
22

3-
相关文章 - [jQuery验证checkbox](/2019/11_2/checkbox_jquery_validate.md)
3+
相关文章 - [jQuery验证checkbox](/2019/11/checkbox_jquery_validate.md)
44

55
## Models中同时验证多个字段
66

2019/12_2/association_without_primary_key.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<i class="fa fa-hashtag"></i>
44
相关文章
55

6-
[ActiveRecord关联的命名约定/规范](/2019/11_2/active_record_association.md)
6+
[ActiveRecord关联的命名约定/规范](/2019/11/active_record_association.md)
77

88
```ruby
99
# 出现N+1查询问题的代码

2019/12_2/includes_same_table_twice.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<i class="fa fa-hashtag"></i>
44
相关文章
55

6-
[ActiveRecord关联的命名约定/规范](/2019/11_2/active_record_association.md)
6+
[ActiveRecord关联的命名约定/规范](/2019/11/active_record_association.md)
77

88
<i class="fa fa-hashtag"></i>
99
问题重现

2020/05/go_new_project.png

-32.8 KB
Binary file not shown.

2020/05/go_rust_toolchain.md

-37
This file was deleted.

SUMMARY.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
- [异步时死锁的解决办法](/2020/05/async_mutex_deadlock.md)
4848
- [sqlx教程](/2020/05/sqlx_tutorial.md)
4949
- [sqlx项目提PR修正文档](/2020/05/pr_to_sqlx_document.md)
50-
- [Go/Rust语言工具介绍](/2020/05/go_rust_toolchain.md)
5150
- [chrono不能连用两个local](/2020/05/rust_chrono_dual_local_ub.md)
5251
- [rust BigDecimal最佳实践](/2020/05/rust_bigdecimal.md)
5352
- [diesel给mysql加锁](/2020/05/diesel_mysql_lock.md)
@@ -124,21 +123,21 @@
124123
- [元编程 - 类似eval的constantize](/2019/12_1/constantize_eval.md)
125124
- [rails变量命名驼峰式与小写下划线互相转换](/2019/12_1/rails_camel_case.md)
126125
- **1911下旬**
127-
- [返回CSV更友好的nil如果对象不存在](/2019/11_2/try_return_nil.md)
128-
- [禁用option/alt键的特殊符号](/2019/11_2/ukelele/disable_alt_symbol_ukelele.md)
129-
- [puma服务器生产环境与开发环境的区别](/2019/11_2/puma_production.md)
130-
- [rubymine无法识别ruby文件](/2019/11_2/rubymine_not_recognize_rb.md)
131-
- [jQuery验证checkbox](/2019/11_2/checkbox_jquery_validate.md)
132-
- [ActiveRecord关联的命名约定/规范](/2019/11_2/active_record_association.md)
133-
- [统计有记录的交易对](/2019/11_2/select-distinct.md)
134-
- [linear-gradient](/2019/11_2/linear-gradient-warn.md)
135-
- [link_to merge参数时报错DEPRECATION](/2019/11_2/link_to-merge-warning.md)
136-
- [涉及钱的操作要加事务处理和线程锁](/2019/11_2/data-lock.md)
137-
- [k线画图工具(基于vue)](/2019/11_2/k-line-vue.md)
138-
- [account.first](/2019/11_2/account_first.md)
139-
- [crontab定时任务](/2019/11_2/crontab.md)
140-
- [如何打彩色log与单步调试](/2019/11_2/rails-debug-log.md)
141-
- [Add Default Constraint](/2019/11_2/add-default-constraint.md)
126+
- [返回CSV更友好的nil如果对象不存在](/2019/11/try_return_nil.md)
127+
- [禁用option/alt键的特殊符号](/2019/11/ukelele/disable_alt_symbol_ukelele.md)
128+
- [puma服务器生产环境与开发环境的区别](/2019/11/puma_production.md)
129+
- [rubymine无法识别ruby文件](/2019/11/rubymine_not_recognize_rb.md)
130+
- [jQuery验证checkbox](/2019/11/checkbox_jquery_validate.md)
131+
- [ActiveRecord关联的命名约定/规范](/2019/11/active_record_association.md)
132+
- [统计有记录的交易对](/2019/11/select-distinct.md)
133+
- [linear-gradient](/2019/11/linear-gradient-warn.md)
134+
- [link_to merge参数时报错DEPRECATION](/2019/11/link_to-merge-warning.md)
135+
- [涉及钱的操作要加事务处理和线程锁](/2019/11/data-lock.md)
136+
- [怎么看懂k线图](/2019/11/k_line.md)
137+
- [account.first](/2019/11/account_first.md)
138+
- [crontab定时任务](/2019/11/crontab.md)
139+
- [如何打彩色log与单步调试](/2019/11/rails-debug-log.md)
140+
- [Add Default Constraint](/2019/11/add-default-constraint.md)
142141
- **1911上旬**
143142
- [grape接口服务器](/2019/11_1/grape.md)
144143
- [提高百万行记录count的速度](2019/11_1/millions-count.md)
@@ -151,7 +150,7 @@
151150
- [同时热重载(livereload)多个网页](/2019/10/multi_livereload.md)
152151
- [仿京东移动端网页中遇到的问题](/2019/10/jd_vue_problem.md)
153152
- [rails步骤记录](/2019/10/rails_step.md)
154-
- [再次学习Ruby](/2019/10/ruby_restudy.md)
153+
- [再次学习Ruby](/2019/10/learn_ruby.md)
155154
- [chrome78开始支持dark mode](/2019/10/chrome_dark_mode.md)
156155
- **VIM**
157156
- [vim复习](/archive/vim/vim_review.md)

archive/intellij_idea/idea.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ DataGrip中cmd+Alt+O能搜索表的字段名,不过不能区分表名
9797

9898
## idea无法识别message.rs文件
9999

100-
参考 [rubymine无法识别ruby文件](/2019/11_2/rubymine_not_recognize_rb.md)0.0n
100+
参考 [rubymine无法识别ruby文件](/2019/11/rubymine_not_recognize_rb.md)0.0n

notes/linux/linux_shell_command.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
## 搜索文本
1010

11-
> ag -G '\.rs$' 'dyn ' [.]
11+
> ag -G '\.rs$' 'dyn ' .
1212
1313
> grep -r --include=\*.rs 'dyn ' .
1414

notes/rust/channel.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 探索std::mpsc或crossbeam的channel的应用
2+
3+
## 跨线程传递/共享指针
4+
5+
通过通道传递指针,保证同时只能有一个线程能取指针,取完再返回
6+
7+
听上去跟Mutex或所有权里的同时只能有一个可变借用和无数个不可变借用类似

unarchived/abbreviation.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- conn -> connection
66
- ret -> return_value, 常见于leetcode题解,题解的返回值的变量名通常都用ret或ans,用res容易和Rust的Result产生歧义
77
- _ext suffix: ext=extension, 例如futures_ext crate,例如B和C结构体"继承"了A,而且B和C在A的字段基础上多了一些字段,此时可以将B和C命名为A的a_ext
8+
- COMM -> command, 例如I2C通信协议的命令COMMAND: TM1637_I2C_COMM1
89

910
### _opt suffix
1011

unarchived/paperwork.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111

1212
## RustConf2020 topic
1313

14-
Topic 名称: Play Rust with leetcode (TODO?)
15-
Topic 简介: TODO
14+
Topic 中文名称: 浅谈Rust在算法题和竞赛中的应用
15+
Topic 英文名称: Play Rust in programming competition
16+
Topic 简介: Rust工程性和开发效率会给codeforces上刷算法题或leetcode周赛竞赛中的带来哪些优势?
1617
Speaker 名称: 吴翱翔
1718
Speaker 简介: tokio-postgres,sqlx,bigdecimal-rs等库的代码贡献者,saks库的作者,leetcode刷题量400+
1819
Speaker 公司: Rust中文社区

0 commit comments

Comments
 (0)