<commit_before>/** @jsx React.DOM */
var React = require('react'),
    LimitSelect = require('./limitSelect.jsx'),

Product = React.createClass({
    getInitialState: function () {
        return {selectedSpec: 0}
    },
    render: function () {
        var specs = [],
            I;

        for (I=0;I<this.props.specs.length;I++) {
            specs.push(
                <option id={this.props.specs[I].id}>{this.props.specs[I].title}</option>
            );
        }

        return (
<div>
 <h1>{this.props.title}</h1>
 <p>{this.props.description}</p>
 <span>Price: <i>$</i><b>{this.props.price}</b></span>
 <div>Pick a spec:<select>{specs}</select>
  <LimitSelect max={this.props.specs[this.state.selectedSpec].limit} />
 </div>
</div>
        );
    }<commit_msg>now we handle onChange but no client side behaviors, should do client side tasks now<commit_after>/** @jsx React.DOM */
var React = require('react'),
    LimitSelect = require('./limitSelect.jsx'),

Product = React.createClass({
    getInitialState: function () {
        return {selectedSpec: 0}
    },
    handleSpecChange: function () {
        this.setState({selectedSpec: event.target.value});
    },
    render: function () {
        var specs = [],
            I;

        for (I=0;I<this.props.specs.length;I++) {
            specs.push(
                <option value={this.props.specs[I].id} selected={I==this.state.selectedSpec}>{this.props.specs[I].title}</option>
            );
        }

        return (
<div>
 <h1>{this.props.title}</h1>
 <p>{this.props.description}</p>
 <span>Price: <i>$</i><b>{this.props.price}</b></span>
 <div>Pick a spec:<select onChange={this.handleSpecChange}>{specs}</select>
  <LimitSelect max={this.props.specs[this.state.selectedSpec].limit} />
 </div>
</div>
        );
    }
{'fraction_non_alphanumeric': 0.19108635097493037, 'fraction_numerical': 0.004456824512534819, 'mean_word_length': 2.6504065040650406, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 41, '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': '7012215', 'n_tokens_mistral': 602, 'n_tokens_neox': 587, 'n_words': 96}