Server: Nginx with Phusion Passenger
Ruby Version: 2.1.3
User System: deploy
In ViewController | |
Add a UITableView to view of ViewController | |
connect UITableView to tableView property of ViewController | |
connect dataSource of UITableView to ViewController |
def highest_profit(stock_prices) | |
lowest = buy = sell = stock_prices.shift | |
stock_prices.each do |price| | |
current_profit = sell - buy | |
if (price - lowest) > current_profit | |
buy = lowest | |
sell = price | |
end | |
if price < lowest | |
lowest = price |
def coleman_liau_readability_score(content) | |
def count_sentence_number(content) | |
content += " " | |
counter = 0 | |
'.?!'.split('').each {|c| counter += content.scan("#{c} ").length } | |
counter | |
end | |
sentence_number = count_sentence_number(content) | |
word_number = content.split.size |
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { | |
var length = getLength(textField.text) | |
if length == 10 { | |
if range.length == 0 { | |
return false | |
} | |
} | |
if length == 3 { | |
var num = formatNumber(textField.text) | |
textField.text = "(\(num))" |
Testing Copy property on Objective-C
Copy property on Objective-C
<!-- | |
* Copyright (c) Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the license found in the | |
* LICENSE file in the root directory of this source tree. | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> |
I hereby claim:
To claim this, I am signing this object:
extension UIView { | |
public class func fromNib(nibName: String? = nil, owner: Any? = nil) -> Self { | |
return fromNib(nibName: nibName, type: self, owner: owner) | |
} | |
public class func fromNib<T: UIView>(nibName: String? = nil, type: T.Type, owner: Any? = nil) -> T { | |
return fromNib(nibName: nibName, type: T.self, owner: owner)! | |
} | |
public class func fromNib<T: UIView>(nibName: String? = nil, type: T.Type, owner: Any? = nil) -> T? { |