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 numpy | |
import pandas as pd | |
from pandas import Series | |
def initialize(context): | |
g.count = 30 | |
g.cash = 1000000 | |
g.buy_stock = [] | |
g.initial_price = {} | |
g.month = context.current_dt.month |
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
// | |
// TraditionalTime.swift | |
// iOS-Startup | |
// | |
// Created by Yaqing Wang on 4/24/17. | |
// Copyright © 2017 Yaqing Wang. All rights reserved. | |
// | |
import Foundation |
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
//: Introduce Local Extension | |
/*: | |
*/ | |
import Foundation | |
struct DateWrapper { | |
private var origDate: Date | |
init(date: Date) { |
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
//: Introduce Local Extension | |
/*: | |
*/ | |
import Foundation | |
struct DateWrapper { | |
private var origDate: Date | |
init(date: Date) { |
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
public typealias TimerExcuteClosure = @convention(block) () -> () | |
extension Timer { | |
private class TimerActionBlockWrapper : NSObject { | |
var block : TimerExcuteClosure | |
init(block: @escaping TimerExcuteClosure) { | |
self.block = block | |
} | |
} |
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
# encoding: UTF-8 | |
require 'cucumber/formatter/html' | |
class NewHtml < Cucumber::Formatter::Html | |
def initialize(step_mother, path_or_io, options) | |
super(step_mother, path_or_io, options) | |
@summary={} | |
@currentFeature = "" | |
end |
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
//: Playground - noun: a place where people can play | |
import XCPlayground | |
import UIKit | |
class VerticalEqualSpacingView :UIView { | |
var spacing:CGFloat = 0 { | |
didSet { | |
guard oldValue != spacing else { return } |
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 | |
extension NSObject { | |
// | |
// Retrieves an array of property names found on the current object | |
// using Objective-C runtime functions for introspection: | |
// https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html | |
// | |
func propertyNames() -> Array<String> { |
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
// | |
// RxAlamofireObjMapper.swift | |
// RXDemo | |
// | |
// Created by Yaqing Wang on 10/30/15. | |
// Copyright © 2015 billwang1990.github.io. All rights reserved. | |
// | |
import Foundation | |
import Alamofire |
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
public typealias TimerExcuteClosure = @convention(block)()->() | |
extension NSTimer{ | |
public class func YQ_scheduledTimerWithTimeInterval(ti:NSTimeInterval, closure:TimerExcuteClosure, repeats yesOrNo: Bool) -> NSTimer{ | |
return self.scheduledTimerWithTimeInterval(ti, target: self, selector: "excuteTimerClosure:", userInfo: unsafeBitCast(closure, AnyObject.self), repeats: true) | |
} | |
class func excuteTimerClosure(timer: NSTimer) | |
{ | |
let closure = unsafeBitCast(timer.userInfo, TimerExcuteClosure.self) |