This file contains 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
sdpgz3five4seven6fiveh | |
876mbxbrntsfm | |
fivek5mfzrdxfbn66nine8eight | |
554qdg | |
ninevsgxnine6threesix8 | |
4fivehmg614five | |
three6sdnttwothree3 | |
two26four2 | |
586dntdbtmfourrjnjdzptcfrpr3 | |
dgkclmseven8 |
This file contains 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
public struct Combine2Sequence<Base1: Sequence, Base2: Sequence>: Sequence { | |
private let base1: Base1 | |
private let base2: Base2 | |
public init(_ base1: Base1, _ base2: Base2) { | |
self.base1 = base1 | |
self.base2 = base2 | |
} | |
public func makeIterator() -> Iterator { |
This file contains 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
[3,2,1] > [2,1,0] // true | |
[3,2,1] > [2,10,1000] // true | |
[3,4,2] < [3,4,3] // true | |
[3,4,2] > [2,4] // true | |
[3,4,2] == [3,4,2] // true | |
extension Array: Comparable where Element: Comparable { | |
public static func < (lhs: Array<Element>, rhs: Array<Element>) -> Bool { | |
for (a, b) in zip(lhs, rhs) where a != b { | |
return a < b |
This file contains 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
func partiallyApply<T, U, each V>(_ function: @escaping (T, repeat each V) -> U, with argument: T) -> (repeat each V) -> U { | |
return { (rest: repeat each V) in | |
return function(argument, repeat each rest) | |
} | |
} |
This file contains 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
int run_server() { | |
const char server_msg[25] = "Welocme to server!"; | |
pthread_t pthread; | |
pthread_attr_t pthread_attr; | |
pthread_attr_init(&pthread_attr); | |
server_t server; |