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
Date,signal_VIX | |
2017-01-03 09:00:00,0.003 | |
2017-01-03 10:00:00,0.027 | |
2017-01-03 11:00:00,0.029 | |
2017-01-03 12:00:00,0.023 | |
2017-01-03 13:00:00,0.04 | |
2017-01-03 14:00:00,0.037 | |
2017-01-03 15:00:00,0.032 | |
2017-01-03 16:00:00,0.065 | |
2017-01-04 09:00:00,0.026 |
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
date,signal_SPX | |
2017-01-03 03:00:00,0.06 | |
2017-01-03 04:00:00,0.049 | |
2017-01-03 05:00:00,0.057 | |
2017-01-03 06:00:00,0.061 | |
2017-01-03 07:00:00,0.065 | |
2017-01-03 08:00:00,0.07 | |
2017-01-03 09:00:00,0.048 | |
2017-01-03 10:00:00,0.023 | |
2017-01-03 11:00:00,0.005 |
This file has been truncated, but you can view the full file.
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
date,signal | |
2017-01-23 12:00:00,0.0025290647147308038 | |
2017-01-23 13:00:00,0.01792521634432801 | |
2017-01-23 14:00:00,0.03949901312436061 | |
2017-01-23 15:00:00,0.06883784290493286 | |
2017-01-23 16:00:00,0.08510666337189783 | |
2017-01-24 03:00:00,0.08234855713144512 | |
2017-01-24 04:00:00,0.07838499653023315 | |
2017-01-24 05:00:00,0.08982481729935515 | |
2017-01-24 06:00:00,0.08654481760879715 |
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
let pan = UIPanGestureRecognizer() | |
let pinch = UIPinchGestureRecognizer() | |
let panStarted = pan.rx_event.filter { $0.state == .Began } | |
let panEnded = pan.rx_event.filter { $0.state == .Ended } | |
let pinchStarted = pinch.rx_event.filter { $0.state == .Began } | |
let pinchEnded = pinch.rx_event.filter { $0.state == .Ended } | |
// condition: when both pan and pinch ended |
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 panPresent = false | |
var pinchPresent = false | |
var gestureTimer: NSTimer? | |
var secondsLeft = 3 | |
func handlePan(panGesture: UIPanGestureRecognizer) { | |
if panGesture.state == .Began && self.panPresent == false { | |
self.panPresent = true | |
self.checkIfBothGesturesPresent() | |
} else if panGesture.state == .Ended { |
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
let pan = UIPanGestureRecognizer() | |
let pinch = UIPinchGestureRecognizer() | |
// Here, we want to create a signal that emits an event when the | |
// gesture has started. | |
// We can call .rx_event on UIPangestureRecognizer, and | |
// transform it's output into a signal, which then | |
// We can use filter to discard all other events! |
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 test1Imperative() { | |
class Counter { | |
var count: Int = 0 { | |
didSet { | |
realCount = count+1 | |
} | |
} | |
var realCount: Int = 0 | |
} |
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
extension NSHashTable: SequenceType { | |
public func generate() -> AnyGenerator<AnyObject> { | |
var array = self.allObjects | |
var nextIndex = array.count-1 | |
return anyGenerator { | |
if (nextIndex < 0) { | |
return nil |
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)changeBackgroundColorBasedOnProgress:(float)progress { | |
self.interactiveBackground.alpha = progress; | |
} | |
- (void)didMoveToSuperview { | |
self.interactiveBackground = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, self.bounds.size.height)]; | |
self.interactiveBackground.backgroundColor = [UIColor flatGrayColor]; | |
self.interactiveBackground.alpha = 0; | |
[self insertSubview:self.interactiveBackground atIndex:0]; |
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)adjustViewBasedOnSwipeProgress:(float)progress { | |
self.tableView.spring.alpha = progress; | |
self.tableView.spring.center = CGPointMake(self.view.center.x*progress, self.view.center.y); | |
self.postWebView.spring.center = CGPointMake(self.view.center.x+(self.view.bounds.size.width*progress), self.view.center.y); | |
} |
NewerOlder