I hereby claim:
- I am rickw on github.
- I am rcw (https://keybase.io/rcw) on keybase.
- I have a public key whose fingerprint is ADA1 A75D B48A 86A8 4047 6D34 64C1 C602 D9CD 1760
To claim this, I am signing this object:
Mon Aug 6 01:19:07 UTC 2018 |
I hereby claim:
To claim this, I am signing this object:
// | |
// StringScoreExtension.swift | |
// | |
// | |
// Created by Rick Windham on 6/23/15. | |
// | |
// | |
import Foundation |
import Foundation | |
import SystemConfiguration | |
var reach:SCNetworkReachability! | |
reach = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, "apple.com").takeRetainedValue() | |
typealias ChangeBlock = (UInt32) -> () | |
let block:ChangeBlock = {status in |
extension NSTextView { | |
func appendText(line: String) { | |
Async.main { | |
let attrDict = [NSFontAttributeName: NSFont.systemFontOfSize(18.0)] | |
let astring = NSAttributedString(string: "\(line)\n", attributes: attrDict) | |
self.textStorage?.appendAttributedString(astring) | |
let loc = self.string?.lengthOfBytesUsingEncoding(NSUTF8StringEncoding) | |
let range = NSRange(location: loc!, length: 0) | |
self.scrollRangeToVisible(range) |
func fibber(n:Int) -> Int { | |
switch n { | |
case 0: | |
return 0 | |
case 1: | |
return 1 | |
default: | |
return fibber(n-1) + fibber(n-2) | |
} | |
} |
# | |
# a weighted random | |
# | |
the_list = { "five" => 5, "three" => 3, "one" => 1 } | |
result_hash = { "five" => 0, "three" => 0, "one" => 0 } | |
count = 3 | |
def weighted_random(list, count) | |
weighted_list = [] |
# | |
# method messing try a different way | |
# | |
class Object | |
def try | |
Try.new self | |
end | |
end | |
class Try |