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
FROM python:3.10-slim | |
# set bash as current shell | |
RUN chsh -s /bin/bash | |
SHELL ["/bin/bash", "-c"] | |
# Install necessary packages | |
RUN apt-get update && \ | |
apt-get install -y wget git |
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 | |
import PlaygroundSupport | |
struct SignUpView: View { | |
@State var username = "" | |
@State var password = "" | |
var body: some View { | |
NavigationView { |
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
// arr1 is the current list | |
// arr2 is the new list | |
// the insert and delete callbacks will be called - pass these | |
// through to WKInterfaceTable to perform a delta update | |
func diff<T: Comparable>(arr1: Array<T>, var arr2: Array<T>, insertFunc: (index: Int, item: T) -> Void, deleteFunc: (Int) -> Void) { | |
var idx1 = 0 | |
var idx2 = 0 | |
while (idx1 < arr1.count) { | |
// identical items; step to next one | |
if (idx2 < arr2.count && arr1[idx1] == arr2[idx2]) { |
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
// Auto layout in a Swift Playground (for iOS). | |
import UIKit | |
var v = UIView() | |
v.frame = CGRectMake(0, 0, 200, 200) | |
var b1 = UIButton() | |
b1.setTitle("Click Me", forState:UIControlState.Normal) | |
b1.setTitleColor(UIColor.blueColor(), forState: UIControlState.Normal) |