The following are appendices from Optics By Example, a comprehensive guide to optics from beginner to advanced! If you like the content below, there's plenty more where that came from; pick up the book!
import SwiftUI | |
import UIKit | |
enum ScalableFont { | |
case system(size: CGFloat, weight: Font.Weight = .regular, design: Font.Design = .default) | |
case custom(_ name: String, size: CGFloat) | |
var size: CGFloat { |
// | |
// ContentView.swift | |
// ExtendedScrolView | |
// | |
// Created by Marc Palmer on 05/03/2020. | |
// Copyright © 2020 Montana Floss Co. Ltd. All rights reserved. | |
// | |
import SwiftUI |
import SwiftUI | |
public struct UnwrapView<Some: View, None: View>: View { | |
private let some: () -> Some? | |
private let none: () -> None? | |
public init<Value>(value: Value?, | |
some: @escaping (Value) -> Some, |
// | |
// Combine+WithLatestFrom.swift | |
// | |
// Created by Shai Mishali on 29/08/2019. | |
// Copyright © 2019 Shai Mishali. All rights reserved. | |
// | |
import Combine | |
// MARK: - Operator methods |
// | |
// ContentView.swift | |
// DeleteMe | |
// | |
// Created by Chris Eidhof on 02.02.21. | |
// | |
import SwiftUI | |
/* |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Twitter Archive Viewer</title> | |
<script>window.YTD = { tweet: {} }</script> | |
<script src="tweet.js"></script><!-- this is loading a file from the archive --> | |
<style> | |
.tweet { border: 1px solid #eee; margin: 8px } | |
.full_text { padding: 8px } | |
.created_at { padding: 8px; color: #777 } | |
</style> |
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
# source:http://geocities.com/SiliconValley/heights/7052/opcode.txt | |
From: [email protected] (Mark Hopkins) | |
Newsgroups: alt.lang.asm | |
Subject: A Summary of the 80486 Opcodes and Instructions | |
(1) The 80x86 is an Octal Machine | |
This is a follow-up and revision of an article posted in alt.lang.asm on | |
7-5-92 concerning the 80x86 instruction encoding. | |
The only proper way to understand 80x86 coding is to realize that ALL 80x86 |
import Foundation | |
/// This isn't safe to use before Swift gets ABI stability, because generic classes | |
/// could change their names. Also, be sure to register bridges with the Obj-C runtime | |
/// if using to decode during iOS state restoration. | |
/// | |
class CodableBridge<Wrapped: Codable>: NSObject, NSSecureCoding { | |
let value: Wrapped | |
init(_ value: Wrapped) { self.value = value } |