Conway’s Game of Life

This is just a simple demonstration of lambdas to implement the Cell but the code may not be complete.

package com.game.test;

import java.util.ArrayList;
import java.util.List;

import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JMock;
import org.jmock.integration.junit4.JUnit4Mockery;
import org.jmock.lib.legacy.ClassImposteriser;
import org.junit.runner.RunWith;

import com.game.conway.Cell;

@RunWith(JMock.class)

public class Game {

    Mockery context = new JUnit4Mockery();
    
    @SuppressWarnings("deprecation")
	@Test 
    public void mocksurvive() {
        // set up
    	context = new Mockery() {  
    		  {  
    		    setImposteriser(ClassImposteriser.INSTANCE);  
    		  }  
    		};
    	Cell cell = context.mock(Cell.class);
    	final List<Cell> cells = new ArrayList<Cell>();
		cells.add(new Cell(1,1));
		cells.add(new Cell(8,2));
		cells.add(new Cell(2,2));
		

        
        // expectations
        context.checking(new Expectations() {
             {
                 oneOf(cell).setX(1);
                 oneOf(cell).setY(1);
                 oneOf(cell).survive(cells);
                 will(returnValue(false));
             }
         });
    	cell.setX(1);
    	cell.setY(1);
         final boolean result = cell.survive(cells);

    }
}


package com.game.conway;

import java.util.List;

public class Cell implements Comparable<Cell>{
	
	public Cell(int x, int y) {
		this.x = x;
		this.y = y;
	}

	int x,y;

	public Object getX() {
		return x;
	}

	public Object getY() {
		return y;
	}

	public boolean neighbour(Cell neighbour) {
		return Math.abs(x - neighbour.x) <= 1 && 
			   Math.abs(y - neighbour.y) <= 1 &&
			   !(this.compareTo(neighbour) == 0);
	}

	public long countNeighbours(List<Cell> cells) {
		return cells.stream().filter( c -> neighbour(c)).count();
	}

	public boolean survive(List<Cell> cells) {
		long count = countNeighbours(cells);
		if(cells.stream().anyMatch( c -> (this.compareTo(c) == 0) )){
			return count == 2 || count == 3;
		}
		
		return count == 3;
	}


	@Override
	public int compareTo(Cell o) {
		if( x == o.x && y == o.y)
			return 0;
		else
			return -1;
	}
	
    
}

Text Analytics

I have a table docquery with columns docid,term,count.

This represents how many times a term occurs in a document denoted by docid. I pick a set of search terms from the same table and find out which of these terms occur the most number of times in other documents.

I am not excluding the document(9_txt) in which the search term occurs.

I am sure this query can be simplified.

Sample data

1_txt|industrys|1
2_txt|follow|1
3_txt|yes|1
4_txt|deferring|1
5_txt|wilf|1
6_txt|future|2
7_txt|reason|1
8_txt|dropped|2
9_txt|doesnt|2
9_txt|yes|2
select f1d,sum(s) sim FROM
(select f1d,f1t,sum(f1c) s FROM
(select f1.docid f1d,f1.term f1t,sum(f1.count) f1c
        FROM docquery f1
                WHERE f1.term IN (select term from docquery
                                        WHERE docquery.docid = '9_txt')
        GROUP BY f1.docid,f1.term)
GROUP BY f1d
ORDER BY s)
        GROUP BY f1d
        ORDER BY sim;

Frequency of occurence of a term in a tweet dataset

I am a novice python coder and this algorithm is simple. But still I am overjoyed that my python coding skills are improving.

No: of occurences of a term / Total No: of unique words

import json
import os.path
import re
import sys


class Frequency(object):

 
   def __init__(self):
        if not (os.path.isfile(sys.argv[1]) and os.access(sys.argv[1], os.R_OK)):
            print "Either file is missing or it is not readable"
        self.allterms = {}


   def totalterms(self,text):
           count  = 0
           tweet = text.split()
           for s in tweet:
                    if not  self.allterms:
                        self.allterms[s.lower()] = count
                    else:
                        if not (s.lower() in self.allterms):        
                            self.allterms[s.lower()] = count

   def calculatefrequency(self,text):
           tweet = text.split()
           for s in tweet:
                        if  (self.allterms.has_key(s.lower())):        
                            self.allterms[s.lower()] = float(self.allterms[s.lower()] + 1)
           for key in self.allterms.iterkeys():
              self.allterms[key] = float(self.allterms[key] / len(self.allterms.keys()))
                
   def analyze(self):
        with open(sys.argv[1],'r') as f:
            for data in f:
                d = json.loads(data)
                try: 
                    # print json-formatted string
                    #print json.dumps(d, sort_keys=True, indent=4)
                 
                    if d.get('text') and d.get('lang') == 'en':
                            #print "Tweet: ", d['text']
                            tex = re.sub("[^A-Z\sa-z]", "", d['text'])
                            Frequency.totalterms(self,tex)
                            Frequency.calculatefrequency(self, tex)

                except (ValueError, KeyError, TypeError):
                    print "Error"
        for key,value in self.allterms.iteritems():
            print(str(key) + " " + str("%.6f" %value))              
            
                  
