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
| [ | |
| { | |
| "StationID": "string", | |
| "StationName": { | |
| "Zh_tw": "string", | |
| "En": "string" | |
| }, | |
| "StationPosition": { | |
| "PositionLat": 0, | |
| "PositionLon": 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
| func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { | |
| do { | |
| //JSON資料處理 | |
| let dataDic = try JSONSerialization.jsonObject(with: Data(contentsOf: location), options: JSONSerialization.ReadingOptions.mutableContainers) as! [String:[String:AnyObject]] | |
| //依據先前觀察的結構,取得result對應中的results所對應的陣列 | |
| dataArray = dataDic["StationName"]!["Zh_tw"] as! [AnyObject] | |
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
| class CassiniViewController: UIViewController, UISplitViewControllerDelegate { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view. | |
| } | |
| override func didReceiveMemoryWarning() { | |
| super.didReceiveMemoryWarning() |
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
| class ImageViewController: UIViewController | |
| { | |
| //1. model | |
| // var imageURL: URL? | |
| //5. | |
| var imageURL: URL? { | |
| didSet { | |
| image = nil | |
| //fetchImage() |
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
| <div class="col-sm-12"> | |
| <div class="row"> | |
| <div class="col-sm-12"> | |
| <h1><b>Skills</b></h1> | |
| </div> | |
| </div> | |
| <div class="row" data-original-title="" title=""> | |
| <div class="col-sm-6 item"> | |
| <h1>Item 01</h1> | |
| <b style="text-align: center; background-color: rgb(85, 85, 85); color: rgb(256, 256, 256);width: 40px;padding: 10px 5px 10px 5px;border-radius: 15px;">Java</b> |
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
| // 必須實作的方法:每個 cell 要顯示的內容 | |
| func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
| // 依據前面註冊設置的識別名稱 "Cell" 取得目前使用的 cell | |
| let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! MyCollectionViewCell | |
| // 第一個在陣列取0 | |
| guard indexPath.item != 0 else { | |
| cell.backgroundColor = .brown | |
| return cell | |
| } |
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
| Collecting tensorflow | |
| Using cached tensorflow-1.1.0-cp35-cp35m-macosx_10_11_x86_64.whl | |
| Requirement already up-to-date: werkzeug>=0.11.10 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Requirement already up-to-date: numpy>=1.11.0 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Collecting protobuf>=3.2.0 (from tensorflow) | |
| Requirement already up-to-date: wheel>=0.26 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Requirement already up-to-date: six>=1.10.0 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Collecting setuptools (from protobuf>=3.2.0->tensorflow) | |
| Using cached setuptools-35.0.2-py2.py3-none-any.whl | |
| Requirement already up-to-date: packaging>=16.8 in ./miniconda3/lib/python3.5/site-packages (from setuptools->protobuf>=3.2.0->tensorflow) |
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
| Collecting tensorflow | |
| Using cached tensorflow-1.1.0-cp35-cp35m-macosx_10_11_x86_64.whl | |
| Requirement already up-to-date: werkzeug>=0.11.10 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Requirement already up-to-date: numpy>=1.11.0 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Collecting protobuf>=3.2.0 (from tensorflow) | |
| Requirement already up-to-date: wheel>=0.26 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Requirement already up-to-date: six>=1.10.0 in ./miniconda3/lib/python3.5/site-packages (from tensorflow) | |
| Collecting setuptools (from protobuf>=3.2.0->tensorflow) | |
| Using cached setuptools-35.0.2-py2.py3-none-any.whl | |
| Requirement already up-to-date: packaging>=16.8 in ./miniconda3/lib/python3.5/site-packages (from setuptools->protobuf>=3.2.0->tensorflow) |
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 withBigImage(completionHandler handler: @escaping (_ image: UIImage) -> Void) { | |
| DispatchQueue.global(qos: .userInitiated).async { () -> Void in | |
| if let url = URL(string: BigImages.whale.rawValue), | |
| let imgData = try? Data(contentsOf: url), | |
| let img = UIImage(data: imgData) { | |
| DispatchQueue.main.async(execute: { () -> Void in | |
| handler(img) | |
| }) | |
| } | |
| } |