This a simple tutorial to explain about first steps.
git clone https://github.com/OpenMined/PySyft.git
cd PySyft
docker build -f Development-Dockerfile -t "pysyft:local" .
make custom docker=pysyft:local
import Cocoa | |
class Node<T,I: Hashable> { | |
let value: T | |
let index: I | |
var next: Node? | |
init(value: T,index: I) { | |
self.value = value | |
self.index = index |
import Cocoa | |
struct CounterPalindrome { | |
var countOdd = 0 | |
var isPermutationAndPalindrome: Bool { | |
return countOdd <= 1 | |
} | |
var table = Dictionary<Character,Int>() | |
mutating func count(_ char: Character) { | |
table[char] = (table[char] ?? 0) + 1 |
import Cocoa | |
struct Counter { | |
var table = Dictionary<Character,Int>() | |
mutating func add(_ key: Character) { | |
let value = table[key] ?? 0 | |
table[key] = value + 1 | |
} | |
import Cocoa | |
struct Counter { | |
var table = Dictionary<String,Int>() | |
mutating func insertUnique(_ word: String) -> Bool { | |
let value = table[word] ?? 0 | |
guard value == 0 else { return false } | |
table[word] = value + 1 | |
return true |
//: Playground - noun: a place where people can play | |
import Foundation | |
import PlaygroundSupport | |
struct Post { | |
let id: Int | |
let body: String | |
let username: String | |
let name: String |
import Cocoa | |
public typealias RestKitSuccess = (HTTPURLResponse, Data?) -> Void | |
public typealias RestKitFailure = (HTTPURLResponse, RestKitError) -> Void | |
public protocol RestKitProcess { | |
func process(_ request: URLRequest) -> URLRequest | |
} | |
public enum RestKitError: Error { |
import Dispatch | |
import Foundation | |
public protocol Service { | |
static func run() | |
} | |
class ServiceApplication { |
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:red)%(objectname:short)%(color:reset);%(color:yellow)%(refname:short)%(color:reset);(%(color:green)%(committerdate:relative) - %(committerdate:local)%(color:reset));%(authorname);%(contents:subject)' | column -t -s ';' |