<commit_before>// Variables
var url = "http://api.reddit.com/";
var table = Ti.UI.createTableView({top:40,backgroundColor:"#3399FF"});
var tableData = [];
var json, reddit, i, row, authorLabel, titleLabel, thumbImg;

// HTTP Onload Function
var remoteOnload = function() {
    Ti.API.debug(this.responseText);
 
    json = JSON.parse(this.responseText);
    for (i = 0; i < json.data.children.length; i++) {
        reddit = json.data.children[i].data;
        row = Ti.UI.createTableViewRow({
            height:'85',
            hasChild: true
        });
        authorLabel = Ti.UI.createLabel({
            text: "Author: "+ reddit.author,
            font:{fontSize:15,fontWeight:'bold'},
	        height:'auto',
	        left:15,
	        bottom:5,
	        color:'#000',
	        touchEnabled:false
        });
        titleLabel = Ti.UI.createLabel({
        	text:"Title: "+ reddit.title,
	        font:{fontSize:8},
	        height:'auto',
	        left:15,
	        right:55,
	        top:10,
	        color:'#000',
	        touchEnabled:false
        });
        
        thumbImg = Ti.UI.createImageView({
        	image:reddit.thumbnail,
        	right: 5,
        	height: 40, width: 40,
        	top: 5
        });
        view = Ti.UI.createView({
        	backgroundColor:"#fff",
        	right: 0,
        	height: 50, width: 50,
        	top: 15
        	//opacity:.5
        });
 		view.add(thumbImg);
        row.add(authorLabel, titleLabel, view);
        tableData.push(row);<commit_msg>Added an if statement to imageView<commit_after>// Variables
var url = "http://api.reddit.com/";
var table = Ti.UI.createTableView({top:40,backgroundColor:"#3399FF"});
var tableData = [];
var json, reddit, i, row, authorLabel, titleLabel, thumbImg;

// HTTP Onload Function
var remoteOnload = function() {
    Ti.API.debug(this.responseText);
 
    json = JSON.parse(this.responseText);
    for (i = 0; i < json.data.children.length; i++) {
        reddit = json.data.children[i].data;
        row = Ti.UI.createTableViewRow({
            height:'85',
            hasChild: true
        });
        authorLabel = Ti.UI.createLabel({
            text: "Author: "+ reddit.author,
            font:{fontSize:15,fontWeight:'bold'},
	        height:'auto',
	        left:15,
	        bottom:5,
	        color:'#000',
	        touchEnabled:false
        });
        titleLabel = Ti.UI.createLabel({
        	text:"Title: "+ reddit.title,
	        font:{fontSize:8},
	        height:'auto',
	        left:15,
	        right:55,
	        top:10,
	        color:'#000',
	        touchEnabled:false
        });
        
       
    	if(reddit.thumbnail === ""){
    		thumbImg = Ti.UI.createImageView({
    		image:"http://webmaster.ypsa.org/wp-content/uploads/2012/08/no_thumb.jpg",
        	right: 5,
        	height: 40, width: 40,
        	top: 5
        	});
    	}else{
    		thumbImg = Ti.UI.createImageView({
    		image:reddit.thumbnail,
        	right: 5,
        	height: 40, width: 40,
        	top: 5
        	});
    	};  	
        
        view = Ti.UI.createView({
        	backgroundColor:"#fff",
        	right: 0,
        	height: 50, width: 50,
        	top: 15
        	//opacity:.5
        });
 		view.add(thumbImg);
        row.add(authorLabel, titleLabel, view);
        tableData.push(row);
{'fraction_non_alphanumeric': 0.1459149834187519, 'fraction_numerical': 0.02833886041603859, 'mean_word_length': 1.8142493638676844, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5770597', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1049, 'n_words': 197}