- https://www.penguinrandomhouse.com/books/616914/an-immense-world-by-ed-yong/
- https://www.npr.org/2022/06/21/1105793891/ed-yong-an-immense-world-animal-senses
- Not mentioned in talk but related: https://www.sas.upenn.edu/~cavitch/pdf-library/Nagel_Bat.pdf (What's it like to be a bat?)
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
| public extension ClosedRange<Int> { | |
| func crop(by other: ClosedRange<Int>) -> [ClosedRange<Int>] { | |
| //print("cropping...") | |
| guard self.overlaps(other) else { | |
| //return [self] | |
| fatalError("No overlap") | |
| } | |
| print("they overlap") | |
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
| // | |
| // SwiftUIStyle.swift | |
| // | |
| // | |
| // Created by Carlyn Maw on 8/1/23. | |
| // | |
| import Foundation | |
| //https://talk.objc.io/episodes/S01E225-view-protocols-and-shapes |
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
| sudo apt update | |
| sudo apt upgrade | |
| sudo apt install clang libicu-dev build-essential pkg-config | |
| apt install git gh | |
| apt install libpng-dev | |
| ## NOTE THIS WAS DELETED LATER | |
| apt install cmake | |
| mkdir ~/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
| // | |
| // StringNode.swift | |
| // | |
| // | |
| // Created by Carlyn Maw on 7/16/23. | |
| // MIT License | |
| // https://www.whynotestflight.com/excuses/hello-usd-part-11-gotta-make-it-easier-to-write-file-builders/ | |
| public struct Indent { | |
| let count:Int |
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
| #usda 1.0 | |
| def Xform "Rainbow" | |
| { | |
| def Mesh "cubeMesh" | |
| { | |
| float3[] extent = [(-2, -2, -2), (2, 2, 2)] | |
| int[] faceVertexCounts = [4, 4, 4, 4, 4, 4] | |
| int[] faceVertexIndices = [0, 1, 2, 3, 4, 5, 6, 7, 0, 6, 5, 1, 4, 7, 3, 2, 0, 3, 7, 6, 4, 2, 1, 5] |
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
| protocol Vegetable { | |
| var crunchy:Bool { get } | |
| var volume:Int { get } //in mL | |
| } | |
| struct Carrot:Vegetable { | |
| var volume: Int = 300 | |
| var crunchy = true | |
| } |
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
| extension FixedWidthInteger { | |
| var dataBigEndian: Data { | |
| var int = self.bigEndian | |
| return Data(bytes: &int, count: MemoryLayout<Self>.size) | |
| } | |
| var dataLittleEndian: Data { | |
| var int = self.littleEndian |
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
| import UIKit | |
| import PlaygroundSupport | |
| import Foundation | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| //URLSessionTaskDelegate | |
| //You use this protocol in one of two ways, depending on how you use a URLSession: | |
| //If you create tasks with Swift’s async-await syntax, using methods like bytes(for:delegate:) and data(for:delegate:), you pass a delegate argument of this type. The delegate receives callbacks for things like task progress, while the call point awaits the completion of the task. A delegate that receives life cycle and authentication challenge callbacks as the transfer progresses. | |
| //If you add tasks to the session with methods like dataTask(with:) and downloadTask(with:), then you implement this protocol’s methods in a delegate you set on the session. This session delegate may also implement other protocols as appropriate, like URLSessionDownloadDelegate and URLSessionDataDelegate. You can also assign a delegate of this type directly to the task to intercept callbacks before the task deliver |
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
| import { readFile, writeFile } from 'fs/promises'; | |
| import { readFileSync, writeFileSync } from 'fs'; | |
| function writeToJson(path, data, rewrite = false) { | |
| let old_data = readFileSync(path); | |
| if (old_data.length == 0 || rewrite == true) { | |
| writeFileSync(path, JSON.stringify(data, null, 4)); | |
| return; | |
| } | |
| let json_obj = [JSON.parse(old_data)]; // without brackets it reverts an error | |
| json_obj.push(data); |