let sceneModel = SceneClassifier()
if let prediction = try? sceneModel.prediction(sceneImage: image) {
return prediction.sceneType
}
We can't make this file beautiful and searchable because it's too large.
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
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 |
theFile = open("messages.txt", "r")
messages = theFile.read().splitlines()
theFile.close()
func fibn(n: UInt) -> UInt {
if n == 0 {
return n
}
var last: UInt = 0,
next: UInt = 1
for _ in 1..
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,
$ cd <projX>
$ vapor new <proj-name> _template=twostraws/vapor-clean
$ cd <proj-name>
$ vapor xcode
After configuring the Package.swift
:
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
.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")), |
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
let rootDir = DirectoryConfig.detect().workDir | |
let uploadDir = URL(fileURLWithPath: "\(rootDir)Public/uploads") | |
let origDir = uploadDir.appendingPathComponent("originals") | |
let thumbsDir = uploadDir.appendingPathComponent("thumbs") |
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
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] |