This file contains 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
let prime = 1231247 | |
let alphabetSize = 26 | |
let A: UInt32 = 96 | |
func stringHash(inout input: String, fromIndex: String.UnicodeScalarView.Index, length: Int) -> Int { | |
var hash = 0 | |
var index = fromIndex | |
for i in 0..<length { | |
let char = input.unicodeScalars[index] |
This file contains 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
extension Array | |
{ | |
mutating func rotateBy(var positions: Int) { | |
positions = positions < 0 ? (self.count - abs(positions) % self.count) : positions % self.count | |
if self.count % 2 == 0 { | |
rotateFrom(0, elements: self.count/2, stride: positions) | |
rotateFrom(1, elements: self.count/2, stride: positions) | |
}else{ |
This file contains 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
using System; | |
namespace iOS | |
{ | |
public interface IProxyViewDelegate | |
{ | |
void ScrollViewDidScroll(int scrollViewIndex, nfloat offsetY); | |
void ParentScrollViewDidScroll(nfloat offsetX); | |
void ProxyTappedAtLocation(ProxyView proxyView, CoreGraphics.CGPoint location); | |
} |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using UIKit; | |
using CoreGraphics; | |
using Foundation; | |
namespace iOS | |
{ | |
public class ProxyView: UIView | |
{ |
This file contains 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> | |
@interface Node: NSObject | |
@property (nonatomic, readonly, assign) int key; | |
@property (nonatomic, readonly, strong) id value; | |
@property (nonatomic, strong) Node *left; | |
@property (nonatomic, strong) Node *right; | |
+ (Node*) nodeWithKey: (int) key value: (id) value; |