<commit_before>package com.ibm.mil.cafejava.sample;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import com.ibm.mil.cafejava.CafeJava;
import com.worklight.wlclient.api.WLResponse;

import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;


public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final ProgressDialog dialog = new ProgressDialog(this);
        dialog.show();

        new CafeJava()
                .createConnectionObservable(this)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<WLResponse>() {
                    @Override public void call(WLResponse wlResponse) {
                        dialog.cancel();
                        Toast.makeText(MainActivity.this, "Connected to Worklight", Toast.LENGTH_SHORT).show();
                    }
                }, new Action1<Throwable>() {
                    @Override public void call(Throwable throwable) {
                        dialog.cancel();
                        Toast.makeText(MainActivity.this, throwable.getMessage(), Toast.LENGTH_SHORT).show();
                    }
                });
    }
<commit_msg>Add copyright header to sample source file<commit_after>/*
 * Licensed Materials - Property of IBM
 * © Copyright IBM Corporation 2015. All Rights Reserved.
 */

package com.ibm.mil.cafejava.sample;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import com.ibm.mil.cafejava.CafeJava;
import com.worklight.wlclient.api.WLResponse;

import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final ProgressDialog dialog = new ProgressDialog(this);
        dialog.show();

        new CafeJava()
                .createConnectionObservable(this)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<WLResponse>() {
                    @Override public void call(WLResponse wlResponse) {
                        dialog.cancel();
                        Toast.makeText(MainActivity.this, "Connected to Worklight", Toast.LENGTH_SHORT).show();
                    }
                }, new Action1<Throwable>() {
                    @Override public void call(Throwable throwable) {
                        dialog.cancel();
                        Toast.makeText(MainActivity.this, throwable.getMessage(), Toast.LENGTH_SHORT).show();
                    }
                });
    }

{'fraction_non_alphanumeric': 0.09479921000658328, 'fraction_numerical': 0.0032916392363396972, 'mean_word_length': 2.2996742671009773, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4629419', 'n_tokens_mistral': 810, 'n_tokens_neox': 755, 'n_words': 156}