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
| // Search an integer number in an ordered-cycling integer number array | |
| var anArray = [22, 33, 44, 55, 66, 88, 99, 100, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
| func find(number: Int, inArray anArray: [Int]) -> Int? { | |
| return binary_search_considering_cycling(number, | |
| inArray: anArray, baseIndex: 0) | |
| } | |
| func binary_search_considering_cycling(number: Int, |
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 UIKit | |
| private let SharedCASpringAnimationFactory = CASpringAnimationFactory() | |
| public class CASpringAnimationFactory { | |
| private var dummyView: UIView | |
| private init() { | |
| dummyView = UIView(frame: CGRect.zeroRect) | |
| } |
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
| public func removeDuplicates<C: ExtensibleCollectionType where C.Generator.Element : Equatable>(aCollection: C) -> C { | |
| var container = C() | |
| for element in aCollection { | |
| if !contains(container, element) { | |
| container.append(element) | |
| } | |
| } | |
| return container |
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
| log info; | |
| path include "/etc/racoon/ip.conf"; | |
| path include "/etc/racoon"; | |
| path pre_shared_key "/etc/racoon/psk.txt"; | |
| listen { | |
| isakmp MY.SERVER.IP.ADDRESS [500]; #IP address on the Internet | |
| isakmp_natt MY.SERVER.IP.ADDRESS [4500]; #IP address on the Internet | |
| } |
NewerOlder