$ sudo gem install cocoapods
$ pod setup --verbose
| router.get { (req)-> Future<View> in | |
| let fileMgr = FileManager() | |
| guard let files = try? fileMgr.contentsOfDirectory(at: origDir, includingPropertiesForKeys: nil) else { | |
| throw Abort(.internalServerError) | |
| } | |
| let allFiles = files.map { $0.lastPathComponent } | |
| let visibleFiles = allFiles.filter { !$0.hasPrefix(".") } | |
| let context = ["files": visibleFiles] |
| let rootDir = DirectoryConfig.detect().workDir | |
| let uploadDir = URL(fileURLWithPath: "\(rootDir)Public/uploads") | |
| let origDir = uploadDir.appendingPathComponent("originals") | |
| let thumbsDir = uploadDir.appendingPathComponent("thumbs") |
| .package(url: "https://github.com/vapor/leaf.git", from: "3.0.0-rc"), | |
| .package(url: "https://github.com/twostraws/SwiftGD.git", .upToNextMinor(from: "2.0.0")), |
$ cd <projX>
$ vapor new <proj-name> _template=twostraws/vapor-clean
$ cd <proj-name>
$ vapor xcode
After configuring the Package.swift:
let flowerName = "Morning Glory
let wikipedia = "https://en.wikipedia.org/w/api.php"
let parameters = [
"format": "json",
"action": "query",
"prop": "extracts",
"exintro": "",
"explaintext": "",
"titles": flowerName,func fibn(n: UInt) -> UInt {
if n == 0 {
return n
}
var last: UInt = 0,
next: UInt = 1
for _ in 1..theFile = open("messages.txt", "r")
messages = theFile.read().splitlines()
theFile.close()let sceneModel = SceneClassifier()
if let prediction = try? sceneModel.prediction(sceneImage: image) {
return prediction.sceneType
}| index,name,sex | |
| 0,Mary,F | |
| 1,Anna,F | |
| 2,Emma,F | |
| 3,Elizabeth,F | |
| 4,Minnie,F | |
| 5,Margaret,F | |
| 6,Ida,F | |
| 7,Alice,F | |
| 8,Bertha,F |