if __name__ == '__main__':


    frequency=Frequency()
    frequency.analyze()
nigga 0.000027
old 0.000027
worldcup 0.000002
list 0.000027
it 0.000002
years 0.000027
see 0.025000
done 0.000004
have 0.025000
shit 0.000027
rt 0.000002
from 0.025000
also 0.000002
top 0.000027
had 0.000002
guitarmandan 0.000002
to 0.000004
win 0.000002
you 0.050000
today 0.000027
me 0.025027
fr 0.000781
someone 0.000002
but 0.000781
moment 0.025000
germany 0.000002
no 0.025000
not 0.025781
come 0.000027
cool 0.000027
a 0.000027
on 0.000027
like 0.000027
of 0.000027
hes 0.000027
well 0.000004
chance 0.025000
calling 0.000027
caring 0.025000
the 0.025027

Twitter Sentiment Analysis

I finally got around to working on this problem however simple it may be.

The algorithm was proposed by another ‘Data Science’ course participant and I haven’t implemented the algorithm from this paper

I can explore that later.

This simple algorithm discussed in the forums is this.

1. Find all words in a tweet that exist in a master list. This list already associates a Valence score for a word. Scores can be positive or negative numbers.

2. Find the scores of these words and add them. This is the total score of the tweet.

3. Find all words from the tweet that don’t exist in the master list. These are the non-sentimental words.

4. If such a non-sentimental word occurs in a tweet with a positive score add 1 to a value associated with this word. If the non-sentimental word occurs in a tweet with a negative score or if the score is ‘0’ subtract one from the value associated with the word. The effect on the sentiment when we equate a negative score with ‘0’(else part of the if loop) is not explored. As I mentioned this is a simple algorithm.

This is accomplished by using a dictionary of words with each word associated with a list of two values, one for the positive accumulator and one for the negative accumulator.

import json
import sys
import types
import os
import os.path
import re

class Sentiment(object):

 
   def __init__(self):

        if not (os.path.isfile(sys.argv[1]) and os.access(sys.argv[1], os.R_OK) and os.path.isfile(sys.argv[2]) and os.access(sys.argv[2], os.R_OK)):
            print "Either files are missing or they are not readable"
    
        self.nonsentimentalwords = {}
        self.sent_file = open(sys.argv[1],'r')
        self.tweet_file = open(sys.argv[2],'r')

   def loadscores(self):
        self.scores = {} # initialize an empty dictionary
        for line in self.sent_file:
          term, score  = line.split("\t")  # The file is tab-delimited. "\t" means "tab character"
          self.scores[term] = int(score)  # Convert the score to an integer.

   def score(self,text):
        count = 0
        tweet = text.split()
        for s in tweet:
            if self.scores.has_key(s):
                count = count + self.scores.get(s)
        #print count             
        return count
   
   def scorenonsentimentalwords(self,text,count):
           tweet = text.split()
           for s in tweet:
                for s in tweet:
                    if (not self.scores.has_key(s.lower())) and (self.nonsentimentalwords.has_key(s.lower())):        
                        if count > 0:
                            self.nonsentimentalwords[s][0] = self.nonsentimentalwords[s][0] + 1 
                        else:   
                            self.nonsentimentalwords[s][1] = self.nonsentimentalwords[s][1] + 1 
   
   def addnonsentimentalwords(self,text):
       pos = 0
       neg = 0
       tweet = text.split()
       for s in tweet:
            if (not self.scores.has_key(s.lower())) and (not self.nonsentimentalwords.has_key(s.lower())):
                self.nonsentimentalwords[s] = [pos,neg]
                
   def analyze(self):
        with open(sys.argv[2],'r') as f:
            for data in f:
                d = json.loads(data)
                try: 
                    # print json-formatted string
                    #print json.dumps(d, sort_keys=True, indent=4)
                 
                    if d.get('text') and d.get('lang') == 'en':
                            #print "Tweet: ", d['text']
                            tex = re.sub("[^A-Z\sa-z]", "", d['text'])
                            count = Sentiment.score(self,tex)
                            Sentiment.addnonsentimentalwords(self,tex)
                            Sentiment.scorenonsentimentalwords(self,tex,count)

                except (ValueError, KeyError, TypeError):
                    print "Error"
        #for keys,values in self.nonsentimentalwords.items():
            #print(keys,values[0] - values[1],values)                
        for key, value in self.nonsentimentalwords.iteritems():
            print(str(key) + " " + str(value[0] - value[1]))              
            
                  
if __name__ == '__main__':


    sentiment=Sentiment()
    sentiment.loadscores()
    sentiment.analyze()

Analysis of tweets

import json
import sys
import types
import os
import os.path

