Intents you define and upload to Amazon
{
"intents": [
{
"intent": "GetVolume",
"slots": [
{
"name": "Room",
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>items</key> | |
<array> | |
<dict> | |
<key>assets</key> | |
<array> | |
<dict> |
Intents you define and upload to Amazon
{
"intents": [
{
"intent": "GetVolume",
"slots": [
{
"name": "Room",
import ( | |
"bytes" | |
"encoding/json" | |
) | |
// ToModel converts a string map to a given model | |
func ToModel(obj map[string]string, model interface{}) error { | |
j, _ := json.Marshal(obj) | |
d := json.NewDecoder(bytes.NewReader(j)) | |
return d.Decode(model) |
enum HTTPRouter: URLRequestConvertible { | |
static let baseURL = "http://YOUR_HOST_URL" | |
case Upload(field: String, filename: String, mimeType: String, data: NSData) | |
var method: Alamofire.Method { | |
switch self { | |
case Upload: | |
return .POST | |
} |
import UIKit | |
typealias Session = (NSDate, [Int]) | |
let data = [ | |
["created": NSDate(timeIntervalSince1970: 1422600001), "reps": 0], | |
["created": NSDate(timeIntervalSince1970: 1422600002), "reps": 1], | |
["created": NSDate(timeIntervalSince1970: 1422600003), "reps": 1], | |
["created": NSDate(timeIntervalSince1970: 1422700000), "reps": 0], | |
["created": NSDate(timeIntervalSince1970: 1422700000), "reps": 0], |
import UIKit | |
let words = ["Cat", "Chicken", "Fish", "Dog", "Mouse", "Pig", "Monkey"] | |
typealias Entry = (Character, [String]) | |
func distinct<T: Equatable>(source: [T]) -> [T] { | |
var unique = [T]() | |
for item in source { | |
if !contains(unique, item) { |
func subscribe() { | |
let subscription = CKSubscription(recordType: "Item", predicate: NSPredicate(value: true), subscriptionID: "items", options: .FiresOnRecordUpdate | .FiresOnRecordCreation) | |
subscription.notificationInfo = CKNotificationInfo() | |
subscription.notificationInfo.alertBody = "New item added" | |
self.db.saveSubscription(subscription) { (subscription, error) -> Void in | |
if error != nil { | |
println(error.localizedDescription) | |
} | |
} | |
} |
import UIKit | |
struct Styles { | |
// MARK: Global styles | |
static let margin:CGFloat = 8.0 | |
static let padding:CGFloat = 8.0 | |
static let tint = UIColor(red: 0.0, green: 0.48, blue: 1.0, alpha: 1.0) |
Taken directly from: https://developer.apple.com/library/mac/qa/qa1176/_index.html#//apple_ref/doc/uid/DTS10001707-CH1-SECRVI
iOS 5 added a remote virtual interface (RVI) facility that lets you use OS X packet trace programs to capture traces from an iOS device. The basic strategy is: