| itag Code | Container | Content | Resolution | Bitrate | Range | VR / 3D |
|---|---|---|---|---|---|---|
| 5 | flv | audio/video | 240p | - | - | - |
| 6 | flv | audio/video | 270p | - | - | - |
| 17 | 3gp | audio/video | 144p | - | - | - |
| 18 | mp4 | audio/video | 360p | - | - | - |
| 22 | mp4 | audio/video | 720p | - | - | - |
| import Foundation | |
| // A lens is a getter and a setter combined | |
| struct Lens<Whole, Part> { | |
| let get: (Whole) -> Part | |
| let set: (inout Whole, Part) -> () | |
| } | |
| // We can create a lens from a key path | |
| extension Lens { |
| 0-mail.com | |
| 007addict.com | |
| 020.co.uk | |
| 027168.com | |
| 0815.ru | |
| 0815.su | |
| 0clickemail.com | |
| 0sg.net | |
| 0wnd.net | |
| 0wnd.org |
| // Eat/seek/peek | |
| extension Collection where SubSequence == Self, Element: Equatable { | |
| mutating func eat() -> Element { | |
| defer { self = self.dropFirst() } | |
| return peek() | |
| } | |
| mutating func eat(_ n: Int) -> SubSequence { | |
| let (pre, rest) = self.seek(n) | |
| defer { self = rest } |
(check out What's New in Swift at 11:40, slide 42)
When you look up how to compile swift faster for debug builds, people very earnestly give advice that seems contradictory: you should "try using the whole module optimization flag," and also "never use whole module optimization for debugging". [^1]
This is confusing because some of us are using these two general words:
compilation: "turning text into an executable program"
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
| /// Conform references types for use in the COW wrapper to this protocol | |
| protocol Cowable: class { | |
| /// Make a new unique instance of `copied` | |
| static func makeUnique(_ copied: Self) -> Self | |
| } | |
| /// A wrapper that turns a Cowable reference type into a value-semantic | |
| /// type with access to all of its properties | |
| @dynamicMemberLookup |
| import UIKit | |
| #if canImport(SwiftUI) && DEBUG | |
| import SwiftUI | |
| struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable { | |
| let viewController: ViewController | |
| init(_ builder: @escaping () -> ViewController) { | |
| viewController = builder() | |
| } |
This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.
Agree? Disagree? Feel free to let me know at @JanStette.
Keep it simple, stupid. You ain't gonna need it.