This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AppKit | |
let filteredWords = Set<String>(["app", "apps"]) | |
let questionPrefixes = Set<String>([ | |
"Which", "What", "Who", "Whom", "Whose", "Where", "When", "How", "Why", "Can", | |
"May", "Will", "Is", "Do", "Shall", "Has", "Must", "Would", "Could", "Should" | |
]) | |
extension String { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RandomGenerator.swift | |
// | |
// Created by Jens Persson on 2017-05-22. | |
// | |
import Security // Only needed for SecRandomCopyBytes, used for random seed generation in the init() of RandomGenerator | |
// MARK: - RandomGenerator Protocol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
/// Writes a canonical hex+ASCII representation of `bytes` into `output`. | |
func hexdump<Target>(_ bytes: UnsafeRawBufferPointer, to output: inout Target) | |
where Target: TextOutputStream | |
{ | |
guard bytes.count > 0 else { return } | |
var asciiString = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ============================================================================ | |
// This is an attempt at implementing a Float8 type by Jens Persson. | |
// It seems to work. | |
// This file is in the form of a command line program which will | |
// do some basic checks and print all Float8 values. | |
// --------------------------------------------------------------------------- | |
// Use it in any way you like, please let me know of any issues or | |
// improvements here: https://forums.swift.org/t/33337/38 | |
// =========================================================================== |
OlderNewer