<commit_before>//
//  GameViewCell.swift
//  Cantaloupe
//
//  Created by <NAME> on 9/25/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import UIKit

class GameViewCell: UICollectionViewCell {
    
    let imageView:UIImageView
    let titleLabel:UILabel
    
    override init(frame: CGRect) {
        self.imageView = UIImageView()
        self.imageView.contentMode = UIViewContentMode.ScaleAspectFill
        self.imageView.clipsToBounds = true
        
        let shadow = UIView(frame: self.imageView.bounds)
        shadow.backgroundColor = UIColor.blackColor()
        shadow.layer.opacity = 0.5
        self.imageView.addSubview(shadow)
        
        self.titleLabel = UILabel()
        self.titleLabel.font = UIFont(name: "Lato-Regular", size: 16)
        self.titleLabel.textColor = UIColor.whiteColor()
        
        super.init(frame: frame)
        
        self.contentView.addSubview(self.imageView)
        self.contentView.addSubview(self.titleLabel)
        self.imageView.frame = self.bounds
        self.titleLabel.frame = CGRectMake(10, floor(CGRectGetMinY(self.bounds) / 2), CGRectGetWidth(self.bounds) - 10, 20)
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setGameImage(url: String?) {
        var image:UIImage
        
        if ((url) != nil) {
            image = UIImage(data: NSData(contentsOfURL: NSURL(string: url!)))
        } else {
            image = UIImage(named: "placeholder")
        }
        self.imageView.image = image<commit_msg>Fix shadow in the game view cell<commit_after>//
//  GameViewCell.swift
//  Cantaloupe
//
//  Created by <NAME> on 9/25/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import UIKit

class GameViewCell: UICollectionViewCell {
    
    let imageView:UIImageView
    let titleLabel:UILabel
    
    override init(frame: CGRect) {
        self.imageView = UIImageView()
        self.imageView.contentMode = UIViewContentMode.ScaleAspectFill
        self.imageView.clipsToBounds = true
        
        
        self.titleLabel = UILabel()
        self.titleLabel.font = UIFont(name: "Lato-Regular", size: 16)
        self.titleLabel.textColor = UIColor.whiteColor()
        
        super.init(frame: frame)
        
        self.contentView.addSubview(self.imageView)
        self.contentView.addSubview(self.titleLabel)
        self.imageView.frame = self.bounds
        let shadow = UIView(frame: self.imageView.bounds)
        shadow.backgroundColor = UIColor.blackColor()
        shadow.layer.opacity = 0.5
        self.imageView.addSubview(shadow)
        
        self.titleLabel.frame = CGRectMake(10, floor(CGRectGetMinY(self.bounds) / 2), CGRectGetWidth(self.bounds) - 10, 20)
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setGameImage(url: String?) {
        var image:UIImage
        
        if ((url) != nil) {
            image = UIImage(data: NSData(contentsOfURL: NSURL(string: url!)))
        } else {
            image = UIImage(named: "placeholder")
        }
        self.imageView.image = image
{'fraction_non_alphanumeric': 0.10839598997493734, 'fraction_numerical': 0.012531328320802004, 'mean_word_length': 2.3329853862212944, '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': '5259671', 'n_tokens_mistral': 1027, 'n_tokens_neox': 988, 'n_words': 189}