问:
How to stop the animation scroll of jquery?

function valueE(e) {
  var newValue = e.target.value;
  var $radio = $(e.target);

  if ($radio.is('.Fr')) {
    $radio.closest('tr').find('.numFr').val(newValue);
  } else {
    $radio.closest('tr').find('.numIr').val(newValue);
  }
}

$(document).ready(function() {

  $('#showme').click(function() {
    validateNresult();
  })

  $('.allrb').change(valueE);

});

function validateNresult() {

  $.each($("tbody tr"), function(i, e)
  {
    var hasInvalidInputs = $(this).find(".numFr, .numIr").filter(function() {
      return $.trim(this.value).length === 0;
    }).length > 0;

    if (hasInvalidInputs)
    {
      $(this).addClass("invalid");
           $('html, body').animate(
            {
             scrollTop: ($(this).offset().top)
            },
            1000
        );

    }

    else {
      $(this).removeClass("invalid");
    }

  });

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>input[type=number] {
  width: 25px;
  text-align: center;
}

.invalid {
  outline: 1px solid red;
}</code>```

    content 1
    <input type="radio" name="Fr1" class="allrb Fr" value="0">
    <input type="radio" name="Fr1" class="allrb Fr" value="1">
    <input type="radio" name="Fr1" class="allrb Fr" value="2">
    <input type="radio" name="Fr1" class="allrb Fr" value="3">
    <input type="radio" name="Fr1" class="allrb Fr" value="4">
    <input type="radio" name="Ir1" class="allrb Ir" value="0" >
    <input type="radio" name="Ir1" class="allrb Ir" value="1" >
    <input type="radio" name="Ir1" class="allrb Ir" value="2" >
    <input type="radio" name="Ir1" class="allrb Ir" value="3" >
    <input type="radio" name="Ir1" class="allrb Ir" value="4" >
    <input type="number" name="numFr1" class="numFr" id="numFr1" disabled>
    <input type="number" name="numIr1" class="numIr" id="numIr1" disabled>

    content 2
    <input type="radio" name="Fr2" class="allrb Fr" value="0">
    <input type="radio" name="Fr2" class="allrb Fr" value="1">
    <input type="radio" name="Fr2" class="allrb Fr" value="2">
    <input type="radio" name="Fr2" class="allrb Fr" value="3">
    <input type="radio" name="Fr2" class="allrb Fr" value="4">
    <input type="radio" name="Ir2" class="allrb Ir" value="0" >
    <input type="radio" name="Ir2" class="allrb Ir" value="1" >
    <input type="radio" name="Ir2" class="allrb Ir" value="2" >
    <input type="radio" name="Ir2" class="allrb Ir" value="3" >
    <input type="radio" name="Ir2" class="allrb Ir" value="4" >
    <input type="number" name="numFr2" class="numFr" id="numFr2" disabled>
    <input type="number" name="numIr2" class="numIr" id="numIr2" disabled>

    content 3
    <input type="radio" name="Fr3" class="allrb Fr" value="0">
    <input type="radio" name="Fr3" class="allrb Fr" value="1">
    <input type="radio" name="Fr3" class="allrb Fr" value="2">
    <input type="radio" name="Fr3" class="allrb Fr" value="3">
    <input type="radio" name="Fr3" class="allrb Fr" value="4">
    <input type="radio" name="Ir3 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir3" class="allrb" value="1" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="4" >
    <input type="number" name="numFr3" class="numFr" id="numFr3" disabled>
    <input type="number" name="numIr3" class="numIr" id="numIr3" disabled>

    content 4
    <input type="radio" name="Fr4" class="allrb Fr" value="0">
    <input type="radio" name="Fr4" class="allrb Fr" value="1">
    <input type="radio" name="Fr4" class="allrb Fr" value="2">
    <input type="radio" name="Fr4" class="allrb Fr" value="3">
    <input type="radio" name="Fr4" class="allrb Fr" value="4">
    <input type="radio" name="Ir4 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir4" class="allrb" value="1" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="4" >
    <input type="number" name="numFr4" class="numFr" id="numFr4" disabled>
    <input type="number" name="numIr4" class="numIr" id="numIr4" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

<button class="btn btn-primary" id="showme" type="button">View Result</button>

```
</div>
</div>
</p>

<p>If I click to button, the answer that are empty will be highlighted and scroll to the row. But I don't want it scroll row by row,I just want it jump to the first error and no need to scroll row by row. I had try to using the </p>

```page.on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function(){
       page.stop();
   });
```

but I seem like not work for me. It can be scroll row by row too, but I want it to stop when user scroll down/up their mouse.Thanks.

答:
You need to scroll to the first invalid row. As its a loop, need to store the first invalid row.

Check the below code. Have changed to store the index of the first invalid row and then scroll to it after loop completes.

NOTE : 20 is subtracted from the top as a buffer, adjust or remove it as per requirement.

Hope this helps!

function valueE(e) {
  var newValue = e.target.value;
  var $radio = $(e.target);

  if ($radio.is('.Fr')) {
    $radio.closest('tr').find('.numFr').val(newValue);
  } else {
    $radio.closest('tr').find('.numIr').val(newValue);
  }
}

$(document).ready(function() {

  $('#showme').click(function() {
    validateNresult();
  })

  $('.allrb').change(valueE);

});

function validateNresult() {

  var firstInvalidRowIndex = 0;
  $.each($("tbody tr"), function(i, e) {
    var hasInvalidInputs = $(this).find(".numFr, .numIr").filter(function() {
      return $.trim(this.value).length === 0;
    }).length > 0;

    if (hasInvalidInputs) {
      $(this).addClass("invalid");
      if (firstInvalidRowIndex <= 0) {
        firstInvalidRowIndex = i + 1;
      }
    } else {
      $(this).removeClass("invalid");
    }

  });

  if (firstInvalidRowIndex > 0) {
    $('html, body').animate({
      scrollTop: ($("tbody tr:nth-child(" + firstInvalidRowIndex + ")").offset().top - 20)
    }, 1000);
  }
}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>input[type=number] {
  width: 25px;
  text-align: center;
}

.invalid {
  outline: 1px solid red;
}</code>```

    content 1
    <input type="radio" name="Fr1" class="allrb Fr" value="0">
    <input type="radio" name="Fr1" class="allrb Fr" value="1">
    <input type="radio" name="Fr1" class="allrb Fr" value="2">
    <input type="radio" name="Fr1" class="allrb Fr" value="3">
    <input type="radio" name="Fr1" class="allrb Fr" value="4">
    <input type="radio" name="Ir1" class="allrb Ir" value="0" >
    <input type="radio" name="Ir1" class="allrb Ir" value="1" >
    <input type="radio" name="Ir1" class="allrb Ir" value="2" >
    <input type="radio" name="Ir1" class="allrb Ir" value="3" >
    <input type="radio" name="Ir1" class="allrb Ir" value="4" >
    <input type="number" name="numFr1" class="numFr" id="numFr1" disabled>
    <input type="number" name="numIr1" class="numIr" id="numIr1" disabled>

    content 2
    <input type="radio" name="Fr2" class="allrb Fr" value="0">
    <input type="radio" name="Fr2" class="allrb Fr" value="1">
    <input type="radio" name="Fr2" class="allrb Fr" value="2">
    <input type="radio" name="Fr2" class="allrb Fr" value="3">
    <input type="radio" name="Fr2" class="allrb Fr" value="4">
    <input type="radio" name="Ir2" class="allrb Ir" value="0" >
    <input type="radio" name="Ir2" class="allrb Ir" value="1" >
    <input type="radio" name="Ir2" class="allrb Ir" value="2" >
    <input type="radio" name="Ir2" class="allrb Ir" value="3" >
    <input type="radio" name="Ir2" class="allrb Ir" value="4" >
    <input type="number" name="numFr2" class="numFr" id="numFr2" disabled>
    <input type="number" name="numIr2" class="numIr" id="numIr2" disabled>

    content 3
    <input type="radio" name="Fr3" class="allrb Fr" value="0">
    <input type="radio" name="Fr3" class="allrb Fr" value="1">
    <input type="radio" name="Fr3" class="allrb Fr" value="2">
    <input type="radio" name="Fr3" class="allrb Fr" value="3">
    <input type="radio" name="Fr3" class="allrb Fr" value="4">
    <input type="radio" name="Ir3 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir3" class="allrb" value="1" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="4" >
    <input type="number" name="numFr3" class="numFr" id="numFr3" disabled>
    <input type="number" name="numIr3" class="numIr" id="numIr3" disabled>

    content 4
    <input type="radio" name="Fr4" class="allrb Fr" value="0">
    <input type="radio" name="Fr4" class="allrb Fr" value="1">
    <input type="radio" name="Fr4" class="allrb Fr" value="2">
    <input type="radio" name="Fr4" class="allrb Fr" value="3">
    <input type="radio" name="Fr4" class="allrb Fr" value="4">
    <input type="radio" name="Ir4 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir4" class="allrb" value="1" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="4" >
    <input type="number" name="numFr4" class="numFr" id="numFr4" disabled>
    <input type="number" name="numIr4" class="numIr" id="numIr4" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

<button class="btn btn-primary" id="showme" type="button">View Result</button>

```

Body:
function valueE(e) {
  var newValue = e.target.value;
  var $radio = $(e.target);

  if ($radio.is('.Fr')) {
    $radio.closest('tr').find('.numFr').val(newValue);
  } else {
    $radio.closest('tr').find('.numIr').val(newValue);
  }
}

$(document).ready(function() {

  $('#showme').click(function() {
    validateNresult();
  })

  $('.allrb').change(valueE);

});

function validateNresult() {

  $.each($("tbody tr"), function(i, e)
  {
    var hasInvalidInputs = $(this).find(".numFr, .numIr").filter(function() {
      return $.trim(this.value).length === 0;
    }).length > 0;

    if (hasInvalidInputs)
    {
      $(this).addClass("invalid");
           $('html, body').animate(
            {
             scrollTop: ($(this).offset().top)
            },
            1000
        );

    }

    else {
      $(this).removeClass("invalid");
    }

  });

}

input[type=number] {
  width: 25px;
  text-align: center;
}

.invalid {
  outline: 1px solid red;
}

    content 1
    <input type="radio" name="Fr1" class="allrb Fr" value="0">
    <input type="radio" name="Fr1" class="allrb Fr" value="1">
    <input type="radio" name="Fr1" class="allrb Fr" value="2">
    <input type="radio" name="Fr1" class="allrb Fr" value="3">
    <input type="radio" name="Fr1" class="allrb Fr" value="4">
    <input type="radio" name="Ir1" class="allrb Ir" value="0" >
    <input type="radio" name="Ir1" class="allrb Ir" value="1" >
    <input type="radio" name="Ir1" class="allrb Ir" value="2" >
    <input type="radio" name="Ir1" class="allrb Ir" value="3" >
    <input type="radio" name="Ir1" class="allrb Ir" value="4" >
    <input type="number" name="numFr1" class="numFr" id="numFr1" disabled>
    <input type="number" name="numIr1" class="numIr" id="numIr1" disabled>

    content 2
    <input type="radio" name="Fr2" class="allrb Fr" value="0">
    <input type="radio" name="Fr2" class="allrb Fr" value="1">
    <input type="radio" name="Fr2" class="allrb Fr" value="2">
    <input type="radio" name="Fr2" class="allrb Fr" value="3">
    <input type="radio" name="Fr2" class="allrb Fr" value="4">
    <input type="radio" name="Ir2" class="allrb Ir" value="0" >
    <input type="radio" name="Ir2" class="allrb Ir" value="1" >
    <input type="radio" name="Ir2" class="allrb Ir" value="2" >
    <input type="radio" name="Ir2" class="allrb Ir" value="3" >
    <input type="radio" name="Ir2" class="allrb Ir" value="4" >
    <input type="number" name="numFr2" class="numFr" id="numFr2" disabled>
    <input type="number" name="numIr2" class="numIr" id="numIr2" disabled>

    content 3
    <input type="radio" name="Fr3" class="allrb Fr" value="0">
    <input type="radio" name="Fr3" class="allrb Fr" value="1">
    <input type="radio" name="Fr3" class="allrb Fr" value="2">
    <input type="radio" name="Fr3" class="allrb Fr" value="3">
    <input type="radio" name="Fr3" class="allrb Fr" value="4">
    <input type="radio" name="Ir3 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir3" class="allrb" value="1" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir3 Ir" class="allrb" value="4" >
    <input type="number" name="numFr3" class="numFr" id="numFr3" disabled>
    <input type="number" name="numIr3" class="numIr" id="numIr3" disabled>

    content 4
    <input type="radio" name="Fr4" class="allrb Fr" value="0">
    <input type="radio" name="Fr4" class="allrb Fr" value="1">
    <input type="radio" name="Fr4" class="allrb Fr" value="2">
    <input type="radio" name="Fr4" class="allrb Fr" value="3">
    <input type="radio" name="Fr4" class="allrb Fr" value="4">
    <input type="radio" name="Ir4 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir4" class="allrb" value="1" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir4 Ir" class="allrb" value="4" >
    <input type="number" name="numFr4" class="numFr" id="numFr4" disabled>
    <input type="number" name="numIr4" class="numIr" id="numIr4" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

    content 5
    <input type="radio" name="Fr5" class="allrb Fr" value="0">
    <input type="radio" name="Fr5" class="allrb Fr" value="1">
    <input type="radio" name="Fr5" class="allrb Fr" value="2">
    <input type="radio" name="Fr5" class="allrb Fr" value="3">
    <input type="radio" name="Fr5" class="allrb Fr" value="4">
    <input type="radio" name="Ir5 Ir" class="allrb" value="0" >
    <input type="radio" name="Ir Ir5" class="allrb" value="1" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="2" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="3" >
    <input type="radio" name="Ir5 Ir" class="allrb" value="4" >
    <input type="number" name="numFr5" class="numFr" id="numFr5" disabled>
    <input type="number" name="numIr5" class="numIr" id="numIr5" disabled>

<button class="btn btn-primary" id="showme" type="button">View Result</button>

If I click to button, the answer that are empty will be highlighted and scroll to the row. But I don't want it scroll row by row,I just want it jump to the first error and no need to scroll row by row. I had try to using the

page.on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function(){
       page.stop();
   });

