<commit_before>//
//  CountidonItem.swift
//  countidon
//
//  Created by <NAME> on 26.12.15.
//  Copyright © 2015 Closure One. All rights reserved.
//

import UIKit
import Foundation

/**
 The individual counter item.
*/
class CountidonItem: NSObject, NSCoding {
  var created = NSDate()
  var name = ""
  /**
      Time to countdown in seconds
   */
  var timeToCountdown: NSInteger = 0
  var circleForegroundColor = UIColor(hue:1, saturation:1, brightness:0, alpha:1)
  var circleBackgroundColor = UIColor(hue:0, saturation:0, brightness:1, alpha:1)
  var circleViewBackgroundColor = UIColor.clearColor()
  
  var lastInterval = NSTimeInterval()
  var timer = NSTimer()
  var totalTime = NSTimeInterval()
  let maxTime: Double = 12.0

  
  required init?(coder aDecoder: NSCoder) {
    print("init?")
    created = aDecoder.decodeObjectForKey(COUNTIDON_ITEM_CREATED) as! NSDate
    name = aDecoder.decodeObjectForKey(COUNTIDON_ITEM_NAME) as! String
    timeToCountdown = aDecoder.decodeIntegerForKey(COUNTIDON_ITEM_TIME_TO_COUNTDOWN)
    circleViewBackgroundColor = aDecoder.decodeObjectForKey(COUNTIDON_ITEM_CIRCLE_VIEW_BACKGROUND_COLOR) as! UIColor
    
    super.init()
  }
  
  func encodeWithCoder(aCoder: NSCoder) {
    aCoder.encodeObject(created, forKey: COUNTIDON_ITEM_CREATED)
    aCoder.encodeObject(name, forKey: COUNTIDON_ITEM_NAME)
    aCoder.encodeObject(timeToCountdown, forKey: COUNTIDON_ITEM_TIME_TO_COUNTDOWN)
    aCoder.encodeObject(circleViewBackgroundColor, forKey: COUNTIDON_ITEM_CIRCLE_VIEW_BACKGROUND_COLOR)
  }
  
  init(name: String) {
    self.created = NSDate()
    self.name = name
    super.init()
  }

}<commit_msg>Still broken<commit_after>//
//  CountidonItem.swift
//  countidon
//
//  Created by <NAME> on 26.12.15.
//  Copyright © 2015 Closure One. All rights reserved.
//

import UIKit
import Foundation

/**
 The individual counter item.
*/
class CountidonItem: NSObject, NSCoding {
  var created = NSDate()
  var name = ""
  /**
      Time to countdown in seconds
   */
  var timeToCountdown: NSInteger = 0
  var circleForegroundColor = UIColor(hue:1, saturation:1, brightness:0, alpha:1)
  var circleBackgroundColor = UIColor(hue:0, saturation:0, brightness:1, alpha:1)
  var circleViewBackgroundColor = UIColor.clearColor()
  
  var lastInterval = NSTimeInterval()
  var timer = NSTimer()
  var totalTime = NSTimeInterval()
  let maxTime: Double = 12.0

  
  override init() {
    super.init()
  }
  
  required init?(coder aDecoder: NSCoder) {
    print("init?")
    // created = aDecoder.decodeObjectForKey(COUNTIDON_ITEM_CREATED) as! NSDate
    name = aDecoder.decodeObjectForKey(COUNTIDON_ITEM_NAME) as! String
    timeToCountdown = aDecoder.decodeIntegerForKey(COUNTIDON_ITEM_TIME_TO_COUNTDOWN)
    circleViewBackgroundColor = aDecoder.decodeObjectForKey(COUNTIDON_ITEM_CIRCLE_VIEW_BACKGROUND_COLOR) as! UIColor
    
    super.init()
  }
  
  func encodeWithCoder(aCoder: NSCoder) {
    aCoder.encodeObject(created, forKey: COUNTIDON_ITEM_CREATED)
    aCoder.encodeObject(name, forKey: COUNTIDON_ITEM_NAME)
    aCoder.encodeObject(timeToCountdown, forKey: COUNTIDON_ITEM_TIME_TO_COUNTDOWN)
    aCoder.encodeObject(circleViewBackgroundColor, forKey: COUNTIDON_ITEM_CIRCLE_VIEW_BACKGROUND_COLOR)
  }
  
  init(name: String) {
    // self.created = NSDate()
    self.name = name
    super.init()
  }

}
{'fraction_non_alphanumeric': 0.09704389369961182, 'fraction_numerical': 0.013138250223947446, 'mean_word_length': 4.259026687598116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '397288', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1155, 'n_words': 228}