All these code examples produce the following output.
5
😀
#import <Foundation/Foundation.h> | |
@interface SQLiteDatabase: NSObject | |
- (nullable instancetype)initWithPath:(nonnull NSString *)path; | |
- (void)executeQuery:(nonnull NSString *)query; | |
- (void)executeQuery:(nonnull NSString *)query callback:(void(^ _Nullable)(NSDictionary<NSString *, id> * _Nonnull, BOOL * _Nonnull))callback; | |
@end |
import Foundation | |
public protocol Distanceable { | |
associatedtype Distance: Comparable | |
func distance(_ other: Self) -> Distance | |
} | |
public class Clusterer { | |
private class Point<ValueType: Distanceable> { | |
let value: ValueType |
#!/bin/sh | |
# Assumes that the framework contains i382, x86_64, armv7, and arm64 | |
for path in "$@" | |
do | |
framework=$(basename "$path") | |
# Make sure it's a framework' | |
if [ "${framework##*.}" != "framework" ]; then |
// Finds the best locale from available locales based on the user's preferences. Falls back on the default locale if none is found. | |
function preferredLocale(preferences, availableLocales, defaultLocale) { | |
// Parses the BCP 47 locale into a ISO-639-3 language, ISO-15924 script, and M.49 region. | |
function parseLocale(locale) { | |
// Map grandfathered language identifiers to ISO-639 | |
const grandfatheredMap = { | |
'art-lojban': 'jbo', 'i-ami': 'ami', 'i-bnn': 'bnn', 'i-hak': 'hak', 'i-klingon': 'tlh', 'i-lux': 'lb', 'i-navajo': 'nv', | |
'i-pwn': 'pwn', 'i-tao': 'tao', 'i-tay': 'tay', 'i-tsu': 'tsu', 'no-bok': 'nb', 'no-nyn': 'nn', 'sgn-BE-FR': 'sfb', | |
'sgn-BE-NL': 'vgt', 'sgn-CH-DE': 'sgg', 'zh-guoyu': 'zh', 'zh-hakka': 'hak', 'zh-min-nan': 'nan', 'zh-xiang': 'hsn' | |
} |