Skip to content

Instantly share code, notes, and snippets.

Plugin integration

Integrating the plugin with AVPlayer is done by linking SenseKit framework to your player. Here we describe how to integrate your player with SenseKit.

Pre-Requisites

  • A valid Sense CID

Installing SenseKit

public func solution(N : Int) -> Int {
let bytes = String(N, radix: 2)
var max = 0
var current = 0
for n in bytes.characters {
if n == "0" {
current += 1
} else {
if current > max {

{{name}}

[![Swift][swift-badge]][swift-url] [![Zewo][zewo-badge]][zewo-url] [![Platform][platform-badge]][platform-url] [![License][mit-badge]][mit-url] [![Slack][slack-badge]][slack-url]

Installation

public typealias Byte = UInt8
public struct Data {
public var bytes: [Byte]
public init(_ bytes: [Byte]) {
self.bytes = bytes
}
}
@paulofaria
paulofaria / Package.swift
Last active March 18, 2016 22:52
Alias for packages
import PackageDescription
let package = Package(
name: "S4",
dependencies: [
.Package(url: "https://github.com/swiftx/http.git", majorVersion: 0, minor: 1, alias: "SwiftXHTTP"),
.Package(url: "https://github.com/Zewo/HTTP.git", majorVersion: 0, minor: 1, alias: "ZewoHTTP")
]
)
import Dispatch
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
func delay(duration: Double, closure: Void -> Void) {
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(duration * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue(), closure)
}

S4 - Server Side Swift Standards

Byte

The Byte type represents a byte.

public typealias Byte = UInt8
let todoResources = Resource(middleware: recovery, contentNegotiaton) { todo in
todo.index { _ in
let todos = try app.getAllTodos()
return Response(content: ["todos": todos.content])
}
todo.create(mappingTo: Todo.self) { request, todo in
let todo = try app.createTodo(todo)
return Response(content: todo)
}
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/backgroundImageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/backgroundImageView"
android:layout_width="match_parent"
android:layout_height="match_parent"