<commit_before>import UIKit

class ViewController: UIViewController, PBDataLoggingServiceDelegate {
    
    @IBOutlet var nameLabel: UILabel!
    @IBOutlet var bytesLabel: UILabel!
    
    var samplesReceived: UInt = 0
    var bytesReceived: UInt = 0
    var start: NSTimeInterval?
    
    override func viewDidLoad() { 
        super.viewDidLoad()
        PBPebbleCentral.defaultCentral()!.dataLoggingService.delegate = self
        PBPebbleCentral.defaultCentral()!.dataLoggingService.setDelegateQueue(nil)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    
    func dataLoggingService(service: PBDataLoggingService!, hasByteArrays bytes: UnsafePointer<UInt8>, numberOfItems: UInt16, forDataLoggingSession session: PBDataLoggingSessionMetadata!) -> Bool {
        objc_sync_enter(self)
        bytesReceived = bytesReceived + UInt(numberOfItems)
        
        if start == nil {
            NSLog("start == 0")
            start = NSDate().timeIntervalSince1970
        }
        
        if numberOfItems > 0 {
            let gfsHeader = UnsafePointer<gfs_header>(bytes).memory
            samplesReceived = samplesReceived + UInt(gfsHeader.count)
            //gfs_unpack_accel_data(bytes + sizeof(gfs_header), gfsHeader.count, gfsData)
            nameLabel.text = NSString(format: "received %d %@", samplesReceived, session.serialNumber)
        }
        
        if start != nil {
            let elapsed = NSDate().timeIntervalSince1970 - start!
            let bytesPerSecond = Double(bytesReceived) / elapsed
            bytesLabel.text = NSString(format:"%d bytes,\n%f elapsed,\n%f bps\n", self.bytesReceived, elapsed, bytesPerSecond)
        }
        objc_sync_exit(self)
        
        return true
    }
    <commit_msg>Comms<commit_after>import UIKit

class ViewController: UIViewController, PBDataLoggingServiceDelegate {
    
    @IBOutlet var nameLabel: UILabel!
    @IBOutlet var bytesLabel: UILabel!
    
    var samplesReceived: UInt = 0
    var bytesReceived: UInt = 0
    var start: NSTimeInterval?
    
    override func viewDidLoad() { 
        super.viewDidLoad()
        PBPebbleCentral.defaultCentral()!.dataLoggingService.delegate = self
        PBPebbleCentral.defaultCentral()!.dataLoggingService.setDelegateQueue(nil)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    
    func dataLoggingService(service: PBDataLoggingService!, hasByteArrays bytes: UnsafePointer<UInt8>, numberOfItems: UInt16, forDataLoggingSession session: PBDataLoggingSessionMetadata!) -> Bool {
        objc_sync_enter(self)
        bytesReceived = bytesReceived + UInt(numberOfItems)
        
        if start == nil {
            NSLog("start == 0")
            start = NSDate().timeIntervalSince1970
        }
        
        if numberOfItems > 0 {
            let gfsHeader = UnsafePointer<gfs_header>(bytes).memory
            samplesReceived = samplesReceived + UInt(gfsHeader.count)
            //gfs_unpack_accel_data(bytes + sizeof(gfs_header), gfsHeader.count, gfsData)
            nameLabel.text = NSString(format: "received %d %@", samplesReceived, session.serialNumber)
        }
        
        if start != nil {
            let elapsed = NSDate().timeIntervalSince1970 - start!
            let bytesPerSecond = Double(bytesReceived) / elapsed
            bytesLabel.text = NSString(format:"%d bytes,\n%f elapsed,\n%f bps", self.bytesReceived, elapsed, bytesPerSecond)
        }
        objc_sync_exit(self)
        
        return true
    }
    
{'fraction_non_alphanumeric': 0.08682300390843105, 'fraction_numerical': 0.008375209380234505, 'mean_word_length': 2.6786447638603694, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4201559', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1005, 'n_words': 200}