section30+31

terminal

1. fasr than GUI

2. access: the terminal provides a mainline into the heart of our computer, give us access to area we normally dont interact with.

3. tools: tools are installed and used via command line

shell

the program runnign on the terminal

举的例子: ATM取钱 ATM是terminal, ATM里的软件是shell

Bash: one of the most popular shells ( and the default on a mac)

常用命令

ls:list~

pwd( print working directory):快速定位在哪

cd(change direcotory):改位置 cd .. 回退

relative path vs absolute path

mkdir建新文件夹

man page 比如man ls 页面介绍一些flags ls可以用的

flags

touch新建文件 touch purple.txt

rm(remove) 删除文件

rmdir删除空白文件夹

rm -rf(加了这个-rf的flag)删除文件夹

section 31

Node JS

Node: A javascript runtime. Until recently, we could only run javascript in a web browser. node is javascript runtime that executes code outside of the browser.We can use the same Javascrpt syntax we know and love to write server side code, instread of relying on other languages like python or ruby.

node REPL

终端node 进入node REPL .Help 查看帮助

node firstScript.js 运行 js文件

Process & Argv

prpcess.argv

File system有两种模式 同步和异步

如果synchronous

需要用fs需要一开始在js写一行 const fs = require('fs');

const fs = require('fs')
const folderName = preocess.argv[2] ||'Project'

try{
    fs.mkdirSync(folderName);
fs.writeFileSync('${folderName}/index.html')
fs.writeFileSync('${folderName}/app.js')
fs.writeFileSync('${folderName}/app.css')
}catch(e) {
    console.log("something went wrong");
    console.log(e);
}

node xx.js Cars

section 32 Modules & the NPM universe

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
From Proposition 1, we plug ri,O = li(μ)τi into (39) and rewrite problem (38) as maximize ri,O 􏰗ai − μ li (μ) − Yi(t)g [li(μ)]􏰘 ri,O li (μ)hi (41a) March 2, 2021 DRAFT maximize ˆr O subject to 0 ≤ ri,O ≤ Qi(t), (41b) 0, ifa − μ −Y(t)g[li(μ)] <0, subject to where the optimal solution is r∗ i,O Accordingly, we have τ∗ = r∗ ii,Oi i1 of μ in (32) as 1−􏰀i∈M1 τi∗. Then, we obtain the optimal dual variable μ∗ through the ellipsoid method (bi-section search in this case) over the range [0,∆], where ∆ is a sufficiently large value, until a prescribed precision requirement is met. Given the optimal μ∗, we denote the optimal ratio obtained from (40) as li (μ∗) 􏰝 r∗ /τ∗, i,O i ∀i ∈ M1. Notice that the optimal solution 􏰕τi∗, r∗ , ∀i ∈ M1􏰖 of the dual problem may not be i,O primal feasible. Therefore, to find a primal optimal solution to (31), we substitute τi = ri,O/li (μ∗) into (31) and simplify the problem as = i li(μ) i li(μ)hi (42) otherwise. Qi (t), /l (μ). After obtaining τ∗, ∀i ∈ M , we calculate the subgradient 􏰁 􏰗ai − Yi(t)g [li(μ∗)]􏰘 ri,O (43a) i ∈ M 1 h i l i ( μ ∗ ) 􏰁 ri,O ≤ 1, ri,O ≤ Qi(t), ∀i ∈ M1. (43b) i∈M1 li(μ∗) The above problem is a simple linear programming (LP) that can be easily solved. With a bit abuse of notation, we denote the optimal solution of (43) as ˆr∗ = 􏰕r∗ , ∀i ∈ M 􏰖 and retrieve 20 the optimal solution to (31) as τ∗=r∗ /l(μ∗),e∗ =τi∗g[li(μ∗)],∀i∈M. (44) i i,O i i,O hili(μ∗) 1 Denote τˆ∗ = {τi∗,∀i ∈ M1} and ˆe∗O = 􏰕e∗i,O,∀i ∈ M1􏰖. As {τˆ∗,ˆe∗O,ˆr∗O,μ∗} satisfies the KKT conditions, {τˆ∗,ˆe∗O,ˆr∗O} is an optimal solution to (31). By combining the optimal solutions in (30) and (44), we obtain an optimal solution of (P4). We summarize the pseudo-code of the O i,O 1 algorithm to solve (P4) in Algorithm 2.,翻译并解释li和hi是什么
05-12

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值