fn main() {
let x = "hi"; // lifetime a.
let e; // e should have a lifetime a.
{
let y = "you"; // lifetime b.
e = check(&x, &y); // here we returned lifetime b.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## 一.引言 | |
| ### 1. 编写目的(阐明编写详细设计说明书的目的,指明读者对象。) | |
| ### 2. 项目背景(应包括项目的来源和主管部门等。) | |
| ### 3. 定义(列出文档中用到的专门术语定义和缩写词的原意。) | |
| ### 4. 参考资料(列出这些资料的作者、标题、编号、发表日期、出版单位或资料来源,可包括:(1)项目的计划任务书,合同或批文;(2)项目开发计划;(3)需求规格说明书;(3)概要设计说明书;(4)测试计划(初稿);(5)用户操作手册(初稿);(5)文档所引用的其他资料、软件开发标准或规范。) | |
| ## 二.总体设计 | |
| ### 1.需求概述 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PlaygroundSupport | |
| public func playgroundShouldContinueIndefinitely() { | |
| PlaygroundPage.current.needsInfiniteExecution = true | |
| } |
Testing JavaScript isn't just a thing you can read about in children's fairy tales.
This is just a scratch pad of everything I find. As the really good resources start to float to the top, I'll transition them to a more permanent GitHub repo.
- Test-Driven JavaScript Development [book]
- JavaScript Testing Recipes [book]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ack is a tool like grep, designed for programmers with large trees of heterogeneous source code | |
| #to install ack, see http://betterthangrep.com/ | |
| #to use ack, launch terminal (mac osx) and type 'ack <some_keywords>' | |
| #ack will search all files in the current directory & sub-directories | |
| #here's how I have my config file setup. this file is located on mac osx here | |
| # ~/.ackrc | |
| # Always sort the files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_relative "customer" | |
| require_relative "user" | |
| # context bind role to object. | |
| # by using the extend method in ruby. | |
| # now the data object has some behaviors that get from the role class(Customer). | |
| class Context | |
| def initialize(user, book) | |
| @customer, @book = user, book | |
| @customer.extend(Customer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //: Playground - noun: a place where people can play | |
| import AppKit | |
| let dateFormatter = DateFormatter() | |
| dateFormatter.dateStyle = .long | |
| dateFormatter.timeStyle = .none | |
| let dateStr = "2017-10-12" |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mr Marathi | |
| bs Bosnian | |
| ee_TG Ewe (Togo) | |
| ms Malay | |
| kam_KE Kamba (Kenya) | |
| mt Maltese | |
| ha Hausa | |
| es_HN Spanish (Honduras) | |
| ml_IN Malayalam (India) | |
| ro_MD Romanian (Moldova) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // https://medium.com/@jegnux/safe-collection-subsripting-in-swift-3771f16f883 | |
| // https://github.com/ReactiveX/RxSwift/issues/826 | |
| // | |
| import Foundation | |
| // we define a fire protocol. | |
| protocol FireProtocol { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // So associated objects just store object in anoter place, use property to | |
| // associate the object with the class object. | |
| import Foundation | |
| let data: Data? | |
| var dataKey: Void? | |
| data = Data(count: 10) | |
| data?.insert(9, at: 0) |