dijous, 24 de març del 2022

dimecres, 23 de març del 2022

Cam lever simulator

 Cam lever simulator

https://www.stonybrook.edu/commcms/motiongen/how-to-use.php

http://cadcam.eng.sunysb.edu/

Wow!

dilluns, 28 de febrer del 2022

Csharp online

 https://dotnetfiddle.net/ozk9kE


Parsing a web with Google Spreasheet



function mainFunction() 
{
  // *************************************************************************
  // CODE WITH CURT 2/14/2021
  // The code below will eventually not bring back the desired results.
  // Over time Web sites get Updated and Upgraded losing the original HTML and CSS tags that
  // are searched in the RegExp statements.
  // *************************************************************************

  clearRecords();

  var url = "https://www.premierleague.com/tables";

  var str = UrlFetchApp.fetch(url).getContentText();

  const mainRegex = /<td class=\"team\" scope=\"row\">([\s\S]*?)<\/td>/gi;
  var results = str.match(mainRegex);

  const teamNamePass1 = /<span class=\"long\">([\s\S]*?)<\/span>/gi;
  const teamNamePass2 = /(?<=<span class=\"long\">).*?(?=<\/span>)/gi;

  const teamLogoPass = /(?<=img class=\"badge-image badge-image--25\" src=\").*?(?=\")/gi;

  for(var i = 0; i < 20; i++)
  {
    Logger.log('content: ' + results[i]);
    var team1NameString = results[i].match(teamNamePass1);
    Logger.log('content: ' + team1NameString[0]);
    var team2NameString = team1NameString[0].match(teamNamePass2);
    Logger.log('content: ' + team2NameString[0]);

    var team1Logo = results[i].match(teamLogoPass);
    Logger.log('content: ' + team1Logo[0]);

    addRecord(i+1, team2NameString[0], team1Logo[0]);
  }
}

function clearRecords()
{
  var ss= SpreadsheetApp.getActiveSpreadsheet();
  var tableSheet = ss.getSheetByName("TABLE");
  tableSheet.getRange("A1:D20").clear();

  var images = tableSheet.getImages();
  for (var i = 0; i < images.length; i++)
  {
    var img = images[i];
    img.remove();
  }
}


function addRecord(count, team, logo) {
  var ss= SpreadsheetApp.getActiveSpreadsheet();
  var tableSheet = ss.getSheetByName("TABLE");
  var currentRow = tableSheet.getLastRow();
  var nextRow = currentRow + 1;
  tableSheet.setRowHeight(nextRow, 30);
  tableSheet.getRange(nextRow,1).setValue(count);
  tableSheet.insertImage(logo, 2, nextRow);
  tableSheet.getRange(nextRow,3).setValue(team);
  tableSheet.getRange(nextRow,4).setValue(new Date());

}


diumenge, 30 de gener del 2022

hipervíncula oculto en una zona de una imagen

 <img src="colocar aquí el link" alt="" role="presentation" class="img-fluid" usemap="#workmap"><br></p>

<map name="workmap">

    <area shape="rect" coords="87,433,105,464" alt="Computer" href="https://youtu.be/pIo8-pEg7S0">

</map>


las coordenadas del area shape correspondientes a la imagen pueden obtenerse a través del Paint, activando la cuadrícula (Ctrl+G).