but I seem like not work for me. It can be scroll row by row too, but I want it to stop when user scroll down/up their mouse.Thanks.

Body:
You need to scroll to the first invalid row. As its a loop, need to store the first invalid row.

Check the below code. Have changed to store the index of the first invalid row and then scroll to it after loop completes.

NOTE : 20 is subtracted from the top as a buffer, adjust or remove it as per requirement.

Hope this helps!

function valueE(e) {
  var newValue = e.target.value;
  var $radio = $(e.target);

  if ($radio.is('.Fr')) {
    $radio.closest('tr').find('.numFr').val(newValue);
  } else {
    $radio.closest('tr').find('.numIr').val(newValue);
  }
}

$(document).ready(function() {

  $('#showme').click(function() {
    validateNresult();
  })

  $('.allrb').change(valueE);

});

function validateNresult() {

  var firstInvalidRowIndex = 0;
  $.each($("tbody tr"), function(i, e) {
    var hasInvalidInputs = $(this).find(".numFr, .numIr").filter(function() {
      return $.trim(this.value).length === 0;
    }).length > 0;

    if (hasInvalidInputs) {
      $(this).addClass("invalid");
      if (firstInvalidRowIndex <= 0) {
        firstInvalidRowIndex = i + 1;
      }
    } else {
      $(this).removeClass("invalid");
    }

  });

  if (firstInvalidRowIndex > 0) {
    $('html, body').animate({
      scrollTop: ($("tbody tr:nth-child(" + firstInvalidRowIndex + ")").offset().top - 20)
    }, 1000);
  }
}

