Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
extension StringProtocol { | |
/// str[NSRange(location:0, length: 9)] | |
subscript(_ range: NSRange) -> SubSequence { | |
guard let stringRange = Range<String.Index>(range, in: self) else { | |
fatalError("String index is out of range") | |
} | |
return self[stringRange] | |
} | |
FB11835461
In real world applications it makes more sense to use ObservableObject referrence type to drive navigation than simple value type. The example below demonstrates that.
Problem is that for some reason NavigationStack will create memory leak if path is set to empty array after navigating any number of times through stack. All view models that were created in process will be retained in memory even though path is set to [].
Same problem occurs if we set path to empty array and just swap whole NavigationStack with any other view still all objects created will be retained in memory.
There is workaround that I will show bellow to fix this but it is still very buggy behaviour IMO.
#if canImport(Darwin) | |
import Darwin | |
#elseif canImport(Glibc) | |
import Glibc | |
#else | |
#error("unsupported platform") | |
#endif | |
/// Core utilities for interacting with IP-based abstractions. | |
public struct IP { |
iOS doesn't report when an app will be suspended (placed from background into a non-processing state) nor does it seem to fire a notification once the app has resumed. There is some confusion about this as there is a notification when the app becomes "active" or will resign the "active" state, however this is not always the right value needed. iOS Apps have a number of states:
- Active: App is in the foreground (frontmost) and there are no notifications or menu's pulled over it. Pulling a menu down or getting an external notification or text message will cause the app to "resign" active, and resume active once the alert has been dealt with.
- Background: App is not in the foreground but still processing. This happens briefly before suspend if there are no background tasks running, or can be a permanent state if there is a long running background mode (audio, location, etc) running.
Here is my live stream setup kit :)
If you are doing a personal stream, I recommend only streaming to a single service such as Twitch. It is better for community building and easier on the streamer. Additionally, if you become an affiliate you are locked into a platform anyways.
How my setup works is that I have my main Desktop PC that has my streaming software, chat, alerts, music, and such all running on it. I have a second surface book that has HDMI out into the capture card in my Desktop PC. I do this because often when you compile apps it may freeze up your computer and stream :(. I have 2 sets of keyboards and mice and 2 monitors that I work off of. This works for me, but you do you :)
Software:
- OBS: Your main go to for streaming software. It works on every OS :). If you want something with everything baked in take a look at Streamlabs OBS.
- Streamlabs has all of your pop ups for subscribers and such on t
import Darwin.C | |
import Venice | |
struct SubProcess { | |
let path: String | |
let arguments: [String] | |
func run(sync sync: Bool = true) -> Int? { |
// teariface.go | |
// A simple demonstration of breaking Go memory safety by violating concurrency | |
// safety. We alias an interface variable which is of course multiple words; | |
// the net result is the itable pointer and target object pointer end up | |
// mismatched, triggering undefined behavior (wrong results, AVs, etc). | |
package main | |
import ( | |
"fmt" | |
"runtime" |
// tear.go | |
// A simple demonstration of breaking Go memory safety by violating concurrency | |
// safety. We alias a shared slice variable -- which is a multi-word variable -- | |
// and then reads/write that shared variable in parallel between Goroutines. | |
// If "torn slice: ..." is printed, something VeryBad(tm) has occurred... | |
package main | |
import ( | |
"fmt" | |
"runtime" |
module EasyLayout | |
open System | |
open System.Drawing | |
open Microsoft.FSharp.Quotations | |
open Microsoft.FSharp.Quotations.Patterns | |
open Microsoft.FSharp.Quotations.DerivedPatterns | |
open MonoTouch.Foundation | |
open MonoTouch.UIKit |