<commit_before>//
//  ViewController.swift
//  ClearStyle
//
//  Created by Robbie on 15/7/17.
//  Copyright (c) 2015年 <NAME>. All rights reserved.
//

import UIKit

class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
    
    
    @IBOutlet weak var tableView: UITableView!
    
    var todoItmes = [TodoItem]()

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        if todoItmes.count > 0 {
            return
        }
        
        todoItmes.append(TodoItem(text: "feed the cat"))
        todoItmes.append(TodoItem(text: "buy eggs"))
        todoItmes.append(TodoItem(text: "watch WWDC videos"))
        todoItmes.append(TodoItem(text: "rule the Web"))
        todoItmes.append(TodoItem(text: "buy a new iPhone"))
        todoItmes.append(TodoItem(text: "darn holes in socks"))
        todoItmes.append(TodoItem(text: "write this tutorial"))
        todoItmes.append(TodoItem(text: "master Swift"))
        todoItmes.append(TodoItem(text: "learn to draw"))
        todoItmes.append(TodoItem(text: "get more exercise"))
        todoItmes.append(TodoItem(text: "catch up with Mom"))
        todoItmes.append(TodoItem(text: "get a hair cut"))
        
        tableView.dataSource = self
        tableView.delegate = self
        //mark
        tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
        
        tableView.separatorStyle = .None
        tableView.rowHeight = 50.0
        tableView.backgroundColor = UIColor.blackColor()
    }

    //MARK: datasource
    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return todoItmes.count
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
                    as! UITableViewCell
        cell.selectionStyle = UITableViewCellSelectionStyle.None
        cell.textLabel?.text = todoItmes[indexPath.row].text
        return cell
    }


}
<commit_msg>close #1<commit_after>//
//  ViewController.swift
//  ClearStyle
//
//  Created by Robbie on 15/7/17.
//  Copyright (c) 2015年 <NAME>. All rights reserved.
//

import UIKit

class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
    
    
    @IBOutlet weak var tableView: UITableView!
    
    var todoItmes = [TodoItem]()

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        if todoItmes.count > 0 {
            return
        }
        
        todoItmes.append(TodoItem(text: "feed the cat"))
        todoItmes.append(TodoItem(text: "buy eggs"))
        todoItmes.append(TodoItem(text: "watch WWDC videos"))
        todoItmes.append(TodoItem(text: "rule the Web"))
        todoItmes.append(TodoItem(text: "buy a new iPhone"))
        todoItmes.append(TodoItem(text: "darn holes in socks"))
        todoItmes.append(TodoItem(text: "write this tutorial"))
        todoItmes.append(TodoItem(text: "master Swift"))
        todoItmes.append(TodoItem(text: "learn to draw"))
        todoItmes.append(TodoItem(text: "get more exercise"))
        todoItmes.append(TodoItem(text: "catch up with Mom"))
        todoItmes.append(TodoItem(text: "get a hair cut"))
        
        tableView.dataSource = self
        tableView.delegate = self
        //mark
        tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
        
        tableView.separatorStyle = .None
        tableView.rowHeight = 50.0
        tableView.backgroundColor = UIColor.blackColor()
    }

    //MARK: datasource
    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return todoItmes.count
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
                    as! UITableViewCell
        cell.selectionStyle = UITableViewCellSelectionStyle.None
        cell.textLabel?.text = todoItmes[indexPath.row].text
        return cell
    }
    
    //MARK: delegate
    //gradient cell background
    func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
        let itemsCount = todoItmes.count - 1
        let greenColor = (CGFloat(indexPath.row) / CGFloat(itemsCount)) * 0.6
        cell.backgroundColor = UIColor(red: 1.0, green: greenColor, blue: 0, alpha: 1.0)
    }


}

{'fraction_non_alphanumeric': 0.09927360774818401, 'fraction_numerical': 0.007465698143664245, 'mean_word_length': 2.680029695619896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7647807', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1471, 'n_words': 335}