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
| /* | |
| * Original version by Stephen Toub and Shawn Farkas. | |
| * Random pool and thread safety added by Markus Olsson (freakcode.com). | |
| * | |
| * Original source: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx | |
| * | |
| * Some benchmarks (2009-03-18): | |
| * | |
| * Results produced by calling Next() 1 000 000 times on my machine (dual core 3Ghz) | |
| * |
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 a list of Hypertext Transfer Protocol (HTTP) response status codes. | |
| /// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes. | |
| /// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum. | |
| enum HTTPStatusCode: Int, Error { | |
| /// The response class representation of status codes, these get grouped by their first digit. | |
| enum ResponseType { | |
| /// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. | |
| case informational |
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
| struct AppFontName { | |
| static let regular = "CourierNewPSMT" | |
| static let bold = "CourierNewPS-BoldMT" | |
| static let italic = "CourierNewPS-ItalicMT" | |
| } | |
| extension UIFontDescriptor.AttributeName { | |
| static let nsctFontUIUsage = UIFontDescriptor.AttributeName(rawValue: "NSCTFontUIUsageAttribute") | |
| } |
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
| #!/bin/sh | |
| UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
| # make sure the output directory exists | |
| mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
| # Step 1. Build Device and Simulator versions | |
| xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | |
| xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
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
| { | |
| "StatusCode":10000, | |
| "Status":"Success", | |
| "Data":{ | |
| "zones":[ | |
| { | |
| "id":5, | |
| "name":"Platinum", | |
| "sort":1, | |
| "startIndex":1, |
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
| {"StatusCode":10000,"Status":"Success","Data":{"zones":[{"id":5,"name":"Platinum","sort":1,"startIndex":1,"maxRows":5,"maxColumns":10,"colorCode":"0f0","price":120,"totalSeats":32,"seatsBooked":0,"seats":[{"id":243,"name":"A1","seatKey":"key","rowNumber":1,"columnIndex":1,"bookedStatus":0},{"id":244,"name":"A2","seatKey":"key","rowNumber":1,"columnIndex":2,"bookedStatus":1},{"id":245,"name":"A3","seatKey":"key","rowNumber":1,"columnIndex":3,"bookedStatus":1},{"id":246,"name":"A4","seatKey":"key","rowNumber":1,"columnIndex":4,"bookedStatus":1},{"id":247,"name":"A5","seatKey":"key","rowNumber":1,"columnIndex":7,"bookedStatus":1},{"id":248,"name":"A6","seatKey":"key","rowNumber":1,"columnIndex":8,"bookedStatus":0},{"id":249,"name":"A7","seatKey":"key","rowNumber":1,"columnIndex":9,"bookedStatus":0},{"id":250,"name":"A8","seatKey":"key","rowNumber":1,"columnIndex":10,"bookedStatus":0},{"id":251,"name":"B1","seatKey":"key","rowNumber":2,"columnIndex":1,"bookedStatus":0},{"id":252,"name":"B2","seatKey":"key","rowNu |
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 CoreData | |
| class CoreDataManager { | |
| // MARK: - Core Data stack | |
| static let sharedInstance = CoreDataManager() | |
| private lazy var applicationDocumentsDirectory: URL = { | |
| // The directory the application uses to store the Core Data store file. This code uses a directory named in the application's documents Application Support directory. |
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
| -(void)fillCircleCenteredAt:(CGPoint)center | |
| { | |
| UIBezierPath *path = [UIBezierPath bezierPath]; | |
| [path addArcWithCenter:center | |
| radius:50.0 | |
| startAngle:0.0 | |
| endAngle:2.0 * M_PI | |
| clockwise:NO]; | |
| [path fill]; | |
| } |
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
| { | |
| "page": { | |
| "title": "Romantic Comedy", | |
| "total-content-items" : "54", | |
| "page-num" : "1", | |
| "page-size" : "20", | |
| "content-items": { | |
| "content": [ | |
| { | |
| "name": "The Birds", |
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
| { | |
| "glossary": { | |
| "title": "example glossary", | |
| "GlossDiv": { | |
| "title": "S", | |
| "GlossList": { | |
| "GlossEntry": { | |
| "ID": "SGML", | |
| "SortAs": "SGML", | |
| "GlossTerm": "Standard Generalized Markup Language", |
NewerOlder