<commit_before><link rel="import"
      href="bower_components/polymer/polymer.html">
<link rel="import"
      href="bower_components/paper-input/paper-input.html">
<link rel="import"
      href="bower_components/paper-button/paper-button.html">

<dom-module id="sevenguis-temperature">
  <template>

    <paper-input type="number" value="{{celsius}}"></paper-input> celsius <br>
    <paper-input type="number" value="{{fahrenheit}}"></paper-input> fahrenheit

  </template>
  
  <script>
    Polymer({
      is: "sevenguis-temperature",
      
      properties: {
        celsius: Number,
        fahrenheit: {
          type: Number,
          computed: "computeFahrenheit(celsius)"
        }
      },
      
      ready: function() {
        this.celsius = 100
      },
      
      computeFahrenheit: function(celsius) {
        return (celsius * (9 / 5)) + 32
      },
      
      computeCelsius: function(fahrenheit) {
        return (fahrenheit - 32) * (5 / 9)
      }
    });
  </script>
</dom-module><commit_msg>(fix) Compute other values via on-change<commit_after><link rel="import"
      href="bower_components/polymer/polymer.html">
<link rel="import"
      href="bower_components/paper-input/paper-input.html">
<link rel="import"
      href="bower_components/paper-button/paper-button.html">

<dom-module id="sevenguis-temperature">
  <template>

    <paper-input type="number" value="{{celsius}}"></paper-input> celsius <br>
    <paper-input type="number" value="{{computeKelvin(celsius)}}" on-change="kelvinChanged"></paper-input> kelvin <br>
    <paper-input type="number" value="{{computeFahrenheit(celsius)}}" on-change="fahrenheitChanged"></paper-input> fahrenheit

  </template>
  
  <script>
    Polymer({
      is: "sevenguis-temperature",
      
      properties: {
        celsius: Number
      },
      
      ready: function() {
        this.celsius = 100
      },
      
      kelvinChanged: function(event){
        this.celsius = event.target.value - 273.15
      },
      
      fahrenheitChanged: function(event){
        this.celsius = (event.target.value - 32) * (5/9)
      },
      
      computeFahrenheit: function(celsius) {
        return (Number(celsius) * (9 / 5)) + 32
      },
      
      computeKelvin: function(celsius) {
        return Number(celsius) + 273.15
      }
    });
  </script>
</dom-module>
{'fraction_non_alphanumeric': 0.15440238196512124, 'fraction_numerical': 0.013611229264142918, 'mean_word_length': 2.5908396946564887, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, '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': '1330665', 'n_tokens_mistral': 805, 'n_tokens_neox': 745, 'n_words': 123}