<commit_before>package com.olq.whatsthatflag

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.view.View
import android.widget.Button
import android.widget.ImageView
import com.squareup.picasso.Picasso
import kotlinx.android.synthetic.main.activity_main.*
import org.jetbrains.anko.doAsync
import org.jetbrains.anko.toast
import org.jetbrains.anko.uiThread
import java.util.*


class MainActivity : AppCompatActivity() {

    var id: Int = 0
    var score: Int = 0

    var flagList = mutableListOf<String>()
    val buttonNames = arrayOf<String>("", "", "", "")


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val amountOfCountries = intent.getIntExtra("AMOUNT_OF_COUNTRIES", 20)

        showProgressBar()
        toast("Downloading content...")

        doAsync {
            Downloader.downloadListOfCountries(flagList)

            uiThread {
                hideProgressBar()

                if(amountOfCountries != -1) {
                    splitFlagList(flagList, amountOfCountries)
                }

                Collections.shuffle(flagList)

                loadImg()
                renameBtns()
            }
        }
    }

    fun splitFlagList(flagList: MutableList<String>, amountOfCountries: Int){
        flagList.split(amountOfCountries)

        Log.d("splitFlagList", flagList.size.toString() + "\n" + flagList.toString())
    }

    fun MutableList<String>.split(fromIndex: Int){
        for (i in fromIndex..this.size-1){
            this.removeAt(0)
        }<commit_msg>Fixed bug with shuffling flagList<commit_after>package com.olq.whatsthatflag

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.view.View
import android.widget.Button
import android.widget.ImageView
import com.squareup.picasso.Picasso
import kotlinx.android.synthetic.main.activity_main.*
import org.jetbrains.anko.doAsync
import org.jetbrains.anko.toast
import org.jetbrains.anko.uiThread
import java.util.*


class MainActivity : AppCompatActivity() {

    var id: Int = 0
    var score: Int = 0

    var flagList = mutableListOf<String>()
    val buttonNames = arrayOf<String>("", "", "", "")


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val amountOfCountries = intent.getIntExtra("AMOUNT_OF_COUNTRIES", 20)

        showProgressBar()
        toast("Downloading content...")

        doAsync {
            Downloader.downloadListOfCountries(flagList)

            uiThread {
                hideProgressBar()

                Collections.shuffle(flagList)

                if(amountOfCountries != -1) {
                    splitFlagList(flagList, amountOfCountries)
                }

                loadImg()
                renameBtns()
            }
        }
    }

    fun splitFlagList(flagList: MutableList<String>, amountOfCountries: Int){
        flagList.split(amountOfCountries)

        Log.d("splitFlagList", flagList.size.toString() + "\n" + flagList.toString())
    }

    fun MutableList<String>.split(fromIndex: Int){
        for (i in fromIndex..this.size-1){
            this.removeAt(0)
        }
{'fraction_non_alphanumeric': 0.10207715133531158, 'fraction_numerical': 0.004747774480712166, 'mean_word_length': 2.574761399787911, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '412568', 'n_tokens_mistral': 1022, 'n_tokens_neox': 953, 'n_words': 174}