<commit_before>package com.st33fo.glideforktt;

import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;


import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;

import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.IOException;
import java.io.InputStream;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.CookieStore;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.concurrent.CountDownLatch;


public class Feed extends AppCompatActivity  {
    private Toolbar myToolbar;
    private Toolbar cardViewToolBar;
    private RecyclerView feedRecyclerView;
    private static String URL = "http://www.kanyetothe.com/forum/index.php?action=recent";
    private LinearLayoutManager myLinearLM;
    private FeedObject feed;
    private List<String> image_url = new ArrayList<String>();
    private List<String> Username = new ArrayList<String>();
    List<FeedObject> feeds = new ArrayList<FeedObject>();
    List<String> links = new ArrayList<String>();
    private final String KEY_RECYCLER_STATE = "recycler_state";
    private Bundle mBundleRecyclerViewState;
    private String sessionId;
    private static RequestQueue myRequestQueue = null;

    FeedAdapter feedAdapter;
    private SwipeRefreshLayout swipe;
    private AsyncTask activitystart;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_feed);
        CookieHandler.setDefault(new CookieManager());
        myToolbar = (Toolbar) findViewById(R.id.feedToolBar);
        setSupportActionBar(myToolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        feedRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        swipe = (SwipeRefreshLayout) findViewById(R.id.swipe);
        sessionId = SecuredSharePreference.getPrefCookies(Feed.this);

        myLinearLM = new LinearLayoutManager(Feed.this);


        feedRecyclerView.setLayoutManager(myLinearLM);

        new getFeed().execute();


        swipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {

                clearData();
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
                    new getFeed().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
                else
                    new getFeed().execute();




            }
        });


    }

//    public Document GetDocument(String site) throws Exception {
//        final Document[] doc = new Document[1];
//        final CountDownLatch cdl = new CountDownLatch(1);
//
//
//        StringRequest documentRequest = new StringRequest( //
//                Request.Method.GET, //
//                site, //
//                new Response.Listener<String>() {
//                    @Override
//                    public void onResponse(String response) {
//                        doc[0] = Jsoup.parse(response);
//
//                        cdl.countDown();
//                    }
//                }, //
//
//                new Response.ErrorListener() {
//                    @Override
//                    public void onErrorResponse(VolleyError error) {
//                        // Error handling
//                        System.out.println("Houston we have a problem ... !");
//                        error.printStackTrace();
//                    }
//                }
//        ){<commit_msg>Testing<commit_after>package com.st33fo.glideforktt;

import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;


import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;

import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.IOException;
import java.io.InputStream;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.CookieStore;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.concurrent.CountDownLatch;


public class Feed extends AppCompatActivity  {
    private Toolbar myToolbar;
    private Toolbar cardViewToolBar;
    private RecyclerView feedRecyclerView;
    private static String URL = "http://www.kanyetothe.com/forum/index.php?action=recent";
    private LinearLayoutManager myLinearLM;
    private FeedObject feed;
    private List<String> image_url = new ArrayList<String>();
    private List<String> Username = new ArrayList<String>();
    List<FeedObject> feeds = new ArrayList<FeedObject>();
    List<String> links = new ArrayList<String>();
    private final String KEY_RECYCLER_STATE = "recycler_state";
    private Bundle mBundleRecyclerViewState;
    private String sessionId;
    private static RequestQueue myRequestQueue = null;

    FeedAdapter feedAdapter;
    private SwipeRefreshLayout swipe;
    private AsyncTask activitystart;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_feed);
        CookieHandler.setDefault(new CookieManager());
        myToolbar = (Toolbar) findViewById(R.id.feedToolBar);
        setSupportActionBar(myToolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        feedRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        swipe = (SwipeRefreshLayout) findViewById(R.id.swipe);
        sessionId = SecuredSharePreference.getPrefCookies(Feed.this);

        myLinearLM = new LinearLayoutManager(Feed.this);


        feedRecyclerView.setLayoutManager(myLinearLM);

        new getFeed().execute();


        swipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {

                clearData();
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
                    new getFeed().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
                else
                    new getFeed().execute();




            }
        });
    }

//    public Document GetDocument(String site) throws Exception {
//        final Document[] doc = new Document[1];
//        final CountDownLatch cdl = new CountDownLatch(1);
//
//
//        StringRequest documentRequest = new StringRequest( //
//                Request.Method.GET, //
//                site, //
//                new Response.Listener<String>() {
//                    @Override
//                    public void onResponse(String response) {
//                        doc[0] = Jsoup.parse(response);
//
//                        cdl.countDown();
//                    }
//                }, //
//
//                new Response.ErrorListener() {
//                    @Override
//                    public void onErrorResponse(VolleyError error) {
//                        // Error handling
//                        System.out.println("Houston we have a problem ... !");
//                        error.printStackTrace();
//                    }
//                }
//        ){
{'fraction_non_alphanumeric': 0.1024070945945946, 'fraction_numerical': 0.0021114864864864866, 'mean_word_length': 2.7998395507420777, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2645386', 'n_tokens_mistral': 2651, 'n_tokens_neox': 2528, 'n_words': 508}