class Sentiment(object):

 
   def __init__(self):

        if os.path.isfile(sys.argv[1]) and os.access(sys.argv[1], os.R_OK) and os.path.isfile(sys.argv[2]) and os.access(sys.argv[2], os.R_OK):
            print "Files " + sys.argv[1] + " and " + sys.argv[2] + " exist and are readable"
        else:
            print "Either files are missing or they are not readable"
    
        self.sent_file = open(sys.argv[1],'r')
        self.tweet_file = open(sys.argv[2],'r')


   def analyze(self):
        with open(sys.argv[2],'r') as f:
            for data in f:
                d = json.loads(data)
                try: 
                    # print json-formatted string
                    #print json.dumps(d, sort_keys=True, indent=4)
                 
                    if d.get('text') and d.get('lang') == 'en':
                            print "Tweet: ", d['text']
                 
                except (ValueError, KeyError, TypeError):
                    print "JSON format error"
                
        
if __name__ == '__main__':


    sentiment=Sentiment()
    sentiment.analyze()

I search for english tweets from this JSON file. The authentication is OAuth.

There are two files used by the code. Actually the task entails tweet sentiment analysis. There is a file with many tweets and one with sentiment scores and terms. The sentiment analysis is not done now.

{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700252786688,"id_str":"488584700252786688","text":"RT @Rama_MLaksani: @bellanissa_1 kamu kangen aku ya. Makasi :') wkwkwk","source":"\u003ca href=\"http:\/\/ubersocial.com\" rel=\"nofollow\"\u003eUberSocial for BlackBerry\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1671868802,"id_str":"1671868802","name":"Aiqon Farih.H","screen_name":"Aiqon_FH","location":"SMPM 08 GODOG,Laren,Lamongan","url":"http:\/\/aiqon-milanisti.blogspot.com","description":"Seri tanpa mencaci,kalah tanpa memaki,menang tetap rendah hati & jadilah MILANISTI sejati\r\n!! FORZA MILAN !!\r\nNO HP :082244650264 , PIN : 27509441","protected":false,"followers_count":712,"friends_count":698,"listed_count":0,"created_at":"Thu Aug 15 01:23:45 +0000 2013","favourites_count":67,"utc_offset":25200,"time_zone":"Bangkok","geo_enabled":false,"verified":false,"statuses_count":7199,"lang":"id","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/378800000051818005\/479c35d50f01e91fa038e3a2ae4df01c.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/378800000051818005\/479c35d50f01e91fa038e3a2ae4df01c.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/482129425173970946\/E4X39fSX_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/482129425173970946\/E4X39fSX_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1671868802\/1404140133","profile_link_color":"0084B4","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweeted_status":{"created_at":"Mon Jul 14 05:15:32 +0000 2014","id":488552352316944384,"id_str":"488552352316944384","text":"@bellanissa_1 kamu kangen aku ya. Makasi :') wkwkwk","source":"\u003ca href=\"https:\/\/mobile.twitter.com\" rel=\"nofollow\"\u003eMobile Web (M2)\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":487626710091710464,"in_reply_to_status_id_str":"487626710091710464","in_reply_to_user_id":399827061,"in_reply_to_user_id_str":"399827061","in_reply_to_screen_name":"bellanissa_1","user":{"id":2341625528,"id_str":"2341625528","name":"Rama M Laksani","screen_name":"Rama_MLaksani","location":"TwitterLand","url":null,"description":"Hello I'm Rock Star Indonesia | follbeck just mensyen :-D Impossible is Nothing | My Heroes Watanabe Mayu \u6e21\u8fba \u9ebb\u53cb \u2665 26th Des 1995  Email: Mello7455@gmail.com \u5927\u5cf6\u512a\u5b50","protected":false,"followers_count":184897,"friends_count":305,"listed_count":1,"created_at":"Thu Feb 13 08:29:18 +0000 2014","favourites_count":113,"utc_offset":25200,"time_zone":"Bangkok","geo_enabled":false,"verified":false,"statuses_count":2090,"lang":"id","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"1A1B1F","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/454961817026957313\/wzZhM9Dz.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/454961817026957313\/wzZhM9Dz.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/477443407321653248\/nKXXxbi5_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/477443407321653248\/nKXXxbi5_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2341625528\/1404581042","profile_link_color":"2FC2EF","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":660,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"bellanissa_1","name":"Bella C.N","id":399827061,"id_str":"399827061","indices":[0,13]}]},"favorited":false,"retweeted":false,"lang":"in"},"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"Rama_MLaksani","name":"Rama M Laksani","id":2341625528,"id_str":"2341625528","indices":[3,17]},{"screen_name":"bellanissa_1","name":"Bella C.N","id":399827061,"id_str":"399827061","indices":[19,32]}]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"in"}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700244803584,"id_str":"488584700244803584","text":"No es rubia pero es re hueeeeca","source":"\u003ca href=\"https:\/\/mobile.twitter.com\" rel=\"nofollow\"\u003eMobile Web (M2)\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1596221276,"id_str":"1596221276","name":"Maria Victoria","screen_name":"Tori_Coria","location":"Mendoza,Argentina. Florida,USA","url":"http:\/\/www.facebook.com\/#!\/tori.coria.ue","description":"Jugadora\/Hincha Cementista Futsal-River Plate-Creadora de #LasDelOctava-Cantante-Gringa.\r\n Esc. Comercio Martin Zapata \r\nMi canal http:\/\/t.co\/KfEHtV2ZHO","protected":false,"followers_count":807,"friends_count":363,"listed_count":2,"created_at":"Mon Jul 15 16:25:41 +0000 2013","favourites_count":5459,"utc_offset":-10800,"time_zone":"Brasilia","geo_enabled":true,"verified":false,"statuses_count":36461,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"0CF5BB","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/459813945113468928\/v_lOp_Ee.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/459813945113468928\/v_lOp_Ee.png","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/488152521592934401\/nAvUnfyd_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/488152521592934401\/nAvUnfyd_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1596221276\/1404970102","profile_link_color":"12E632","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"A60DDA","profile_text_color":"039BA1","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"es"}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700240609280,"id_str":"488584700240609280","text":"Tampoco tanto","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1536897037,"id_str":"1536897037","name":"BEO #2","screen_name":"shulietmartinez","location":"Soy de mi mejor agus","url":null,"description":"\u271e Justin is my religion \u271e","protected":false,"followers_count":343,"friends_count":271,"listed_count":0,"created_at":"Fri Jun 21 16:35:27 +0000 2013","favourites_count":159,"utc_offset":-10800,"time_zone":"Brasilia","geo_enabled":true,"verified":false,"statuses_count":3146,"lang":"es","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"EBC1C1","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/378800000122592331\/5c601c37a2e5e2ab1e142e80355b228a.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/378800000122592331\/5c601c37a2e5e2ab1e142e80355b228a.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/477492711193600000\/IzmpHgFI_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/477492711193600000\/IzmpHgFI_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1536897037\/1404175204","profile_link_color":"0084B4","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":{"type":"Point","coordinates":[-31.4387394,-64.2165457]},"coordinates":{"type":"Point","coordinates":[-64.2165457,-31.4387394]},"place":{"id":"00f84d414936f28e","url":"https:\/\/api.twitter.com\/1.1\/geo\/id\/00f84d414936f28e.json","place_type":"city","name":"Capital - C\u00f3rdoba","full_name":"Capital - C\u00f3rdoba","country_code":"AR","country":"Argentina","contained_within":[],"bounding_box":{"type":"Polygon","coordinates":[[[-64.3195,-31.5235762],[-64.3195,-31.307337],[-64.076643,-31.307337],[-64.076643,-31.5235762]]]},"attributes":{}},"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"es"}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700261179392,"id_str":"488584700261179392","text":"\u5929\u30eb\u30b7\u304c\u300c\u4eca\u5f15\u3051\u3070\u826f\u3044\u3053\u3068\u3042\u308b\u300d\u3063\u3066\u5fa1\u544a\u3052\u3092\u4e0b\u3055\u3063\u305f\u7d50\u679c http:\/\/t.co\/4B5ofyvDxU","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":120685545,"id_str":"120685545","name":"\u4f73\u7a42","screen_name":"kaho0315","location":"\u30a2\u30b5\u30ae\u30b7\u30c6\u30a3","url":null,"description":"\u3044\u308d\u3044\u308d\u624b\u3092\u51fa\u3057\u3066\u308b\u5b66\u751f\u3000\u3000\u3000\u6771\u65b9 SH \u30b2\u30fc\u30e0\u3068\u304b\u597d\u304d\u3000\u3000\u3053\u3048\u90e8\u3067\u6b4c\u3063\u305f\u308a\u3057\u3066\u307e\u3059\u3000\u30d1\u30ba\u30c9\u30e9\u3067\u30e1\u30a4\u30e1\u30a4\u3068\u9e92\u9e9f\u3092\u4f7f\u3063\u3066\u307e\u3059\u3000\u8a73\u3057\u304f\u306f\u2192http:\/\/twpf.jp\/kaho0315","protected":false,"followers_count":119,"friends_count":102,"listed_count":2,"created_at":"Sun Mar 07 06:37:20 +0000 2010","favourites_count":1228,"utc_offset":-36000,"time_zone":"Hawaii","geo_enabled":false,"verified":false,"statuses_count":41463,"lang":"ja","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"352726","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme5\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme5\/bg.gif","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/378800000823750461\/98c6f86074d400975b443490c15ac348_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/378800000823750461\/98c6f86074d400975b443490c15ac348_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/120685545\/1404193898","profile_link_color":"D02B55","profile_sidebar_border_color":"829D5E","profile_sidebar_fill_color":"99CC33","profile_text_color":"3E4415","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[],"media":[{"id":488584676810825728,"id_str":"488584676810825728","indices":[29,51],"media_url":"http:\/\/pbs.twimg.com\/media\/BsfNLMgCIAAngxL.jpg","media_url_https":"https:\/\/pbs.twimg.com\/media\/BsfNLMgCIAAngxL.jpg","url":"http:\/\/t.co\/4B5ofyvDxU","display_url":"pic.twitter.com\/4B5ofyvDxU","expanded_url":"http:\/\/twitter.com\/kaho0315\/status\/488584700261179392\/photo\/1","type":"photo","sizes":{"large":{"w":576,"h":1024,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"},"medium":{"w":576,"h":1024,"resize":"fit"},"small":{"w":340,"h":604,"resize":"fit"}}}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"medium","lang":"ja"}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700265758720,"id_str":"488584700265758720","text":"RT @GuitarmanDan: Also well done to Germany, someone had to win it, well done! #worldcup","source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1050524204,"id_str":"1050524204","name":"\u2764\ufe0f my country won \u2764\ufe0f","screen_name":"ashdacookie","location":"Germany","url":null,"description":"||| FakeLife |||","protected":false,"followers_count":7687,"friends_count":424,"listed_count":63,"created_at":"Mon Dec 31 15:06:48 +0000 2012","favourites_count":12040,"utc_offset":7200,"time_zone":"Berlin","geo_enabled":true,"verified":false,"statuses_count":63662,"lang":"de","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"131516","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme14\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme14\/bg.gif","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/487553964028989440\/vzM78hF__normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/487553964028989440\/vzM78hF__normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1050524204\/1405076955","profile_link_color":"910606","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"EFEFEF","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweeted_status":{"created_at":"Sun Jul 13 23:39:13 +0000 2014","id":488467718304440320,"id_str":"488467718304440320","text":"Also well done to Germany, someone had to win it, well done! #worldcup","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":411112055,"id_str":"411112055","name":"Dan Richards","screen_name":"GuitarmanDan","location":"Worldwide","url":"http:\/\/www.danrichardsmusic.com","description":"Guitarist and songwriter. Writer for Matchbox Music @matchboxmusic","protected":false,"followers_count":675701,"friends_count":277,"listed_count":3861,"created_at":"Sun Nov 13 00:45:43 +0000 2011","favourites_count":1136,"utc_offset":3600,"time_zone":"London","geo_enabled":false,"verified":false,"statuses_count":2604,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"022330","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme15\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme15\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/378800000381447009\/42b7d7906a35eb852c2dd6e21bb48e4c_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/378800000381447009\/42b7d7906a35eb852c2dd6e21bb48e4c_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/411112055\/1356640760","profile_link_color":"0084B4","profile_sidebar_border_color":"A8C7F7","profile_sidebar_fill_color":"C0DFEC","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":1643,"favorite_count":2668,"entities":{"hashtags":[{"text":"worldcup","indices":[61,70]}],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[{"text":"worldcup","indices":[79,88]}],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"GuitarmanDan","name":"Dan Richards","id":411112055,"id_str":"411112055","indices":[3,16]}]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"en"}
{"delete":{"status":{"id":488579327357747200,"user_id":2614826966,"id_str":"488579327357747200","user_id_str":"2614826966"}}}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700240613376,"id_str":"488584700240613376","text":"ta, cheguei ja ao ponto do Tokyo esp em que o epis\u00f3dio 1 se passou","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":53395833,"id_str":"53395833","name":"Lucas Jung","screen_name":"17_Handa_","location":"Brazil","url":null,"description":"Be who you are and say what you feel, because those who mind don't matter, and those who matter don't mind BARUCH, Bernard.","protected":false,"followers_count":98,"friends_count":89,"listed_count":0,"created_at":"Fri Jul 03 14:17:51 +0000 2009","favourites_count":535,"utc_offset":-10800,"time_zone":"Brasilia","geo_enabled":false,"verified":false,"statuses_count":25826,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"DCE0DF","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/473260303677792256\/j87e8CXK.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/473260303677792256\/j87e8CXK.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/485692897509900289\/9BA28cyD_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/485692897509900289\/9BA28cyD_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/53395833\/1398211234","profile_link_color":"8F0000","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"EFEFEF","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"pt"}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700240596992,"id_str":"488584700240596992","text":"On top of the list today, a 13 years old calling me \"nigga\" like he's come cool shit.","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":444103737,"id_str":"444103737","name":"Marcus Devin","screen_name":"ZoneTrooper","location":"","url":null,"description":"SWAT officer. Model for brands.","protected":false,"followers_count":3891,"friends_count":3657,"listed_count":7,"created_at":"Thu Dec 22 22:10:40 +0000 2011","favourites_count":826,"utc_offset":7200,"time_zone":"Amsterdam","geo_enabled":false,"verified":false,"statuses_count":20364,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/663857450\/5cnyr2kdkztzse9spazy.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/663857450\/5cnyr2kdkztzse9spazy.jpeg","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/481076969149583360\/_1B2Y3KJ_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/481076969149583360\/_1B2Y3KJ_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/444103737\/1403541220","profile_link_color":"85212B","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"252429","profile_text_color":"666666","profile_use_background_image":false,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"en"}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700249010178,"id_str":"488584700249010178","text":"added 50 photos - *****F0RWARD***** http:\/\/t.co\/iUIZFF7VDX http:\/\/t.co\/QR2bCp2yjK http:\/\/t.co\/mVC0quxgFY... http:\/\/t.co\/rvMIzDCfg8","source":"\u003ca href=\"http:\/\/www.facebook.com\/twitter\" rel=\"nofollow\"\u003eFacebook\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1003591208,"id_str":"1003591208","name":"DOOR2Y0HEART","screen_name":"DOOR2Y0HEART","location":"ORLANDO, FL 32803","url":"http:\/\/shar.es\/D39UO","description":"http:\/\/shar.es\/4AIEX http:\/\/shar.es\/hRSA0 http:\/\/shar.es\/hRmM1 http:\/\/shar.es\/hFHNS http:\/\/shar.es\/hQenn http:\/\/shar.es\/h82Kk","protected":false,"followers_count":36,"friends_count":123,"listed_count":0,"created_at":"Tue Dec 11 08:18:14 +0000 2012","favourites_count":15,"utc_offset":-25200,"time_zone":"Pacific Time (US & Canada)","geo_enabled":true,"verified":false,"statuses_count":2450,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/481415508999155712\/-0Ms4M98.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/481415508999155712\/-0Ms4M98.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/488408342037938177\/5xkHUoGW_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/488408342037938177\/5xkHUoGW_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1003591208\/1403613001","profile_link_color":"0084B4","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[{"url":"http:\/\/t.co\/iUIZFF7VDX","expanded_url":"http:\/\/bit.ly\/TsdiWm","display_url":"bit.ly\/TsdiWm","indices":[36,58]},{"url":"http:\/\/t.co\/QR2bCp2yjK","expanded_url":"http:\/\/shar.es\/NCdyy","display_url":"shar.es\/NCdyy","indices":[59,81]},{"url":"http:\/\/t.co\/mVC0quxgFY","expanded_url":"http:\/\/shar.es\/N4asx","display_url":"shar.es\/N4asx","indices":[82,104]},{"url":"http:\/\/t.co\/rvMIzDCfg8","expanded_url":"http:\/\/fb.me\/1bbCwqGp0","display_url":"fb.me\/1bbCwqGp0","indices":[108,130]}],"user_mentions":[]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"medium","lang":"vi"}
{"delete":{"status":{"id":427263875117883392,"user_id":433862422,"id_str":"427263875117883392","user_id_str":"433862422"}}}
{"created_at":"Mon Jul 14 07:24:04 +0000 2014","id":488584700269953025,"id_str":"488584700269953025","text":"G\u00fcnl\u00fck \u0130statistik: 50 yeni ki\u015fi takip etti, 28 ki\u015fi takibi b\u0131rakt\u0131 via http:\/\/t.co\/H6rsYQgcg7","source":"\u003ca href=\"http:\/\/www.unfow.org\" rel=\"nofollow\"\u003eUnfow\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":439414691,"id_str":"439414691","name":"Fatih Din\u00e7er","screen_name":"esmerimsi4126","location":"\u015eekerci D\u00fckkan\u0131","url":null,"description":"Esmeri seversin asdasdasd","protected":false,"followers_count":437,"friends_count":1112,"listed_count":0,"created_at":"Sat Dec 17 19:10:48 +0000 2011","favourites_count":451,"utc_offset":10800,"time_zone":"Istanbul","geo_enabled":false,"verified":false,"statuses_count":423,"lang":"tr","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"9AE4E8","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/487253114131464192\/Qyaqsf4q.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/487253114131464192\/Qyaqsf4q.jpeg","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/487242189714366464\/tOCTytGA_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/487242189714366464\/tOCTytGA_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/439414691\/1405005115","profile_link_color":"0084B4","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[{"url":"http:\/\/t.co\/H6rsYQgcg7","expanded_url":"http:\/\/unfow.org","display_url":"unfow.org","indices":[71,93]}],"user_mentions":[]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"medium","lang":"tr"}
{"delete":{"status":{"id":488528928571932672,"user_id":2670064137,"id_str":"488528928571932672","user_id_str":"2670064137"}}}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704455503874,"id_str":"488584704455503874","text":"Not but fr. \ud83d\ude02","source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":900423967,"id_str":"900423967","name":"\u2728Pale Princess\u2728","screen_name":"Tayllaaaguuuuhh","location":"Valley Center","url":null,"description":"\u262e I praise you God, for I am fearfully and wonderfully made. - Psalms 139:14~ \u262e \u2764\ufe0fSweet & Sassy \u2764\ufe0f","protected":false,"followers_count":1034,"friends_count":1073,"listed_count":4,"created_at":"Tue Oct 23 19:12:35 +0000 2012","favourites_count":21783,"utc_offset":-14400,"time_zone":"Eastern Time (US & Canada)","geo_enabled":true,"verified":false,"statuses_count":60679,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/436580835521593344\/x7hqj5Fx.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/436580835521593344\/x7hqj5Fx.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/486256191769546752\/CtzTLHcw_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/486256191769546752\/CtzTLHcw_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/900423967\/1405321312","profile_link_color":"0084B4","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"en"}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704430309377,"id_str":"488584704430309377","text":"@KYIBM \uc73c\uc5e5 (8 8","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":488583514804068352,"in_reply_to_status_id_str":"488583514804068352","in_reply_to_user_id":873491684,"in_reply_to_user_id_str":"873491684","in_reply_to_screen_name":"KYIBM","user":{"id":2254619977,"id_str":"2254619977","name":"7\/21~24 \ud734\uac00\u2665\uc548\ub098","screen_name":"Azalea_anna","location":"Ulsan G.H.Q","url":"http:\/\/ask.fm\/Azalea_anna","description":"(\u0e05\u318d\u03c9\u318d\u0e05)\u2665","protected":false,"followers_count":159,"friends_count":176,"listed_count":1,"created_at":"Fri Dec 20 07:04:28 +0000 2013","favourites_count":294,"utc_offset":32400,"time_zone":"Irkutsk","geo_enabled":false,"verified":false,"statuses_count":43149,"lang":"ko","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"0099B9","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme4\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme4\/bg.gif","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/486525161533755393\/I6RUySAv_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/486525161533755393\/I6RUySAv_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2254619977\/1403190721","profile_link_color":"0099B9","profile_sidebar_border_color":"5ED4DC","profile_sidebar_fill_color":"95E8EC","profile_text_color":"3C3940","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"KYIBM","name":"\u273f\uc0c1\ud47c\u273f","id":873491684,"id_str":"873491684","indices":[0,6]}]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"ko"}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704447111168,"id_str":"488584704447111168","text":"From the moment you see me not caring you have no chance.","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":143034194,"id_str":"143034194","name":"Trinidad \u2665","screen_name":"GotNoAbs","location":"trinidad and tobago","url":null,"description":"#TeamFollowBack #NoLiars #NoFakes #DmMe","protected":false,"followers_count":169,"friends_count":130,"listed_count":1,"created_at":"Wed May 12 12:00:43 +0000 2010","favourites_count":121,"utc_offset":-18000,"time_zone":"Quito","geo_enabled":false,"verified":false,"statuses_count":1813,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"1A1B1F","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/472487794904805376\/GK28yQGX.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/472487794904805376\/GK28yQGX.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/475676310593736704\/0VW7SDQt_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/475676310593736704\/0VW7SDQt_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/143034194\/1404847808","profile_link_color":"0AFF58","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"252429","profile_text_color":"666666","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"en"}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704438714368,"id_str":"488584704438714368","text":"Yash.... Es otra cosa \ud83d\udca6\ud83d\udc45","source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1332727292,"id_str":"1332727292","name":"\u26a1\ufe0fCurry Jr\u26a1\ufe0f","screen_name":"KrisMedal04","location":"","url":null,"description":null,"protected":false,"followers_count":379,"friends_count":191,"listed_count":0,"created_at":"Sat Apr 06 23:43:51 +0000 2013","favourites_count":7431,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":11194,"lang":"es","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/378800000022630121\/8d8a8afa6e291e29215fdcc58062c663.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/378800000022630121\/8d8a8afa6e291e29215fdcc58062c663.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/471866022572482560\/yL8up87D_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/471866022572482560\/yL8up87D_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1332727292\/1405066630","profile_link_color":"0084B4","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"es"}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704442920960,"id_str":"488584704442920960","text":"\u305d\u3046\u3044\u3084\u3046\u3061\u306e\u5927\u5b66\u304b\u3089\u4eca\u5e741\u4eba\u30dc\u30b9\u30b3\u30f3\u51fa\u305f\u3089\u3057\u3044","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":276053087,"id_str":"276053087","name":".","screen_name":"Mersu06","location":"","url":null,"description":null,"protected":false,"followers_count":1010,"friends_count":865,"listed_count":96,"created_at":"Sat Apr 02 15:07:40 +0000 2011","favourites_count":2237,"utc_offset":32400,"time_zone":"Tokyo","geo_enabled":false,"verified":false,"statuses_count":185460,"lang":"ja","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/484792897149992961\/EOKdn0ll_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/484792897149992961\/EOKdn0ll_normal.jpeg","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"ja"}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704451284993,"id_str":"488584704451284993","text":"@adimyd6 di, harganya brpaan dah macaroni panggangnya?lupa gue","source":"\u003ca href=\"http:\/\/blackberry.com\/twitter\" rel=\"nofollow\"\u003eTwitter for BlackBerry\u00ae\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":488583053904592896,"in_reply_to_status_id_str":"488583053904592896","in_reply_to_user_id":215699561,"in_reply_to_user_id_str":"215699561","in_reply_to_screen_name":"adimyd6","user":{"id":89450108,"id_str":"89450108","name":"Sita","screen_name":"shitatashita","location":"Jakarta","url":null,"description":"Cinta datang krn terbiasa\u2665||Konsisten di dalam sebuah KOMITMEN","protected":false,"followers_count":320,"friends_count":230,"listed_count":0,"created_at":"Thu Nov 12 13:52:21 +0000 2009","favourites_count":47,"utc_offset":25200,"time_zone":"Jakarta","geo_enabled":true,"verified":false,"statuses_count":20451,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"FFF04D","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/482192148364664832\/geIla1r7.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/482192148364664832\/geIla1r7.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/482999031321227264\/erw1v2LQ_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/482999031321227264\/erw1v2LQ_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/89450108\/1404022233","profile_link_color":"0099CC","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"F0EBEB","profile_text_color":"932BAD","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"adimyd6","name":"adimulyadi","id":215699561,"id_str":"215699561","indices":[0,8]}]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"in"}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704463863808,"id_str":"488584704463863808","text":"@security2_s2 \uadf8\ub7fc \uc6b0\ub9ac \uacc4\ud68d\ud45c\ubd80\ud130 \uc9dc\uc838 \u3147\u3147\u3147\u3147\u3147","source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":488582239668563968,"in_reply_to_status_id_str":"488582239668563968","in_reply_to_user_id":550807297,"in_reply_to_user_id_str":"550807297","in_reply_to_screen_name":"security2_s2","user":{"id":2223286993,"id_str":"2223286993","name":"\ud638\uc5d0\uc7a0\ubc14\uc5d0\uc5d0","screen_name":"S2jamba","location":"\uadf8\uc758 \ub9d8 \uc5b4\ub518\uac00\uc5d0","url":null,"description":"\ud50c\ud544, \ud5e4\ub354\ub294 \uc11c\ub9b0\ub2d8S2","protected":false,"followers_count":102,"friends_count":119,"listed_count":6,"created_at":"Sat Nov 30 15:26:52 +0000 2013","favourites_count":5234,"utc_offset":32400,"time_zone":"Irkutsk","geo_enabled":false,"verified":false,"statuses_count":30049,"lang":"ko","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"131516","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme14\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme14\/bg.gif","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/486581042954776576\/gvc_KPAh_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/486581042954776576\/gvc_KPAh_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2223286993\/1404658418","profile_link_color":"FF8C92","profile_sidebar_border_color":"EEEEEE","profile_sidebar_fill_color":"EFEFEF","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"security2_s2","name":"S2\ub294 \ubc30\uac00 \uace0\ud504\ub2e4","id":550807297,"id_str":"550807297","indices":[0,13]}]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"ko"}
{"created_at":"Mon Jul 14 07:24:05 +0000 2014","id":488584704426139649,"id_str":"488584704426139649","text":"Est\u00e1 vez no me fall\u00f3 a mi por no fallarle a alguien m\u00e1s si te quieres ir la puerta es muy grande","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":163270481,"id_str":"163270481","name":"Miriam Almanza ","screen_name":"miriam_almanzab","location":"Le\u00f3n, Guanajuato","url":null,"description":"Abogada en Proceso por la Ibero..\r\n\r\n        Un d\u00eda a la vez","protected":false,"followers_count":243,"friends_count":243,"listed_count":1,"created_at":"Tue Jul 06 00:24:59 +0000 2010","favourites_count":309,"utc_offset":-18000,"time_zone":"Mexico City","geo_enabled":true,"verified":false,"statuses_count":5546,"lang":"es","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"EDECE9","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/801568776\/ba53817d3e3436bbd9398a6bcd1e396a.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/801568776\/ba53817d3e3436bbd9398a6bcd1e396a.jpeg","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/3486638747\/771cdd609ce10104ce49cb0681429a2e_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/3486638747\/771cdd609ce10104ce49cb0681429a2e_normal.jpeg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/163270481\/1361955879","profile_link_color":"088253","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"es"}

