- http://courses.cms.caltech.edu/cs179/
- http://www.amd.com/Documents/GCN_Architecture_whitepaper.pdf
- https://community.arm.com/graphics/b/blog
- http://cdn.imgtec.com/sdk-documentation/PowerVR+Hardware.Architecture+Overview+for+Developers.pdf
- http://cdn.imgtec.com/sdk-documentation/PowerVR+Series5.Architecture+Guide+for+Developers.pdf
- https://www.imgtec.com/blog/a-look-at-the-powervr-graphics-architecture-tile-based-rendering/
- https://www.imgtec.com/blog/the-dr-in-tbdr-deferred-rendering-in-rogue/
- http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/opencl-optimization-guide/#50401334_pgfId-412605
- https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/
- https://community.arm.com/graphics/b/documents/posts/moving-mobile-graphics#siggraph2015
import UIKit | |
class FloatingButtonController: UIViewController { | |
private(set) var button: UIButton! | |
required init?(coder aDecoder: NSCoder) { | |
fatalError() | |
} |
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *) | |
tell application "Google Chrome" | |
activate | |
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl" | |
if (count every window) = 0 then | |
make new window | |
end if | |
set found to false |
import Cocoa | |
import MetalKit | |
@NSApplicationMain | |
class AppDelegate: NSObject, NSApplicationDelegate, MTKViewDelegate { | |
weak var window: NSWindow! | |
weak var metalView: MTKView! | |
let device = MTLCreateSystemDefaultDevice()! | |
var commandQueue: MTLCommandQueue! | |
var pipelineState: MTLRenderPipelineState! |
The attached lldb command pblock
command lets you peek inside an Objective-C block. It tries to tell you where to find the source code for the block, and the values captured by the block when it was created.
Consider this example program:
#import <Foundation/Foundation.h>
@interface Foo: NSObject
@end
@implementation Foo
#import <UIKit/UIKit.h> | |
@interface UIBezierPath (forEachElement) | |
- (void)forEachElement:(void (^)(CGPathElement const *element))block; | |
@end |
import SwiftUI | |
extension UnitPoint { | |
/// - returns: The point on the perimeter of the unit square that is at angle `angle` relative to the center of the unit square. | |
init(_ angle: Angle) { | |
// Inspired by https://math.stackexchange.com/a/4041510/399217 | |
// Also see https://www.desmos.com/calculator/k13553cbgk | |
let s = sin(angle.radians) | |
let c = cos(angle.radians) |
Of the many tools available for fuzzing, I've found that LLVM's libfuzzer is the easiest to use for Swift on macOS. Other tools seem to have a list of requirements taht are difficult to meet. libfuzzer on the other hand is built into LLVM and is available on macOS in the custom Swift toolchains: https://www.swift.org/download/
In this document I'll describe how to use libfuzzer with Swift and Swift Packages.
I used this setup to fuzz an SVG Renderer package that I am building. I was able to find and fix a number of bugs in my SVG parsing code using libfuzzer in basically no time at all.
// See https://stackoverflow.com/q/59367202/77567 | |
import Combine | |
import Foundation | |
extension Publisher { | |
func step(with stepper: @escaping (SteppingSubscriber<Output, Failure>.Event) -> ()) -> AnyCancellable { | |
let subscriber = SteppingSubscriber<Output, Failure>(stepper: stepper) | |
self.subscribe(subscriber) | |
return .init(subscriber) |
#import <UIKit/UIKit.h> | |
#import <ImageIO/ImageIO.h> | |
#import <MobileCoreServices/MobileCoreServices.h> | |
static UIImage *frameImage(CGSize size, CGFloat radians) { | |
UIGraphicsBeginImageContextWithOptions(size, YES, 1); { | |
[[UIColor whiteColor] setFill]; | |
UIRectFill(CGRectInfinite); | |
CGContextRef gc = UIGraphicsGetCurrentContext(); | |
CGContextTranslateCTM(gc, size.width / 2, size.height / 2); |