This file contains 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 SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
Image("profilepic") | |
.resizable() | |
.aspectRatio(contentMode: .fit) | |
Text("Danny Bolella") | |
} |
This file contains 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 SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
ProfilePage() | |
} | |
} | |
struct ProfileInformation: View { | |
var body: some View { |
This file contains 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 SwiftUI | |
struct ContentView: View { | |
var profile: Profile = Profile(name: "Danny", subtitle: "Awesome iOS Developer", description: "Danny loves SwiftUI and thinks it's the future of iOS Development!", profilePic: "profilepic") | |
var profile2: Profile = Profile(name: "George", subtitle: "An OK iOS Developer", description: "George should love SwiftUI and think that it's the future of iOS Development!", profilePic: "profilepic") | |
var body: some View { | |
VStack { | |
ProfilePage(profile: profile) | |
ProfilePage(profile: profile2) |
This file contains 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
Installing packages: | |
.package(url: "https://github.com/tensorflow/swift-models.git", .branch("master")) | |
Datasets | |
With SwiftPM flags: [] | |
Working in: /tmp/tmpcfyrcapb/swift-install | |
Fetching https://github.com/tensorflow/swift-models.git | |
Cloning https://github.com/tensorflow/swift-models.git | |
Resolving https://github.com/tensorflow/swift-models.git at master | |
[1/6] Compiling Datasets CIFAR10.swift | |
/tmp/tmpcfyrcapb/swift-install/package/.build/checkouts/swift-models/Datasets/CIFAR10/CIFAR10.swift:117:54: error: incorrect argument label in call (have 'permutation:', expected 'withPermutations:') |
This file contains 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
// The training loop. | |
for epoch in 1...epochCount { | |
var trainStats = Statistics() | |
var testStats = Statistics() | |
Context.local.learningPhase = .training | |
for i in 0 ..< dataset.trainingSize / batchSize { | |
let images = dataset.trainingImages.minibatch(at: i, batchSize: batchSize) | |
let labels = dataset.trainingLabels.minibatch(at: i, batchSize: batchSize) | |
// Compute the gradient with respect to the model. | |
let (loss, gradients) = valueWithGradient(at: model) { model -> Tensor<Float> in |
This file contains 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
struct ContentView: View { | |
@State var togglePreview = false | |
var body: some View { | |
VStack { | |
URLPreview(previewURL: URL(string: "https://medium.com")!, togglePreview: $togglePreview) | |
.aspectRatio(contentMode: .fit) | |
.padding() | |
} | |
This file contains 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
struct ContentView: View { | |
var body: some View { | |
VStack { | |
URLPreview(previewURL: URL(string: "https://medium.com")!) | |
.aspectRatio(contentMode: .fit) | |
.padding() | |
} | |
} | |
} |
This file contains 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
#set("title") { Translate Kotlin } | |
#set("body") { | |
<textarea id="constantsText" rows="4" cols="50"> | |
Please put swift code here... | |
</textarea> | |
<button onclick="post()">Click me</button> | |
<script> | |
function post() { |
This file contains 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 Vapor | |
import Transform | |
import SwiftKotlinFramework | |
import Cocoa | |
/// Here we have a controller that helps facilitate | |
/// creating typical REST patterns | |
final class TranslateKotlinController { | |
/// POST /translate | |
func store(_ req: Request) throws -> Future<View> { |
NewerOlder