Friday, 30 November 2012
Friday, 17 August 2012
Strategy Simulation
Strategy Simulation is to solve:
(1) Predictable Congestion
(2) Unpredictable Incidents
=================
WHY Congestions?
(1) Drivers' decisions conflict with each other.
Mode Choice, Departure Time, Route Choice.
(2) Capacity is limited.
Speed - Density - Function => Low Speed & Low Flow
(3) What should be done.
Gradually guide people outside.
Something:
(1) We know WHY Congestion Happen.
(2) Number of Vehicles - << Estimation Function -<< Simulation Prove;
(3) Balance between Level-of-Service and Diverge-Count;
(4) Both Sources (More) & Destinations
================
WHY Incidents?
(1) Something wrong happen?
Something:
================
(1) There are some delays, things already happen.
(2) Both Sources & Destinations (More)
(1) Predictable Congestion
(2) Unpredictable Incidents
=================
WHY Congestions?
(1) Drivers' decisions conflict with each other.
Mode Choice, Departure Time, Route Choice.
(2) Capacity is limited.
Speed - Density - Function => Low Speed & Low Flow
(3) What should be done.
Gradually guide people outside.
Something:
(1) We know WHY Congestion Happen.
(2) Number of Vehicles - << Estimation Function -<< Simulation Prove;
(3) Balance between Level-of-Service and Diverge-Count;
(4) Both Sources (More) & Destinations
================
WHY Incidents?
(1) Something wrong happen?
Something:
================
(1) There are some delays, things already happen.
(2) Both Sources & Destinations (More)
Sunday, 12 August 2012
GIT
1. 三种状态
代码态: -> git add
索引态: -> git commit
仓库态:
2. 对比修改
1. git diff: 查看 代码态 和 索引态 的不同;
回答:有什么修改的东西,还不在跟踪行列
2. git status: 获取整体改动的信息
Changed but not updated
已经修改了但还未 git add 的内容
Changes to be committed
已经 git add 但还未 git commit 的内容
Untracked files
增加了新文件或者在某个子目录下增加了新文件
3. 提交 git commit -a
git commit -a,这个命令可以直接提交所有修改,省去了你 git add 和 git diff 和 git
commit 的工序,可谓一条龙服务。
但是,此处有一点应该注意,那就是 git commit -a 无法把新增文件或文件夹加入进来,所以,如果你新增了文件或文件夹,那么就要老老实实的先 git add .,再 git commit 喽
4. 版本控制
git checkout experimental
复制当前branch,命名为experimental
5.合并
确保自己处于master branch
git merge XXX
6. 冲突
CONFLICT
注意:即时有冲突,实际的merge也已经结束;
需要做的是,修改master上的冲突;
然后,提交commit;
7. 删除分支
git branch -d experimental Check 是否merge
git branch -D experimental 强制删除
8. 新建GIT
#cd myproject
#git init
#git add .
#git commit
9. 小结
按我的认识,更清楚且通俗的解释就是:git 维护的代码分成三部分,“当前工作目录”<->“index file”<->git 仓库。
git commit 会将 index file 中的改变写到 git 仓库;git add 会将“当前工作目录”的改变写到“index file”;“commit -a”则
会直接将“当前工作目录”的改动同时写到“index file”和“git 仓库”。
而 git diff 的使用稍微有些复杂,大家可以看看 Lee.MaRS 对于这个命令非常精彩的分析(蓝色字部分):(在此非常
感谢 Lee.MaRS)
将 Current working directory 记为 (1)
将 Index file 记为 (2)
将 Git repository 记为 (3)
他们之间的提交层次关系是 (1) -> (2) -> (3)
git add 完成的是(1) -> (2)
git commit 完成的是(2) -> (3)
git commit -a 两者的直接结合
从时间上看,可以认为(1)是最新的代码,(2)比较旧,(3)更旧
按时间排序就是 (1) <- (2) <- (3)
git diff 得到的是从(2)到(1)的变化
git diff –cached 得到的是从(3)到(2)的变化
git diff HEAD 得到的是从(3)到(1)的变化
代码态: -> git add
索引态: -> git commit
仓库态:
2. 对比修改
1. git diff: 查看 代码态 和 索引态 的不同;
回答:有什么修改的东西,还不在跟踪行列
2. git status: 获取整体改动的信息
Changed but not updated
已经修改了但还未 git add 的内容
Changes to be committed
已经 git add 但还未 git commit 的内容
Untracked files
增加了新文件或者在某个子目录下增加了新文件
3. 提交 git commit -a
git commit -a,这个命令可以直接提交所有修改,省去了你 git add 和 git diff 和 git
commit 的工序,可谓一条龙服务。
但是,此处有一点应该注意,那就是 git commit -a 无法把新增文件或文件夹加入进来,所以,如果你新增了文件或文件夹,那么就要老老实实的先 git add .,再 git commit 喽
4. 版本控制
git checkout experimental
复制当前branch,命名为experimental
5.合并
确保自己处于master branch
git merge XXX
6. 冲突
CONFLICT
注意:即时有冲突,实际的merge也已经结束;
需要做的是,修改master上的冲突;
然后,提交commit;
7. 删除分支
git branch -d experimental Check 是否merge
git branch -D experimental 强制删除
8. 新建GIT
#cd myproject
#git init
#git add .
#git commit
9. 小结
按我的认识,更清楚且通俗的解释就是:git 维护的代码分成三部分,“当前工作目录”<->“index file”<->git 仓库。
git commit 会将 index file 中的改变写到 git 仓库;git add 会将“当前工作目录”的改变写到“index file”;“commit -a”则
会直接将“当前工作目录”的改动同时写到“index file”和“git 仓库”。
而 git diff 的使用稍微有些复杂,大家可以看看 Lee.MaRS 对于这个命令非常精彩的分析(蓝色字部分):(在此非常
感谢 Lee.MaRS)
将 Current working directory 记为 (1)
将 Index file 记为 (2)
将 Git repository 记为 (3)
他们之间的提交层次关系是 (1) -> (2) -> (3)
git add 完成的是(1) -> (2)
git commit 完成的是(2) -> (3)
git commit -a 两者的直接结合
从时间上看,可以认为(1)是最新的代码,(2)比较旧,(3)更旧
按时间排序就是 (1) <- (2) <- (3)
git diff 得到的是从(2)到(1)的变化
git diff –cached 得到的是从(3)到(2)的变化
git diff HEAD 得到的是从(3)到(1)的变化
Wednesday, 11 July 2012
Wednesday, 4 July 2012
Search VIM
1
2.
3.
dd or :d Delete the current line. Again, you don't need to highlight it first.
4.
| Vim command | Action |
| /pattern | Search the file for pattern. |
| n | Scan for next search match in the same direction. |
| N | Scan for next search match but opposite direction. |
2.
| Replace | |
| Vim command | Action |
| :rs/foo/bar/a | Substitute foo with bar. r determines the range and a determines the arguments. |
| The range (r) can be | |
| nothing | Work on current line only. |
| number | Work on the line whose number you give. |
| % | The whole file. |
| Arguments (a) can be | |
| g | Replace all occurrences in the line. Without this, Vim replaces only the first occurrences in each line. |
| i | Ignore case for the search pattern. |
| I | Don't ignore case. |
| c | Confirm each substitution. You can type y to substitute this match, n to skip this match, a to substitute this and all the remaining matches ("Yes to all"), and q to quit substitution. |
| Examples | |
| :452s/foo/bar/ | Replace the first occurrence of the word foo with bar on line number 452. |
| :s/foo/bar/g | Replace every occurrence of the word foo with bar on current line. |
| :%s/foo/bar/g | Replace every occurrence of the word foo with bar in the whole file. |
| :%s/foo/bar/gi | The same as above, but ignore the case of the pattern you want to substitute. This replaces foo, FOO, Foo, and so on. |
| :%s/foo/bar/gc | Confirm every substitution. |
| :%s/foo/bar/c | For each line on the file, replace the first occurrence of foo with bar and confirm every substitution. |
3.
dd or :d Delete the current line. Again, you don't need to highlight it first.
4.
VIM
| :w filename | Save changes to a file. If you don't specify a file name, Vim saves as the file name you were editing. For saving the file under a different name, specify the file name. |
| :q | Quit Vim. If you have unsaved changes, Vim refuses to exit. |
| :q! | Exit Vim without saving changes. |
| :wq | Write the file and exit. |
Sunday, 1 July 2012
Subscribe to:
Posts (Atom)