<commit_before>/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 */
'use strict';

var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
} = React;

var HandsOnReactNative = React.createClass({
  render: function() {
    return (
      <View style={styles.container}>
        <Text style={styles.instructions}>
          Hello React Native
        </Text>
      </View>
    );
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

AppRegistry.registerComponent('HandsOnReactNative', () => HandsOnReactNative);<commit_msg>Add android version<commit_after>var React = require('react-native');
var {
  AppRegistry,
  ListView,
  StyleSheet,
  Text,
  View,
} = React;

var DATA = require('./simple.json');
var StatusCell = require('./cell');

var HandsOnReactNative = React.createClass({
  getInitialState() {
    var ds = new ListView.DataSource({
      rowHasChanged: (r1, r2) => r1 !== r2,
      sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
    });

    return {
      ds: ds,
      data: null,
    };
  },

  componentDidMount() {
    this._refreshData();
  },

  _refreshData() {
    fetch('http://46.101.203.134/simple.json').then(response => {
      return response.json();
    }).then(json => {
      this.setState({
        data: json,
      });
    });
  },

  _renderSectionHeader(hashtag) {
    return (
      <View style={styles.sectionHeader}>
        <Text style={styles.sectionHeaderText}>#{hashtag}</Text>
      </View>
    );
  },

  _renderCell(status) {
    return (
      <Text>{status.text}</Text>
    );
  },

  render() {
    if (!this.state.data) {
      return (
        <View style={styles.loadingWrapper}>
          <Text>Loading...</Text>
        </View>
      );
    }

    var groups = this.state.data.groups;
    var dataSource = this.state.ds.cloneWithRowsAndSections(groups);

    return (
      <ListView
        dataSource={dataSource}
        renderSectionHeader={(sectionData, hashtag) => this._renderSectionHeader(hashtag)}
        renderRow={status => <StatusCell status={status} />} />
    );
  },
});

var styles = StyleSheet.create({
  loadingWrapper: {
    paddingTop: 100,
    alignSelf: 'center',
  },
  sectionHeader: {
    alignSelf: 'stretch',
    backgroundColor: 'lightgray',
    padding: 5,
  },
  sectionHeaderText: {
    fontWeight: 'bold',
  },
});
AppRegistry.registerComponent('HandsOnReactNative', () => HandsOnReactNative);
{'fraction_non_alphanumeric': 0.1604258443465492, 'fraction_numerical': 0.013215859030837005, 'mean_word_length': 2.779472954230236, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1359221', 'n_tokens_mistral': 904, 'n_tokens_neox': 879, 'n_words': 163}