Pages

sâmbătă, 2 decembrie 2023

News : Chart with sizes values from Google Drive.

Visual data representation in graphical format can solve many of today's issues.
Here is a tutorial with a Google Apps Script script that allows you to view the size of the files in Google Drive in Chart Pie format and modify it.
You can find more tutorials about Google Apps Script on my Google site.
Let's see the source code:
function generateDriveUsageReportPie() {
  var drive = DriveApp.getRootFolder();
  var files = drive.getFiles();

  var data = [['Nume Fișier', 'Dimensiune (KB)']];
  
  while (files.hasNext()) {
    var file = files.next();
    var fileSizeBytes = file.getSize();
    var fileSizeKB = fileSizeBytes / 1024; // Convertim dimensiunea în KB
    data.push([file.getName(), fileSizeKB]);
  }

  // open Google Sheet
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = spreadsheet.getSheetByName('Drive Usage Report');
  if (!sheet) {
    sheet = spreadsheet.insertSheet('Drive Usage Report');
  }

  // clean sheet
  sheet.clear();

  // write values
  sheet.getRange(1, 1, data.length, data[0].length).setValues(data);

  // clean charts from Google Sheets
  var charts = sheet.getCharts();
  for (var i = 0; i < charts.length; i++) {
    sheet.removeChart(charts[i]);
  }

  // create and add the Pie Chart with all values
  var chart = sheet.newChart()
    .asPieChart()
    .setTitle('Utilizare Google Drive')
    .addRange(sheet.getRange(2, 1, data.length - 1, 2))  // Exclude header row
    .setPosition(5, 1, 0, 0)
    .setOption('title', 'Utilizare Google Drive')
    .setOption('legend', {position: 'top'})
    .build();

  sheet.insertChart(chart);

  Logger.log('Raport generat cu succes.');
}
Here is the result obtained:

vineri, 1 decembrie 2023

joi, 30 noiembrie 2023

News : Toy Trains - Announcement Trailer | PS VR2 Games.

News : Godot 4.2 arrives in style!

Earlier this year we stepped into the future of Godot with the release of Godot 4.0, and 4 months later we followed it up with Godot 4.1 which was full of new features and improvements. Today we are proud to announce the release of Godot 4.2, our latest and greatest offering to game developers looking for a free and open engine that inspires joy and creativity!
Over the course of the last 5 months 359 contributors submitted more than 1800 improvements for this release, and we cannot thank each of them enough for their dedication and relentless spirit, their trust in the project, and their generosity. We also must express our love for everyone reporting issues during the testing period and helping us make sure that thousands of Godot users get the best version of the engine we can collectively create.
You can read more on this stable version on the official website.