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/Foundation.h> | |
| int main(int argc, const char * argv[]) | |
| { | |
| @autoreleasepool { | |
| int number = 0; | |
| int round = 1; | |
| NSMutableArray *array = [NSMutableArray array]; |
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 memoize<T: Hashable, U>(f: (T) -> U) -> (T) -> U { | |
| var memo : [T : U] = [:] | |
| return { x in | |
| if let q = memo[x] { | |
| return q | |
| } | |
| let r = f(x) | |
| memo[x] = r | |
| return r | |
| } |
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
| var queryResult = self.database.executeQuery(select(star, person)) | |
| XCTAssertTrue(queryResult.isSuccess) | |
| queryResult.consume { resultSet in | |
| var name = result.name | |
| ... | |
| } |
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
| override func viewDidAppear(animated: Bool) { | |
| super.viewDidAppear(animated) | |
| if self.alreadySearched { | |
| return | |
| } | |
| self.alreadySearched = true | |
| self.searchingAnimationView.showMessage2("LOOKING FOR HOTELS\nWITH VACANCIES") { | |
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 | |
| import ObjectMapper | |
| class News : Mappable { | |
| let id: Int | |
| let username : String | |
| let date: String | |
| let share_url: String | |
| let image: String | |
| let title: 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
| class Window { | |
| let element: AXUIElementRef | |
| init?(processID: pid_t) { | |
| element = AXUIElementCreateApplication(processID).takeRetainedValue() | |
| } | |
| var processID: pid_t { | |
| let pid : pid_t |
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
| func migrate(noteManager : NoteManager) { | |
| if let coreDataNotes = GNNote.MR_findAll() { | |
| for case let note as GNNote in coreDataNotes { | |
| if let bundleID = note.appBundleID, docPath = note.documentPath, content = note.content where !content.string.isEmpty { | |
| noteManager.createNote(bundleID, docID: docPath, content: content) | |
| } | |
| } | |
| } | |
| } |
OlderNewer