Tweet: RT @GuitarmanDan: Also well done to Germany, someone had to win it, well done! #worldcup
Tweet: On top of the list today, a 13 years old calling me “nigga” like he’s come cool shit.
Tweet: Not but fr. 😂
Tweet: From the moment you see me not caring you have no chance.

rJava, rCharts and R code to display GC data

These are the steps I follow to display GC activity data using a nvd3 discrete bar chart.

Call Java class using rJava

  gctypes <- .jcall(realtimegcdataobserver ,"Ljava/util/List;","getGCTypes")

Create an empty data frame to hold the data

I get the type of the GC algorithm, GC count and time from JMX. I have yet to explore the last two values.

gcdata <- function(){
  df <- data.frame(
                 GCType=character(), 
                 Count=character(),
                 Time=character(), 
                 stringsAsFactors=FALSE)
  print(df)
  return(df)
}

Iterate over the list of beans

Call appropriate methods and fill up the empty data frame.
I massage the data using the last two lines but don’t know any elegant way to accomplish this.

  emptygcdata <- gcdata()
  gctypedetails <- sapply( gctypes, function(item) rbind(emptygcdata, as.data.frame(c(GCType=item$getName(),Count=item$getL(),Time=item$getM()))))

  gctypedetails <- data.frame(gctypedetails)
  gctypedetails <- data.frame(matrix(unlist(gctypedetails)))

matrix.unlist.gctypedetails..
1 PS Scavenge
2 16
3 22
4 PS MarkSweep
5 0
6 0


emptygcdata <- gcdata()
  before <- 0
  after <- 2
  repeat
  {
    if (after >= nrow(gctypedetails))
     break;
    emptygcdata <- rbind(emptygcdata, data.frame(GCType =gctypedetails[before + 1,1], Count =gctypedetails[before + 2,1], Time=gctypedetails[before + 3,1]))
    before <- after + 1;
    after <- after + 2;
   }

 GCType          Count  Time
1  PS Scavenge      16  22
2  PS MarkSweep     0  0

nvd3 using rCharts

  p2 = nPlot(x = "Time", y = "Count", data = emptygcdata, type = "discreteBarChart")
  p2$chart(
    color = "#! function(d){
      var ourColorScale = d3.scale.ordinal().domain(['PS MarkSweep','PS Scavenge']).range(['green','purple']);
      return ourColorScale(d.GCType);
    }!#")