- 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
<!-- LICSENSE: NC-BY-SA --> | |
<p>Here are the sites and resources that attendees at the Learn to Code with Us events had found to be the most helpful:</p> | |
<table class="c11" cellspacing="0" cellpadding="0"> | |
<tbody> | |
<tr> | |
<th width="33%">What do you want to do?</th> | |
<th width="33%">What languages does this use?</th> | |
<th width="33%">Helpful Beginner Online Resources</th> | |
</tr> |
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
struct MatrixSystem { | |
//Ax = b | |
//See also the stand alone. It's faster, I suspect. | |
static func solveLinearPair(x1:Int, y1:Int, r1:Int, x2:Int, y2:Int, r2:Int) -> (x:Int, y:Int)? { | |
// x1 y1 X r1 | |
// x2 y2 Y r2 | |
let b = Vector2D(x: r1, y: r2) |
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
.cpu cortex-m0 | |
.fpu softvfp | |
.thumb | |
.section .text.program_code | |
.equ portA_address, 0x41004400 | |
.equ portA_DIRSET, 0x41004400+0x08 | |
.equ portA_OUTTGL, 0x41004400+0x1C |
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
// | |
// FixedWidth.swift | |
// TestingTwo | |
// | |
// Created by Carlyn Maw on 2/2/24. | |
// Inspired by 25:52 of WWDC 2020 "Safely Manage Pointers in Swift." | |
// In the subscript, using .load(fromByteOffset:as) prevents rebinding of memory for access. This struct can point to memory bound as a different type without overriding. | |
//TODO: Add tuplebride to help with C | |
//examples: https://github.com/carlynorama/UnsafeWrapCSampler/blob/main/Sources/Swift/TupleBridge.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
//https://adventofcode.com/2023/day/12 | |
//Based on https://forums.swift.org/t/advent-of-code-2023/68749/61 | |
//Intro video Lydia | |
//https://www.youtube.com/watch?v=PK3wL7DXuuw | |
//Compterphile: Computers Without Memory | |
//https://www.youtube.com/watch?v=vhiiia1_hC4 |
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
//So MyString[3] just works. Don't use in projects with real input. | |
extension StringProtocol { | |
subscript(offset: Int) -> Character { | |
self[index(startIndex, offsetBy: offset)] | |
} | |
} | |
extension StringProtocol { | |
//Ignores negative signs. |
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") | |
NewerOlder