Wednesday

create report with max length of elements in json array

this script will create table of max length of array fields in test.txt json file.
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script>

<script>
var d1;
var mt ={};
var md ={};
    $(function() {
   $.getJSON('/test.txt', function(data) {
        d1=data;
        for (let i = 0; i < d1.length; i++) {       
            let ob=d1[i];
            for (prop in ob) {
                if (!mt[prop]){
                    mt[prop]=0;
                    md[prop]="";
                }
                if (mt[prop] < ob[prop].length){
                    let s=ob[prop];
                    mt[prop]= s.length; 
                    md[prop]= s;
                }       
                //  console.log(prop + "has value: " + ob[prop]);
            }
        }
      
        for (prop in mt) {
          var tblRow = "<tr>" + "<td>" + prop + "</td>" +
           "<td>" + mt[prop] + "</td>" + "<td>" + md[prop] + "</td>" + "</tr>"
           $(tblRow).appendTo("#userdata tbody");
        }
   
   
   });

});
</script>
</head>

<body>

<div class="wrapper">
<div class="profile">
   <table id= "userdata" border="2">
  <thead>
            <th>field name </th>
            <th>max length</th>
            <th>example</th>
        </thead>
      <tbody>

       </tbody>
   </table>

</div>
</div>

</body>
</html>

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...