List of freely available resources to study computer graphics programming.
| extension UUID { | |
| // UUID is 128-bit, we need two 64-bit values to represent it | |
| var integers: (Int64, Int64) { | |
| var a: UInt64 = 0 | |
| a |= UInt64(self.uuid.0) | |
| a |= UInt64(self.uuid.1) << 8 | |
| a |= UInt64(self.uuid.2) << (8 * 2) | |
| a |= UInt64(self.uuid.3) << (8 * 3) | |
| a |= UInt64(self.uuid.4) << (8 * 4) | |
| a |= UInt64(self.uuid.5) << (8 * 5) |
| addmedia | |
| addphoto | |
| addvideo | |
| appinfo | |
| boot | |
| bootstatus | |
| clone | |
| create | |
| darwinup | |
| delete |
Answer to http://disq.us/p/1za4u75.
Hi, your problem is actually quite hard to solve with composition, at least without a profunctor-based approach, which is really hard to do in Swift due to the lack of higher-kinded types.
There is a solution, though, but we must be clear about what we're searching for here. In your ViewState<T> there could be no Prism that points just to T, because the inject function wouldn't know what case to produce with a value of type T: it's probably going to be an Affine.
At the bottom of this answer you'll find all the code needed to implement it: it can be directly copy-pasted into a playground.
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
| let a: Double? = 1.0 | |
| let b: Double? = 2.0 | |
| let c: Double? = 3.0 | |
| let d: Double? = 4.0 | |
| let e: Double? = 5.0 | |
| let f: Double? = 6.0 | |
| let g: Double? = 7.0 | |
| extension Optional { | |
| func `or`(_ value : Wrapped?) -> Optional { |
| import RealmSwift | |
| import Realm | |
| protocol CascadeDeleting: class { | |
| func delete<Entity>(_ list: List<Entity>, cascading: Bool) | |
| func delete<Entity>(_ results: Results<Entity>, cascading: Bool) | |
| func delete<Entity: Object>(_ entity: Entity, cascading: Bool) | |
| } |
| import Foundation | |
| extension UnicodeScalar : ForwardIndexType { | |
| public func successor() -> UnicodeScalar { | |
| return UnicodeScalar(value + 1) | |
| } | |
| } | |
| var operatorHeads: [UnicodeScalar] = Array("=-+!*%<>&|^~?".unicodeScalars) | |
| operatorHeads += Array("\u{00A1}" ... "\u{00A7}") |
#Every Single Option Under The Sun
- optimization level options
- automatic crashing options
- debug info options
- swift internal options
- swift debug/development internal options
- linker-specific options
- mode options
| #! /bin/sh | |
| # usage: <shellscript> [--osx] typename | |
| if [ "$1" = "--osx" ] ; then | |
| echo ":print_module $2" | xcrun swift -deprecated-integrated-repl | |
| else | |
| sdk_path=$(echo `xcrun --show-sdk-path` | sed 's#MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk#iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk#') | |
| echo ":print_module $1" | xcrun swift -deprecated-integrated-repl -sdk "$sdk_path" | |
| fi |