<commit_before>import React from 'react'
import {compose, withState} from 'recompose'

import {clickable} from '../style.css'
import {Audio, View, Text, TextInput} from '../components'

let Player = compose(
  withState('volume', 'setVolume', 0.1)
)(({volume, setVolume, time, URL}) => (
  <View>
    <Audio volume={volume} src={`${URL}${time}.mp3`} autoPlay />

    <TextInput
      style={{width: 30}}
      onTextChange={text => {
        let num = parseInt(text)
        if (!Number.isNaN(num)) {
          setVolume(num / 100)
        } else {
          setVolume(0)
        }
      }}
      value={Math.ceil(volume * 100)}
    />%

    <View>
<<<<<<< HEAD
      {volume}
      <View className={clickable} onClick={() => setVolume(Math.min((((volume*10) + 1)/10), 1))}>
        HARDER { volume === 1 && '(Nog harder heeft geen zin srry)'}
      </View>
      <View className={clickable} onClick={() => setVolume(Math.max((((volume*10) - 1)/10), 0))}>
        ZACHTER { volume === 0 && '(Hij is al op z\'n zachts)'}
=======
      <View className={clickable} onClick={() => setVolume(Math.min(volume + 0.1, 1))}>
        HARDER { volume >= 1 && '(Nog harder heeft geen zin srry)'}
      </View>
      <View className={clickable} onClick={() => setVolume(Math.max(volume - 0.1, 0))}>
        ZACHTER { volume <= 0 && '(Hij is al op z\'n zachts)'}
>>>>>>> dralletje/master
      </View>
    </View>
  </View>
))

export default Player
<commit_msg>fixed floating point bug<commit_after>import React from 'react'
import {compose, withState} from 'recompose'

import {clickable} from '../style.css'
import {Audio, View, Text, TextInput} from '../components'

let Player = compose(
  withState('volume', 'setVolume', 0.1)
)(({volume, setVolume, time, URL}) => (
  <View>
    <Audio volume={volume} src={`${URL}${time}.mp3`} autoPlay />

    <TextInput
      style={{width: 30}}
      onTextChange={text => {
        let num = parseInt(text)
        if (!Number.isNaN(num)) {
          setVolume(num / 100)
        } else {
          setVolume(0)
        }
      }}
      value={Math.ceil(volume * 100)}
    />%

    <View>
      <View className={clickable} onClick={() => setVolume(Math.min((((volume*10) + 1)/10), 1))}>
        HARDER { volume === 1 && '(Nog harder heeft geen zin srry)'}
      </View>
      <View className={clickable} onClick={() => setVolume(Math.max((((volume*10) - 1)/10), 0))}>
        ZACHTER { volume === 0 && '(Hij is al op z\'n zachts)'}
      </View>
    </View>
  </View>
))

export default Player

{'fraction_non_alphanumeric': 0.19920792079207922, 'fraction_numerical': 0.023762376237623763, 'mean_word_length': 2.7757847533632285, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7457477', 'n_tokens_mistral': 903, 'n_tokens_neox': 852, 'n_words': 213}