<commit_before>package com.movies.tobi.popularmovies;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Menu;
import android.view.MenuItem;

import com.movies.tobi.popularmovies.popularstream.MoviePoster;
import com.movies.tobi.popularmovies.popularstream.PopularStreamApiDatasource;
import com.movies.tobi.popularmovies.popularstream.PopularStreamRepository;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import rx.Subscriber;

public class PopularMoviesActivity extends AppCompatActivity {

    private static final int POSTER_COL_COUNT = 3;

    @Bind(R.id.popularMovies_recycler)
    RecyclerView popularMoviesRecycler;

    private PopularStreamRepository popularStreamRepository = new PopularStreamRepository(new PopularStreamApiDatasource());

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_popular_movies);
        ButterKnife.bind(this);

        popularMoviesRecycler.setLayoutManager(new GridLayoutManager(this, POSTER_COL_COUNT));
        popularMoviesRecycler.setHasFixedSize(true);

        popularStreamRepository.getPopularPosters().subscribe(new Subscriber<List<MoviePoster>>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(List<MoviePoster> moviePosters) {
                popularMoviesRecycler.setAdapter(new MoviePosterAdapter(moviePosters));
            }
        });

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long<commit_msg>log error when loading movie posters<commit_after>package com.movies.tobi.popularmovies;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import com.movies.tobi.popularmovies.popularstream.MoviePoster;
import com.movies.tobi.popularmovies.popularstream.PopularStreamApiDatasource;
import com.movies.tobi.popularmovies.popularstream.PopularStreamRepository;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import rx.Subscriber;

public class PopularMoviesActivity extends AppCompatActivity {

    private static final String TAG = PopularMoviesActivity.class.getSimpleName();
    private static final int POSTER_COL_COUNT = 3;

    @Bind(R.id.popularMovies_recycler)
    RecyclerView popularMoviesRecycler;

    private PopularStreamRepository popularStreamRepository = new PopularStreamRepository(new PopularStreamApiDatasource());

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_popular_movies);
        ButterKnife.bind(this);

        popularMoviesRecycler.setLayoutManager(new GridLayoutManager(this, POSTER_COL_COUNT));
        popularMoviesRecycler.setHasFixedSize(true);

        popularStreamRepository.getPopularPosters().subscribe(new Subscriber<List<MoviePoster>>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
                Log.e(TAG, "Error loading movie posters", e);
            }

            @Override
            public void onNext(List<MoviePoster> moviePosters) {
                popularMoviesRecycler.setAdapter(new MoviePosterAdapter(moviePosters));
            }
        });

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
{'fraction_non_alphanumeric': 0.07730619315721092, 'fraction_numerical': 0.0017323516673884798, 'mean_word_length': 3.48011639185257, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5529593', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1228, 'n_words': 268}