動画の長さに合わせて無音ファイルをカット
$ ffmpeg -ss 0 -i mute30.wav -t 16.45 mute.wav
無音ファイルと動画を結合
$ ffmpeg -i in.mp4 -i mute.wav -vf scale=886:1920,setsar=1:1 out.mp4
import Foundation | |
func mySleep(seconds: Int) async { | |
await withCheckedContinuation { c in | |
DispatchQueue.global().asyncAfter(deadline: .now() + TimeInterval(seconds)) { | |
c.resume() | |
} | |
} | |
} |
import Foundation | |
enum MyValue { | |
@TaskLocal static var foo: Int = 0 | |
} | |
func myFunc(@_inheritActorContext _ op: @Sendable @escaping () async -> ()) async { | |
await withCheckedContinuation { c in | |
DispatchQueue.global().async { | |
Task { |
var greeting = "Hello, playground" | |
print(greeting, ProcessInfo.processInfo.processorCount) | |
defer { | |
print(greeting) | |
} | |
for i in 0..<30 { | |
Task.detached { | |
print("detached", i) | |
sleep(1) |
import Foundation | |
@propertyWrapper | |
public struct ThreadLocal<Value> { | |
private let defaultValue: () -> Value | |
private let name: String | |
public init(wrappedValue: @autoclosure @escaping () -> Value) { | |
self.defaultValue = wrappedValue | |
self.name = UUID().uuidString |
動画の長さに合わせて無音ファイルをカット
$ ffmpeg -ss 0 -i mute30.wav -t 16.45 mute.wav
無音ファイルと動画を結合
$ ffmpeg -i in.mp4 -i mute.wav -vf scale=886:1920,setsar=1:1 out.mp4
import SwiftUI | |
func longlongAsyncFunction() async { | |
let id = UUID() | |
print("\(id): start") | |
do { | |
try await withTaskCancellationHandler { | |
try await Task.sleep(nanoseconds: 1000 * 1000 * 1000 * 10) | |
print("\(id): end") | |
} onCancel: { |
#if !canImport(ObjectiveC) | |
import Foundation | |
import XCTest | |
// INFO: | |
//typealias XCTestCaseClosure = (XCTestCase) throws -> Void | |
//typealias XCTestCaseEntry = (testCaseClass: XCTestCase.Type, allTests: [(String, XCTestCaseClosure)]) | |
func testCase<T: XCTestCase>(_ allTests: [(String, (T) -> () async throws -> Void)]) -> XCTestCaseEntry { | |
let tests: [(String, XCTestCaseClosure)] = allTests.map { ($0.0, asyncTest($0.1)) } | |
return (T.self, tests) |
import Combine | |
@_functionBuilder | |
struct FlatMapBuilder { | |
static func buildBlock<C: Publisher>(_ component: C) -> C | |
{ | |
component | |
} | |
static func buildEither<F: Publisher, S: Publisher>(first component: F) -> EitherPublisher<F, S> |
サーバ日付 | id | value | ||
---|---|---|---|---|
2021/03/24 11:03:04 | testing4 | 0 | ||
2021/03/24 11:03:04 | testing1 | 0 | ||
2021/03/24 11:04:07 | testing4 | 1 | ||
2021/03/24 11:04:07 | testing1 | 1 | ||
2021/03/24 11:04:08 | testing2 | 1 | ||
2021/03/24 11:05:11 | testing1 | 2 | 私物iPadでスケジュール中。電源に接続されたりされてなかったり、他のアプリを起動してたりしてなかったりする | |
2021/03/24 11:05:11 | testing4 | 2 | ||
2021/03/24 11:05:12 | testing2 | 2 | ||
2021/03/24 11:05:13 | testing3 | 2 | 〜ここでバックグラウンドにした〜 |
import Foundation | |
public struct Airport: Codable { | |
let name: String | |
let iata: String | |
let icao: String | |
let coordinates: [Double] | |
public struct Runway: Codable { | |
enum Surface: String, Codable { |