func numberOfSectionsInTableView(tableView: UITableView) -> Int- セクション数
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int- セクションごとのセル数
func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String?- セクション名
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell- セルの内容
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| // n秒後に与えられた処理を行う | |
| func execAfterSec(n: Double, completion: (()->())?) { | |
| let delay = 1.0 * Double(NSEC_PER_SEC) | |
| let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay)) | |
| dispatch_after(time, dispatch_get_main_queue(), { | |
| completion!() | |
| }) | |
| } |
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
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| self.timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: #selector(NotificationBoardViewController.timerUpdate(_:)), userInfo: nil, repeats: true) | |
| } | |
| func timerUpdate(timer: NSTimer) { | |
| data.append(String(counter)) | |
| let indexPath = NSIndexPath(forRow: counter, inSection: 0) | |
| newsTable.insertRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic) |
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
| // http://ja.stackoverflow.com/questions/17801/nsdata%E5%9E%8B%E3%81%8B%E3%82%89%E3%83%90%E3%82%A4%E3%83%88%E9%85%8D%E5%88%97%E3%81%AB | |
| func dataToByte(data: NSDate) -> [Int8] { | |
| var dataBuffer = Array<Int8>(count: data.length, repeatedValue: 0) | |
| data.getBytes(&dataBuffer, length: dataBuffer.count) | |
| return dataBuffer | |
| } |
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
| private func textDiff(_ texts: [String]) -> String? { | |
| if texts.count <= 2 { | |
| return nil | |
| } | |
| func diff(str1: String, str2: String) -> String? { | |
| if str2.contains(str1) { | |
| let range = str2.range(of: str1) | |
| if let r = range { | |
| print(r.lowerBound) |
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
| #!/usr/bin/env/python | |
| # coding: utf-8 | |
| # **[CNN-01]** 必要なモジュールをインポートして、乱数のシードを設定します。 | |
| # In[1]: | |
| import time | |
| import tensorflow as tf | |
| import numpy as np |
OlderNewer