Skip to content

Instantly share code, notes, and snippets.

@sjordine
sjordine / tutorial-4-convert-to-core-ml.ipynb
Created July 28, 2022 14:40
Tutorial 4 - Convert to Core ML.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sjordine
sjordine / tutorial-3-fnn-v2.ipynb
Created July 28, 2022 14:39
Tutorial 3 - FNN - V2.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sjordine
sjordine / tutorial-2-learning.ipynb
Created July 28, 2022 14:38
Tutorial 2 - Learning.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sjordine
sjordine / tutorial-1-pandas.ipynb
Created July 28, 2022 14:37
Tutorial 1 - Pandas.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
let document = Document {
var v0:[DocumentElement]
var v0_array:[[DocumentElement]] = []
for index in 1...3 {
let v0_0 = Label(text: "Section \(index)").size(.subtitle)
let v0_1 = Label(text: "A text").size(.body)
//v0_block is [DocumentElement]
let v0_block = MultipleChildBuilder.buildBlock(v0_0, v0_1)
//added to [[DocumentElement]] that holds all interaction
v0_array.append(v0_block)
let document = Document {
var v0: [DocumentElement]
switch value {
case 1:
let v0_0 = Label(text: "Line 1")
let v0_block = MultipleChildBuilder.buildBlock(v0_0)
v0 = MultipleChildBuilder
.buildEither(first:MultipleChildBuilder.
.buildEither(first: v0_0))
case 2:
let document = Document {
var v0: [DocumentElement]
if hasLogo {
v0_0 = Logo(imageName: "CompanyLogo.png")
v0_block = MultipleChildBuilder.buildBlock(v0_0)
v0 = MultipleChildBuilder.buildEither(first:v0_block)
} else {
v0_0 = Label(text:"Title").size(.title)
v0_block = MultipleChildBuilder.buildBlock(v0_0)
v0 = MultipleChildBuilder.buildEither(second:v0_block)
let document = Document {
var v0: [DocumentElement]
if hasLogo {
let v0_1 = Logo(imageName: "CompanyLogo.png")
let v0_block = MultipleChildBuilder.buildBlock(v0_1)
v0 = MultipleChildBuilder.buildOptional(v0_block)
}
//v0 was not initialized if hasLogo is false!!!!
let document = Document {
var v0: [DocumentElement]
if hasLogo {
let v0_1 = Logo(imageName: "CompanyLogo.png")
let v0_block = MultipleChildBuilder.buildBlock(v0_1)
v0 = MultipleChildBuilder.buildOptional(v0_block)
}
else { //The else is added by the compiler
v0 = MultipleChildBuilder.buildOptional(nil)
}
let document = Document.init(content: {
let v0 = Logo(imageName: "CompanyLogo.png")
let v1 = Label(text:"A line of text")
let v2 = Label(text:"Another line of text")
return MultipleChildBuilder.buildBlock(v0,v1,v2)
})