<commit_before>//
//  ViewController.swift
//  Swift1
//
//  Created by 符现超 on 15/10/13.
//  Copyright © 2015年 Zero.D.Saber. All rights reserved.
//

import UIKit
import Foundation


class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        setupButton()
        
        stringStudy()
        
        arrayAndDictionaryStudy()
        
        oerators()
        
        let personCount = someFunction1(allPerson: 100, total: "人")//someFunction1(100, secondParamterName: "人")
        print(personCount)
        
        var someInt = 3
        var anotherInt = 107
        swapTwoInts(&someInt, &anotherInt)
        print("someInt is now \(someInt), and anotherInt is now \(anotherInt)")
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
    }
    
    // MARK: -- UI lifecycle
    func setupButton() {
        let button: UIButton = UIButton(type: .ContactAdd)
        button.frame = CGRectMake(10, 150, 100, 30)
        button.setTitle("跳转", forState: .Normal)
        button.addTarget(self, action: Selector("pushToNextController:"), forControlEvents: .TouchUpInside)
        self.view.addSubview(button)
    }
    
    func pushToNextController(button: UIButton) {
        self.navigationController?.pushViewController(SecondViewController(), animated: true)
    }
    
///////////=================================================
    
    //MARK:String字符串
    func stringStudy() {
#if false
        var implicitInteger = 26
        let implicit = 23
        //加法运算符也可用于String的拼接：
        let str = "hello, " + "world"  // 等于 "hello, world"
        print(str.characters.count)
        
        let label = "hello"
        let width = 94
        let widthLabel = String(width) + label
        implicitInteger = 33
        let appleSummary = "I have \(implicitInteger + implicit) apples."
        print(widthLabel, appleSummary)
        
        if label.isEmpty {
            print("label 为空")
        }
        <commit_msg>CGReactMake() -> CGReact()<commit_after>//
//  ViewController.swift
//  Swift1
//
//  Created by 符现超 on 15/10/13.
//  Copyright © 2015年 Zero.D.Saber. All rights reserved.
//

import UIKit
import Foundation


class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        setupButton()
        
        stringStudy()
        
        arrayAndDictionaryStudy()
        
        oerators()
        
        let personCount = someFunction1(allPerson: 100, total: "人")//someFunction1(100, secondParamterName: "人")
        print(personCount)
        
        var someInt = 3
        var anotherInt = 107
        swapTwoInts(&someInt, &anotherInt)
        print("someInt is now \(someInt), and anotherInt is now \(anotherInt)")
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
    }
    
    // MARK: -- UI lifecycle
    func setupButton() {
        let button: UIButton = UIButton(type: .ContactAdd)
        button.frame = CGRect(x: 10, y: 150, width: 100, height: 30) 
        button.setTitle("跳转", forState: .Normal)
        button.addTarget(self, action: Selector("pushToNextController:"), forControlEvents: .TouchUpInside)
        self.view.addSubview(button)
    }
    
    func pushToNextController(button: UIButton) {
        self.navigationController?.pushViewController(SecondViewController(), animated: true)
    }
    
///////////=================================================
    
    //MARK:String字符串
    func stringStudy() {
#if false
        var implicitInteger = 26
        let implicit = 23
        //加法运算符也可用于String的拼接：
        let str = "hello, " + "world"  // 等于 "hello, world"
        print(str.characters.count)
        
        let label = "hello"
        let width = 94
        let widthLabel = String(width) + label
        implicitInteger = 33
        let appleSummary = "I have \(implicitInteger + implicit) apples."
        print(widthLabel, appleSummary)
        
        if label.isEmpty {
            print("label 为空")
        }
        
{'fraction_non_alphanumeric': 0.12295618051013735, 'fraction_numerical': 0.017876607804665358, 'mean_word_length': 2.14031485284052, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2104070', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1302, 'n_words': 325}