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
dic = Hash.new(0) | |
while line = ARGF.gets | |
line.downcase! | |
while line.sub!(/[a-z]+/,"") | |
word = $& | |
dic[word] += 1 | |
end | |
end | |
p dic.sort{|a,b|b[1] <=> a[1]}[0...5] |
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
/** | |
* UIStoryboard (InstantiateViewController) | |
*/ | |
UIKIT_STATIC_INLINE __kindof UIViewController *InstantiateViewControllerOnStoryboard(NSString *storyboardName, NSString *identifier) { | |
return [[UIStoryboard storyboardWithName:storyboardName bundle:nil] instantiateViewControllerWithIdentifier:identifier]; | |
} | |
UIKIT_STATIC_INLINE __kindof UIViewController *InstantiateInitialViewControllerOnStoryboard(NSString *storyboardName) { | |
return [[UIStoryboard storyboardWithName:storyboardName bundle:nil] instantiateInitialViewController]; | |
} |
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
// | |
// AppConst.swift | |
// AdBlockSample | |
// | |
// Created by bright on 2016/11/26. | |
// Copyright © 2016年 bright. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
``` | |
do { | |
try jsonData.write(toFile: url.path, atomically: true, encoding: String.Encoding.utf8) | |
} catch let error as NSError { | |
print("error:::\(error)") | |
fatalError() | |
} | |
``` |
NewerOlder