input[type=number] {
  width: 25px;
  text-align: center;
}

.invalid {
  outline: 1px solid red;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table class="table table-hover table-responsive" id="tab">
  <tr id="alertr1" name="v">
    <td width="200px" id="text">content 1</td>
    <td width="40px"><label><input type="radio" name="Fr1" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr1" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr1" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr1" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr1" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir1" class="allrb Ir" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir1" class="allrb Ir" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir1" class="allrb Ir" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir1" class="allrb Ir" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir1" class="allrb Ir" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr1" class="numFr" id="numFr1" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr1" class="numIr" id="numIr1" disabled></td>
  </tr>

  <tr id="alertr2" name="v">
    <td width="200px" id="text">content 2</td>
    <td width="40px"><label><input type="radio" name="Fr2" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr2" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr2" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr2" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr2" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir2" class="allrb Ir" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir2" class="allrb Ir" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir2" class="allrb Ir" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir2" class="allrb Ir" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir2" class="allrb Ir" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr2" class="numFr" id="numFr2" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr2" class="numIr" id="numIr2" disabled></td>
  </tr>

  <tr id="alertr3" name="v">
    <td width="200px" id="text">content 3</td>
    <td width="40px"><label><input type="radio" name="Fr3" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr3" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr3" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr3" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr3" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir3 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir3" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir3 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir3 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir3 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr3" class="numFr" id="numFr3" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr3" class="numIr" id="numIr3" disabled></td>
  </tr>

  <tr id="alertr4" name="v">
    <td width="200px" id="text">content 4</td>
    <td width="40px"><label><input type="radio" name="Fr4" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr4" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr4" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr4" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr4" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir4 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir4" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir4 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir4 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir4 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr4" class="numFr" id="numFr4" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr4" class="numIr" id="numIr4" disabled></td>
  </tr>

  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>
  <tr id="alertr5" name="v">
    <td width="200px" id="text">content 5</td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="0"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="1"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="2"></label></td>
    <td width="40px"><label><input type="radio" name="Fr5" class="allrb Fr" value="3"></label></td>
    <td width="30px"><label><input type="radio" name="Fr5" class="allrb Fr" value="4"></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="0" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir Ir5" class="allrb" value="1" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="2" ></label></td>
    <td width="50px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="3" ></label></td>
    <td width="120px" bgcolor="Gainsboro"><label><input type="radio" name="Ir5 Ir" class="allrb" value="4" ></label></td>
    <td width="30px"><input type="number" name="numFr5" class="numFr" id="numFr5" disabled></td>
    <td width="30px" bgcolor="Gainsboro"><input type="number" name="numIr5" class="numIr" id="numIr5" disabled></td>
  </tr>

</table>

<button class="btn btn-primary" id="showme" type="button">View Result</button>
<p style="float:right;position:absolute;margin-left:700px;margin-top:10px;" id="alertmessage"></p>


来源: stackexchange

问:
Coinbase api get request does not return all records
Here I try to  get all accounts using the coinbase api:

```<code>require 'MyInclude/vendor/autoload.php';
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
use Coinbase\Wallet\Resource\Account;
use Coinbase\Wallet\ActiveRecord\AccountActiveRecord;

$apiKey =  'API KEY';
$apiSecret =  'API SECERET';
$configuration = Configuration::apiKey($apiKey, $apiSecret);

$client = Client::create($configuration);

$accounts = $client->getAccounts();
</code>```

OUTPUT : Only 25 accounts in this array

How do I get all accounts???

答:
Check the API Documentation.

All GET endpoints which return an object list support cursor based
  pagination with pagination information inside a pagination object.
  This means that to get all objects, you need to paginate through the
  results by always using the id of the last resource in the list as a
  starting_after parameter for the next call.

https://developers.coinbase.com/api/v2#pagination

So your request just returns the 25 first results. In order to get all accounts, you need to make a loop using the returned next_uri (see the example response).

```<code>{
  "pagination": {
    "ending_before": null,
    "starting_after": null,
    "limit": 25,
    "order": "desc",
    "previous_uri": null,
    "next_uri": "/v2/accounts?&limit=25&starting_after=5d5aed5f-b7c0-5585-a3dd-a7ed9ef0e414"
  },
  "data": [
    ...
  ]
}
</code>```

ContentLicense: CC BY-SA 3.0

Body:
Here I try to  get all accounts using the coinbase api:

require 'MyInclude/vendor/autoload.php';
use Coinbase\Wallet\Client;
use Coinbase\Wallet\Configuration;
use Coinbase\Wallet\Resource\Account;
use Coinbase\Wallet\ActiveRecord\AccountActiveRecord;

$apiKey =  'API KEY';
$apiSecret =  'API SECERET';
$configuration = Configuration::apiKey($apiKey, $apiSecret);

$client = Client::create($configuration);

$accounts = $client->getAccounts();

OUTPUT : Only 25 accounts in this array

How do I get all accounts???

Body:
Check the API Documentation.

All GET endpoints which return an object list support cursor based
  pagination with pagination information inside a pagination object.
  This means that to get all objects, you need to paginate through the
  results by always using the id of the last resource in the list as a
  starting_after parameter for the next call.

https://developers.coinbase.com/api/v2#pagination

So your request just returns the 25 first results. In order to get all accounts, you need to make a loop using the returned next_uri (see the example response).

{
  "pagination": {
    "ending_before": null,
    "starting_after": null,
    "limit": 25,
    "order": "desc",
    "previous_uri": null,
    "next_uri": "/v2/accounts?&limit=25&starting_after=5d5aed5f-b7c0-5585-a3dd-a7ed9ef0e414"
  },
  "data": [
    ...
  ]
}


问:
Generate "using" directive from fully-qualified class name without having to go to the top of the code file in Visual Studio 2017
Is there a shortcut for adding a using directive without having to leave the point where I'm working in the code to scroll up to the top of the file?

For instance, if I don't have using System.IO; and I add string fullPath = System.IO.Path.Combine(path1, path2); to a method where I'm working, I'd like to be able to right-click or something to get the option to add using System.IO; at the top and remove it from the beginning of System.IO.Path.Combine.

I'm know third-party tools like Re-Sharper can enable this, but I thought this would be a simple feature that would be present by VS 2017.

答:
While I thought this was an exact duplicate of this question, it's actually different.  The linked question assumes you have not already provided the fully-qualified class name.  For instance, if you happen to have string fullPath = Path.Combine(path1, path2); instead of string fullPath = System.IO.Path.Combine(path1, path2); and without the using directive using System.IO; at the top of the file -- maybe you inserted a code snippet or copy/pasted from somewhere else -- you can place your cursor near the class (Path) and use Ctrl + . to activate the smart tag.

This is different from my question because I have already provided the fully-qualified class name System.IO.Path (because maybe I couldn't have found Path without it).  I'd like it to recognize that there's a namespace component that can be converted into a using directive and remove the namespace component from the beginning of Path.  If you do already have the namespace component before the class name, the Ctrl + . shortcut, does not work, and there is no explanation provided.  The work-around is to type out the fully-qualified class name, then delete the namespace component, and use Ctrl + ..  This allows you to make use of the intellisense for getting the class name you're looking for from whatever namespace it resides in, and then use the smart tag to add the using directive.


问:
How can I launch a Android Activity from Xamarin Forms Page?
I know that i can launch a Xamarin Forms page from an Native Android Activity, but how do i start a Native Android Activity from Xamarin Forms ContentPage. I tried with DependencyService but without success.</p>

答:
DependencyService is your best option. The concept behind PCL (Portable Class Library) is exactly to be platform independet.
Maybe we can help if you show the error you are getting with Dependency Service</p>


问:
How to set max output width in numpy?
I am using a Jupyter notebook. I have a pretty wide screen, but the displayed output (say, when I print a numpy array) is formatted as if the screen was narrow.

I found a way of increasing the width of the cells, with

```<code>from IPython.core.display import HTML
HTML("<style>.container { width:95% !important; }</style>")
</code>```

but this seems to influence the input only, not the output (see screenshots):

I've tried setting the linewidth option in numpy.set_printoptions, I've tried setting numpy.core.arrayprint._line_width, nothing...

EDIT: Using matplotlib I can set the width of plots (that I plot in the notebook with the magic %matplotlib inline) with the command plt.rcParams['figure.figsize']=[X,Y]. It turns out that I can increase X to have plots fill the output cell horizontally all the way. This means (I think) that the original problem it's a numpy thing.

答:
This is a year old now but maybe the answer will help someone else.

The way numpy-arrays are displayed depends on a number of things.
With this code, you can show more items and use the full width of your screen:

This is the default

```<code>import numpy as np
np.set_printoptions(edgeitems=3)
np.core.arrayprint._line_width = 80

>>> array([[[0, 0, 0, ..., 0, 0, 0],
>>>    [0, 0, 0, ..., 0, 0, 0],
>>>    [0, 0, 0, ..., 0, 0, 0],
>>>    ...,
</code>```

With the following code you increase the items shown at the edge of each array (start and end) as well as the line width:

```<code>import numpy as np
np.set_printoptions(edgeitems=10)
np.core.arrayprint._line_width = 180

>>> array([[[  0,   0,   0,   0,   0,   0,   0,   0,   0,   0, ...,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0],
>>>         [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0, ...,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0],
>>>         [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0, ...,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0],
</code>```

Title: How to set max output width in numpy?

Body:
I am using a Jupyter notebook. I have a pretty wide screen, but the displayed output (say, when I print a numpy array) is formatted as if the screen was narrow.

I found a way of increasing the width of the cells, with

from IPython.core.display import HTML
HTML("")

but this seems to influence the input only, not the output (see screenshots):

I've tried setting the linewidth option in numpy.set_printoptions, I've tried setting numpy.core.arrayprint._line_width, nothing...

EDIT: Using matplotlib I can set the width of plots (that I plot in the notebook with the magic %matplotlib inline) with the command plt.rcParams['figure.figsize']=[X,Y]. It turns out that I can increase X to have plots fill the output cell horizontally all the way. This means (I think) that the original problem it's a numpy thing.

Body:
This is a year old now but maybe the answer will help someone else.

The way numpy-arrays are displayed depends on a number of things.
With this code, you can show more items and use the full width of your screen:

This is the default

import numpy as np
np.set_printoptions(edgeitems=3)
np.core.arrayprint._line_width = 80

>>> array([[[0, 0, 0, ..., 0, 0, 0],
>>>    [0, 0, 0, ..., 0, 0, 0],
>>>    [0, 0, 0, ..., 0, 0, 0],
>>>    ...,

With the following code you increase the items shown at the edge of each array (start and end) as well as the line width:

import numpy as np
np.set_printoptions(edgeitems=10)
np.core.arrayprint._line_width = 180

>>> array([[[  0,   0,   0,   0,   0,   0,   0,   0,   0,   0, ...,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0],
>>>         [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0, ...,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0],
>>>         [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0, ...,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0],


问:
Node-horseman Unhandled rejection evaluate
I'm trying to write a basic web scraper with Node-horseman, but I'm getting some issues with CSS selectors inside the evaluate function. With some websites the evaluate function works just fine, but with others, Node throws an error.

For example:

```<code>var Horseman = require('node-horseman');
var horseman = new Horseman();

function getTitle() {
  var title = $('.product-name-main h1').text();
  return {title: title};
}

horseman
  .userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
  .open('http://shtoraoptom.ru/pokryvalo-nazsu-gul-abrikosovyj-240-260-sm')
  .evaluate(getTitle)
  .then(function(title){
    console.log(title);
    return horseman.close();
  });
</code>```

This code throws an error:

```<code>Unhandled rejection getTitle evaluate

global code evaluateJavaScript@[native code] evaluate@phantomjs://platform/webpage.js:390:39 phantomjs://code/bridge.js:121:61    at Horseman.<anonymous> (/home/ubuntu/workspace/node_modules/node-horseman/lib/actions.js:839:38)
    at Horseman.tryCatcher (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromiseCtx (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/promise.js:596:10)
    at Async._drainQueue (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/async.js:143:12)
    at Async._drainQueues (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
</code>```

When I try to rewrite the code another way using the same selector, it logs out the title correctly:

```<code>var Horseman = require('node-horseman');
var horseman = new Horseman();

function getTitle() {
  var title = $('.product-name-main h1').text();
  return {title: title};
}

horseman
  .userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
  .open('http://shtoraoptom.ru/pokryvalo-nazsu-gul-abrikosovyj-240-260-sm')
  .text('.product-name-main h1')
  .then(function(title){
    console.log(title);
   return horseman.close();
  });
</code>```

What can be the reason for this type of error?

答:
CAUSE

.evaluate() method expects client-side JavaScript function to be available in the webpage you're scraping.

The way you define getTitle() function in your 1st example implies it to be  created in NodeJS scope not in the scraped webpage client-side scope.

POSSIBLE FIXES

OPTION 1

You could get rid of creating getTitle() function but writing client-side javascript code right as an argument for .evaluate() method, like this:

```<code>.evaluate(function () { return $('.product-name h1').first().text(); })
</code>```

(for complete solution pls. check out my GitHub repo: https://github.com/omnimind/stackOverflow/blob/master/NodeJS/Controllers/37793821.js script method called main())

OPTION 2

If you're insist on creating getTitle() JavaScript function then you will need to create the function in a separate JavaScript file and inject it into the webpage you're scraping by using horsemen .injectJs(file) like this:

```<code>.injectJs('<external_javascript_file>').evaluate(function () { return getTitle(); })
</code>```

(for complete solution pls. check out my GitHub repo: https://github.com/omnimind/stackOverflow/blob/master/NodeJS/Controllers/37793821.js script method called external())

REMARK

The 2nd options allows you to get your code better organized especially in cases when the client-side JavaScript code you need to inject gets more complicated and robust by its size.

Body:
I'm trying to write a basic web scraper with Node-horseman, but I'm getting some issues with CSS selectors inside the evaluate function. With some websites the evaluate function works just fine, but with others, Node throws an error.

For example:

var Horseman = require('node-horseman');
var horseman = new Horseman();

function getTitle() {
  var title = $('.product-name-main h1').text();
  return {title: title};
}

horseman
  .userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
  .open('http://shtoraoptom.ru/pokryvalo-nazsu-gul-abrikosovyj-240-260-sm')
  .evaluate(getTitle)
  .then(function(title){
    console.log(title);
    return horseman.close();
  });

This code throws an error:

Unhandled rejection getTitle evaluate

global code evaluateJavaScript@[native code] evaluate@phantomjs://platform/webpage.js:390:39 phantomjs://code/bridge.js:121:61    at Horseman.<anonymous> (/home/ubuntu/workspace/node_modules/node-horseman/lib/actions.js:839:38)
    at Horseman.tryCatcher (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromiseCtx (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/promise.js:596:10)
    at Async._drainQueue (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/async.js:143:12)
    at Async._drainQueues (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/ubuntu/workspace/node_modules/node-horseman/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

When I try to rewrite the code another way using the same selector, it logs out the title correctly:

var Horseman = require('node-horseman');
var horseman = new Horseman();

function getTitle() {
  var title = $('.product-name-main h1').text();
  return {title: title};
}

horseman
  .userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
  .open('http://shtoraoptom.ru/pokryvalo-nazsu-gul-abrikosovyj-240-260-sm')
  .text('.product-name-main h1')
  .then(function(title){
    console.log(title);
   return horseman.close();
  });

What can be the reason for this type of error?

Body:
CAUSE

.evaluate() method expects client-side JavaScript function to be available in the webpage you're scraping.

The way you define getTitle() function in your 1st example implies it to be  created in NodeJS scope not in the scraped webpage client-side scope.

POSSIBLE FIXES

OPTION 1

You could get rid of creating getTitle() function but writing client-side javascript code right as an argument for .evaluate() method, like this:

.evaluate(function () { return $('.product-name h1').first().text(); })

(for complete solution pls. check out my GitHub repo: https://github.com/omnimind/stackOverflow/blob/master/NodeJS/Controllers/37793821.js script method called main())

OPTION 2

If you're insist on creating getTitle() JavaScript function then you will need to create the function in a separate JavaScript file and inject it into the webpage you're scraping by using horsemen .injectJs(file) like this:

.injectJs('<external_javascript_file>').evaluate(function () { return getTitle(); })

(for complete solution pls. check out my GitHub repo: https://github.com/omnimind/stackOverflow/blob/master/NodeJS/Controllers/37793821.js script method called external())

REMARK

The 2nd options allows you to get your code better organized especially in cases when the client-side JavaScript code you need to inject gets more complicated and robust by its size.


问:
How to react to toggle menu bar in electron?
I'm building and app that has exact bounds which should remain whatever you do. So it's not resizable. How do I react and then resize the window in the main process, when the menubar is toggled.</p>

答: The resize event should be emitted by window, when the dimension of the viewport change. You listen to that even and then you either send that information via IPC to the main process and change the window via win.setSize(width, height[, animate]) or you can do the same thing from the renderer side. You can get the current window with remote.getCurrentWindow().


问:
How to trigger keyboard enter event to add indentation on next line of textarea
I have a html text-area when user put colon(:) and press enter there should be indentation on next line of text-area

My code

<textarea id="yourcode" cols="40" rows="10" class="form-control"></textarea>
```

<p>What i have tried</p>

<pre class="lang-js prettyprint-override"><code>$('#yourcode').keypress(function(e) {
    if(e.keyCode == 58) {
        if(e.keyCode == 13 ) {
            $(this).val(
                $(this).val().substring(0, start)
                + "\t"
                + $(this).val().substring(end)
            );
        }
    }
});
</code>```

答:
As i told you in my comment, the second if statement will not be reached, since if keyCode is = 58, it will never be 13.

Also, use keyup instead.

Check the code below:

$(function() {
  $('textarea').on('keyup', function(e) {
    if (e.key === 'Enter') {
      var text = $(this).val().trim();

      if (text.substring(text.length - 1) == ':') {
        $(this).val($(this).val() + '\t');
      }
    }
  });
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<textarea id="yourcode" cols="40" rows="10" class="form-control">
</textarea></code>```

Body:
I have a html text-area when user put colon(:) and press enter there should be indentation on next line of text-area

My code

<textarea id="yourcode" cols="40" rows="10" class="form-control"></textarea>

What i have tried

$('#yourcode').keypress(function(e) {
    if(e.keyCode == 58) {
        if(e.keyCode == 13 ) {
            $(this).val(
                $(this).val().substring(0, start)
                + "\t"
                + $(this).val().substring(end)
            );
        }
    }
});

Body:
As i told you in my comment, the second if statement will not be reached, since if keyCode is = 58, it will never be 13.

Also, use keyup instead.

Check the code below:

$(function() {
  $('textarea').on('keyup', function(e) {
    if (e.key === 'Enter') {
      var text = $(this).val().trim();

      if (text.substring(text.length - 1) == ':') {
        $(this).val($(this).val() + '\t');
      }
    }
  });
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<textarea id="yourcode" cols="40" rows="10" class="form-control">
</textarea>


问:
Getting HTTP 412 with CasperJS
I'm writing some CasperJS scripts that allow me to login sites from console. However, when I try to login https://www.zara.com/us/, I keep getting HTTP 412 Precondition Failed. I've tried --ssl-protocol=any and --ignore-ssl-erros=true but it doesn't fix the problem. Does anyone know how to fix this?

Thanks!

答:
This test script works fine for me. Suspect either useragent or viewportsize

```<code>casper.options.viewportSize = { width:1024, height: 800 }

casper.test.begin('ZARA', 1, function (test) {

  casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');

  casper.start("https://www.zara.com/us/", function () {
    test.assertTitle("ZARA United States - Official Website");
  });

  casper.waitUntilVisible("#newsletter-subscribe-form", function() {
    this.capture("pass.jpg");
  }, function() {
    this.capture("fail.jpg");
  });

  casper.run(function () {
    test.done();
  });
});
</code>```

Title: Getting HTTP 412 with CasperJS

Body:
This test script works fine for me. Suspect either useragent or viewportsize

casper.options.viewportSize = { width:1024, height: 800 }

casper.test.begin('ZARA', 1, function (test) {

  casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');

  casper.start("https://www.zara.com/us/", function () {
    test.assertTitle("ZARA United States - Official Website");
  });

  casper.waitUntilVisible("#newsletter-subscribe-form", function() {
    this.capture("pass.jpg");
  }, function() {
    this.capture("fail.jpg");
  });

  casper.run(function () {
    test.done();
  });
});


问:
Why is this controller variable not getting through to this javascript code?
I am trying now to use my javascript to render a new view on click of an element, with this code;

```<code>$(document).ready(function() {
    $('.link-panel').click( function() {
        window.location.replace('/quotes/'+gon.gon_quote_id);
    });
});
</code>```

and i get the following error:

```<code>Couldn't find Quote with 'id'=undefined [WHERE "quotes"."user_id" = $1]
</code>```

quote_controller.rb:

```<code>  def show
    @quote = current_user.quotes.find(params[:id])
    gon.gon_quote_id = @quote.id
  end

def index
@quotes = current_user.quotes.all
# how to pass the individual quote object's id to gon here
</code>```

end

I think that it must be the way that I've given the url argument to the replace method, can you help me with what it is that I'm doing wrong?

(gon setup is working fine as alert tests demonstrate.)

Thanks

答:
The script does not know that it's meant to access a variable from rails, you have to do it like so:</p>

```<code>$(document).ready(function() {
    $('.link-panel').click( function() {
        window.location.replace('/quotes/'+<%= gon.gon_quote_id %>);
    });
});
</code>```

Body:
I am trying now to use my javascript to render a new view on click of an element, with this code;

$(document).ready(function() {
    $('.link-panel').click( function() {
        window.location.replace('/quotes/'+gon.gon_quote_id);
    });
});

and i get the following error:

Couldn't find Quote with 'id'=undefined [WHERE "quotes"."user_id" = $1]

quote_controller.rb:

  def show
    @quote = current_user.quotes.find(params[:id])
    gon.gon_quote_id = @quote.id
  end

def index
@quotes = current_user.quotes.all
# how to pass the individual quote object's id to gon here

end

I think that it must be the way that I've given the url argument to the replace method, can you help me with what it is that I'm doing wrong?

(gon setup is working fine as alert tests demonstrate.)

Thanks

Body:
The script does not know that it's meant to access a variable from rails, you have to do it like so:

$(document).ready(function() {
    $('.link-panel').click( function() {
        window.location.replace('/quotes/'+<%= gon.gon_quote_id %>);
    });
});


问:
How exactly works the Angular 2 property binding? What really happens in this example?
I am an absolute beginner with Angular 2 and I have the following doubt relate property binding.

This example works but I have doubt about what exactly happen under the hood.

I have a component view (the servers.component.html file) containing this button:

```<code><button [disabled]="!allowNewServer" class="btn btn-primary">Add Server</button>
</code>```

The related component is:

```<code>import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-servers',
  templateUrl: './servers.component.html',
  styleUrls: ['./servers.component.css']
})
export class ServersComponent implements OnInit {
  allowNewServer = false;

  constructor() {
    setTimeout(() => {
      this.allowNewServer = true;
    }, 8000);
  }

  ngOnInit() {
  }

}
</code>```

As you can see at the beginning the allowNewServer value is false, after 8 seconds it is setted to true by a function declared in the constructor.

On my button is setted this disabled attribute:

```<code> [disabled]="!allowNewServer"
</code>```

So at the beginning the button is disabled and after 8 seconds it will enabled.

Mu doubts are:

1) What exactly means the [...] Angular syntax?

2) I expected that was rendered something like disabled=true (at the beginning) and after 8 seconds something like disabled=dalse, but after 8 seconds simply the disable attribute is deleted. So I think that I am not understending what the [...] syntax mean.

答: For #2 - your assumption is right for most html and custom attributes. But disabled is special case. HTML specification expects to have that attribute without value for disabled elements and not having it for the rest cases. I.e. <input disabled="true"> is not right way to code HTML. Moreover, most browsers will disable your field when you have <input disabled="false">. That's why angular removes it.

Body:
I am an absolute beginner with Angular 2 and I have the following doubt relate property binding.

This example works but I have doubt about what exactly happen under the hood.

I have a component view (the servers.component.html file) containing this button:

<button [disabled]="!allowNewServer" class="btn btn-primary">Add Server</button>

The related component is:

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-servers',
  templateUrl: './servers.component.html',
  styleUrls: ['./servers.component.css']
})
export class ServersComponent implements OnInit {
  allowNewServer = false;

  constructor() {
    setTimeout(() => {
      this.allowNewServer = true;
    }, 8000);
  }

  ngOnInit() {
  }

}

As you can see at the beginning the allowNewServer value is false, after 8 seconds it is setted to true by a function declared in the constructor.

On my button is setted this disabled attribute:

 [disabled]="!allowNewServer"

So at the beginning the button is disabled and after 8 seconds it will enabled.

Mu doubts are:

1) What exactly means the [...] Angular syntax?

2) I expected that was rendered something like disabled=true (at the beginning) and after 8 seconds something like disabled=dalse, but after 8 seconds simply the disable attribute is deleted. So I think that I am not understending what the [...] syntax mean.


问:
Fast matrix inversion without a package
Assume that I have a square matrix M.  Assume that I would like to invert the matrix M.

I am trying to use the the fractions mpq class within gmpy2 as members of my matrix M.  If you are not familiar with these fractions, they are functionally similar to python's built-in package fractions.  The only problem is, there are no packages that will invert my matrix unless I take them out of fraction form.  I require the numbers and the answers in fraction form.  So I will have to write my own function to invert M.

There are known algorithms that I could program, such as gaussian elimination.  However, performance is an issue, so my question is as follows:

Is there a computationally fast algorithm that I could use to calculate the inverse of a matrix M?

答:
Is there anything else you know about these matrices? For example, for symmetric positive definite matrices, Cholesky decomposition allows you to invert faster than the standard Gauss-Jordan method you mentioned.

For general matrix inversions, the Strassen algorithm will give you a faster result than Gauss-Jordan but slower than Cholesky.

It seems like you want exact results, but if you're fine with approximate inversions, then there are algorithms which approximate the inverse much faster than the previously mentioned algorithms.

However, you might want to ask yourself if you need the entire matrix inverse for your specific application. Depending on what you are doing it might be faster to use another matrix property. In my experience computing the matrix  inverse is an unnecessary step.

I hope that helps!

Title: Fast matrix inversion without a package


问:
How to change/configure desired compiler in Qt creator? i.e. switch between MSVC/Mingw or g++/clang++
I am aware about how to add compiler in Qt Creator. However my Qt always chooses MSVC compiler. How to set MinGW (built-in or external) instead of MSVC?

Couldn't find any post which can help a newbie to know how to change the compiler of desired preference. My current system is Windows, however information on Linux (g++ <--> clang++) is also welcome.

答:
Following is the way with Qt 5.9:

While configuring a new project, select only those compilers/kits which are required;

For 64-bit system, get the latest MinGW and install in a suitable path; While installing MinGW64, you may select "posix threads", and not "win32 threads" to allow threading related libraries

Go to Tools > Options > Build & Run > Compilers and add a manual C++ compiler. Choose the path of where you installed C:/MinGW64/bin/g++.exe (name it something like "MinGW64"); Similarly you may add C compiler as well with C:/MinGW64/bin/gcc.exe; Click 'Apply'

In the same dialog box, select the Debuggers tab and similarly add C:/MinGW64/bin/gdb.exe (name it like "MinGW64 Debugger); Click 'Apply'

In the same dialog box, select the Qt Versions and add a new Kit with MinGW64 like name; However I couldn't find an appropriate qmake.exe for it; Hence, I decided to use the same qmake.exe, which came with built-in 32 bit MinGW within Qt package (not sure about this as of now)

In the same dialog box, now select the Kits tab and add a new Manual kit; You may also follow the way the default MinGW32 bit compiler is configured; Configure Compiler, Debugger and Qt Version for this newly named kit; Click 'Ok'

On the left pan of Qt creator, click on "Projects" tab, and go to "Build & Run" option there; To avoid confusion, you may disable all the kits which are not required; Just keep the relevant kit and click "Build" with either "Debug" or "Release" setting


问:
Adding JSON values into a list
I'm wanting to iterate through my JSON file, and add two values into a list.

In theory, I'm wanting to have a nested list as: ips = [["custom3","modemId"],["custom3","modemId"]] and so on. My JSON file has 171 of each custom3 and modemId values. So in theory my nested list will contain 171 lists.

I'm having trouble adding the values into a list, in which I would like to append each list together, to create 171 lists.

```<code>json1 = open('C:\\Users\\' + comp_name + '\\Documents\\Programming Projects\\Python\\Python Firmware Script\\curl\\src\\out.json')
json1_obj = json.load(json1)

for i in json1_obj['data']:
    ip = [i['custom3']['modemId']]
</code>```

A snippet of my JSON data:

```<code>{
    "data": [
        {
            "custom3": "192.168.243.132",
            "modemId": "000408"
        },
        {
            "custom3": "192.168.244.156",
            "modemId": "000310"
        }
    ]
}
</code>```

I have 171 objects as above, but I'm only showing two. From the above, I would like to create two lists and append them each into a nested list.

How do I iterate through each JSON object and create a nested list with my JSON data in Python?

答:
As mentioned in the comments, once loaded the json is a python dictionary.
You should now iterate on the value of the 'data' key, extract the information and store them in a list.

Something like this should do the job:

```<code>json_obj = json.load(json1)

ips = []
for piece in json_obj['data']:
    this_ip = [piece['custom3'], piece['modemId']]
    ips.append(this_ip)
</code>```

One line form:

```<code>ips = [[piece['custom3'], piece['modemId']] for piece in json_obj['data']]
</code>```

Title: Adding JSON values into a list

Body:
I'm wanting to iterate through my JSON file, and add two values into a list.

In theory, I'm wanting to have a nested list as: ips = [["custom3","modemId"],["custom3","modemId"]] and so on. My JSON file has 171 of each custom3 and modemId values. So in theory my nested list will contain 171 lists.

I'm having trouble adding the values into a list, in which I would like to append each list together, to create 171 lists.

json1 = open('C:\\Users\\' + comp_name + '\\Documents\\Programming Projects\\Python\\Python Firmware Script\\curl\\src\\out.json')
json1_obj = json.load(json1)

for i in json1_obj['data']:
    ip = [i['custom3']['modemId']]

A snippet of my JSON data:

{
    "data": [
        {
            "custom3": "192.168.243.132",
            "modemId": "000408"
        },
        {
            "custom3": "192.168.244.156",
            "modemId": "000310"
        }
    ]
}

I have 171 objects as above, but I'm only showing two. From the above, I would like to create two lists and append them each into a nested list.

How do I iterate through each JSON object and create a nested list with my JSON data in Python?

Body:
As mentioned in the comments, once loaded the json is a python dictionary.
You should now iterate on the value of the 'data' key, extract the information and store them in a list.

Something like this should do the job:

json_obj = json.load(json1)

ips = []
for piece in json_obj['data']:
    this_ip = [piece['custom3'], piece['modemId']]
    ips.append(this_ip)

One line form:

ips = [[piece['custom3'], piece['modemId']] for piece in json_obj['data']]