214. "真高興聽到這個消息"
215. "你近視幾度"
Note. 也可用 What's the prescription on your glasses? 名詞 prescription 指 "處方; 藥方", 在此指眼科醫師為矯正病人近視所診斷出的度數.
216. "五十步笑百步"
217. "他還真能掰"
218. "還不都一樣"
This is a blog to track what I had learned and share knowledge with all who can take advantage of them
A. That naughty boy is being mean to the children younger than he is.
B. We should tell him to pick on someone his own size.
A. I hear we're getting an extra couple of days of paid leave this year.
B. Really, That sure is music to my ears!
A. What's your prescription?
B. I'm -3 in my left eye and -2.5 in my right eye.
A. I think you watch too much television.
B. Well, that the pot calling the kettle black. You've been watching it with me all day!
A. Jim says he is going to become the salesman of the year at our company.
B. Well, he sure talks a good game, but I'm not sure if his sales number will beat mine.
A. Paul said he quit his job, but I think he was fired.
B. Same difference. He doesn't work at that company anymore.
scala> val arr1 = new Array[Int](5)
arr1: Array[Int] = Array(0, 0, 0, 0, 0)
scala> val arr2 = new Array[Double](5)
arr2: Array[Double] = Array(0.0, 0.0, 0.0, 0.0, 0.0)
scala> val arr2 = new Array[Char](5)
arr2: Array[Char] = Array(?, ?, ?, ?, ?)
scala> val arr2 = new Array[Boolean](5)
arr2: Array[Boolean] = Array(false, false, false, false, false)
scala> val arr2 = new Array[String](5)
arr2: Array[String] = Array(null, null, null, null, null)
scala> val arr=new Array[Array[Int]](5,5)
warning: there were deprecation warnings; re-run with -deprecation for details
arr: Array[Array[Int]] = Array(Array(0, 0, 0, 0, 0), Array(0, 0, 0, 0, 0), Array(0, 0, 0, 0, 0), Array(0, 0, 0, 0, 0), Array(0, 0, 0, 0, 0))
- Array1.scala 代碼 :
- val arr = new Array[Int](3)
- arr(0) = 10
- arr(1) = 20
- arr(2) = 30
- println(arr(0)) // 顯示 10
- println(arr(1)) // 顯示 20
- println(arr(2)) // 顯示 30
- Array2.scala 代碼 :
- val arr = new Array[Int](3)
- arr.update(0, 10)
- arr.update(1, 20)
- arr.update(2, 30)
- println(arr.apply(0)) // 顯示 10
- println(arr.apply(1)) // 顯示 20
- println(arr.apply(2)) // 顯示 30
- Array3.scala 代碼 :
- val arr = Array(10, 20, 30)
- for(i <- nbsp="" span="">0 until arr.length) { ->
- println(arr(i))
- }
- Array4.scala 代碼 :
- val arr = Array.apply(10, 20, 30)
- for(i <- arr="" nbsp="" span="">->
- println(i)
- }
- Array5.scala 代碼 :
- val arr = Array(10, 20, 30)
- arr.foreach((i: Int) => println(i))
- Array6.scala 代碼 :
- val arr = Array(10, 20, 30)
- arr.foreach(i => println(i))
- Array7.scala 代碼 :
- val arr = Array(10, 20, 30)
- arr.foreach(println)
- Array8.scala 代碼 :
- val arr = Array(10, 20, 30, 40, 50, 60)
- arr.filter(x => x > 30).foreach(println)
- Array9.scala 代碼 :
- val arr = Array(10, 20, 30, 40, 50, 60)
- arr.filter(_ > 30).foreach(println) // 逐行顯示 40、50、60
- Array10.scala 代碼 :
- val arr = Array(10, 20, 30)
- arr.map(_ + 1).foreach(println) // 逐行顯示 11、21、31
scala> val arr1 = Array(10, 20, 30)
arr1: Array[Int] = Array(10, 20, 30)
scala> val arr2 = Array(40, 50, 60)
arr2: Array[Int] = Array(40, 50, 60)
scala> val arr3 = (arr1 ++ arr2)
arr3: Array[Int] = Array(10, 20, 30, 40, 50, 60)
scala> arr3.foreach(x => print(x + " ")); println()
10 20 30 40 50 60
scala> val arr1 = Array(10, 20, 30)
arr1: Array[Int] = Array(10, 20, 30)
scala> val arr2 = Array(10, 20, 30)
arr2: Array[Int] = Array(10, 20, 30)
scala> arr1 == arr2
res1: Boolean = false
scala> arr1 deepEquals arr2
warning: there were 1 deprecation warnings; re-run with -deprecation for details
res2: Boolean = true
scala> arr1.deep
res3: IndexedSeq[Any] = Array(10, 20, 30)
scala> arr2.deep
res4: IndexedSeq[Any] = Array(10, 20, 30)
scala> arr1.deep.equals(arr2.deep)
res5: Boolean = true
Tangent: In my opinion, understanding how a technology works under the hood is the best way to achieve learning speed and to build confidence that you are using the tool in the correct way. Often a technology is released with a certain breathless and hype that make it difficult to really understand appropriate usage patterns. More specifically, technology releases often develop an abstraction model that can invent new terminologies and metaphors that might be useful at first, but make it harder to develop mastery in latter stages.
A good example of this is Git. I could not gain traction with Git until I understood its underlying model, including trees, blobs, commits,tags, tree-ish, etc. I had written about this before in a previous post, and still remain convinced that people who don't understand the internals of Git cannot have true mastery of the tool.
Takeaway: A container is defined only as a read-write layer atop an image (of read-only layers itself). It does not have to be running.
# find / -name happiness.txt
/var/lib/docker/aufs/diff/860a7b...889/happiness.txt
At this time (and I'm fully aware that the docker developers could change the implementation), the metadata for an image (read-only) layer can be found in a file called "json" within /var/lib/docker/graph at the id of the particular layer:
/var/lib/docker/graph/e809f156dc985.../json
where "e809f156dc985..." is the elided id of the layer.
The metadata for a container seems to be broken into many files, but more or less is found in /var/lib/docker/containers/where is the id of the read-write layer. The files in this directory contain more of the run-time metadata needed to expose a container to the outside world: networking, naming, logs, etc.
Continuing with the aforementioned similarity to understanding the Git system, I consider the 'docker run' command to be similar to the 'git pull'. Like 'git pull' (which is a combination of 'git fetch' and 'git merge') the 'docker run' is a combination of two underlying commands that have meaning and power on their own. In this sense it is certainly convenient, but potentially apt to create misunderstandings.
Source From Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 # git clean -d -fx 方案2: 今天在服务器上 gi...