<commit_before>//
//  ViewController.swift
//  CacheDemo
//
//  Created by <NAME> on 7/4/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
import DataCache

class ViewController: UIViewController {

    @IBOutlet weak var keyTextField: UITextField!
    @IBOutlet weak var valueTextField: UITextField!
    @IBOutlet weak var imageView: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func readButtonTouched(sender: AnyObject) {
        let key = keyTextField.text!
        let cachedString = DataCache.defaultCache.readStringForKey(key)
        valueTextField.text = cachedString
    }

    @IBAction func writeButtonTouched(sender: AnyObject) {
        let string = valueTextField.text!
        let key = keyTextField.text!
        DataCache.defaultCache.writeObject(string, forKey: key)
    }
    
    func writeImageToCache() {
        let image = UIImage(named: "dog.jpg")
        DataCache.defaultCache.writeImage(image!, forKey: "haha")
    }
    
    func readImageFromCacheAndShow() {
        let image = DataCache.defaultCache.readImageForKey("haha")
        imageView.image = image
    }
}
<commit_msg>Test cache image (continue)<commit_after>//
//  ViewController.swift
//  CacheDemo
//
//  Created by <NAME> on 7/4/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
import DataCache

class ViewController: UIViewController {
    
    static let imageKey = "imageKey"

    @IBOutlet weak var keyTextField: UITextField!
    @IBOutlet weak var valueTextField: UITextField!
    @IBOutlet weak var imageView: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func readButtonTouched(sender: AnyObject) {
        let key = keyTextField.text!
        let cachedString = DataCache.defaultCache.readStringForKey(key)
        valueTextField.text = cachedString
    }

    @IBAction func writeButtonTouched(sender: AnyObject) {
        let string = valueTextField.text!
        let key = keyTextField.text!
        DataCache.defaultCache.writeObject(string, forKey: key)
    }
    
    func writeImageToCache() {
        let image = UIImage(named: "dog.jpg")
        DataCache.defaultCache.writeImage(image!, forKey: ViewController.imageKey)
    }
    
    func readImageFromCacheAndShow() {
        let image = DataCache.defaultCache.readImageForKey(ViewController.imageKey)
        imageView.image = image
    }
}

{'fraction_non_alphanumeric': 0.09359805510534847, 'fraction_numerical': 0.006482982171799027, 'mean_word_length': 2.8457943925233646, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5203392', 'n_tokens_mistral': 758, 'n_tokens_neox': 721, 'n_words': 171}