html – Extract CSS classes from rendered website when local CSS files aren’t available

Some websites don’t provide a plain CSS file as a local static file, but the browser can render the styles properly so that if I wanted I could look at the browser devtools and for each element copy its assigned classes with attributes and values.

Does it exist a method or a tool that can extract a proper CSS file in such a case, is it possible to write a browser add-on that can do something similar (do browser APIs give programmatic access to that information)?

google sheets – Extract the first three unique characters of a name to create a code

I have a column D where I store the VENDOR COMPANY NAME.
I have a column B where I want to calculate a SHORTCODE unique for each vendor. This code will be the first 3 letters of the VENDOR COMPANY NAME, Capitalised and unique in the Column B. If there is already a value of the same 3 letters in SHORTCODE, the next three letters of the name will be extracted, and so on.

For example, if I have a company name: ACME INDUSTRIES -> ACM will be extracted. If these is already a SHORTCODE with ACM in the column B, CME will be extracted. If CME already exists, MEI will be extracted, if that already exists EIN will be extracted. IF this value is unique it will be stored in the column B, SHORTCODE itself.

Currently I’m using the following formula, and have enabled Iterative Calculations in Google Sheets:

=IF($D12=””,””,IF((COUNTIF($B$2:$B,UPPER(LEFT($D12,3)))<1),(UPPER(LEFT($D12,3))),IF((COUNTIF($B$2:$B,UPPER(RIGHT(LEFT($D12,4),3)))<1),(UPPER(RIGHT(LEFT($D12,4),3))),IF((COUNTIF($B$2:$B,UPPER(RIGHT(LEFT($D12,5),3)))<1),(UPPER(RIGHT(LEFT($D12,5),3))),IF((COUNTIF($B$2:$B,UPPER(RIGHT(LEFT($D12,6),3)))<1),(UPPER(RIGHT(LEFT($D12,6),3))),”ERROR”)))))

The problem is that this code is very volatiles and keeps on changing, however I want fixed values?

Is there a way I can achieve this easily using formulas or Google app script?

Thanks

complex analysis – Extract the $0$-th coefficient from given series.

Let there be a function:
$$F:mathbb{R}rightarrowmathbb{C}$$
$$F(x)=sum_{nin mathbb{Z}}a_ne^{inx}$$

For some real-valued sequence $(a_n)_{nin mathbb{Z}}$

How to extract the zeroth coefficient ($a_0$) ?

I was considering the usage of derivatives in this case, but i didn’t figure out how to do this.

Thank you for help.

batch – Command Prompt extract jpg files with full path

I need a batch command to list all files (with extension .Jpg, .Txt) here is one command

dir /r /s /b

output of command:

C:Usersvb3Desktopdocsnews.mp4
C:Usersvb3Desktopdocsspeech.mp3
C:Usersvb3Desktopdocsnamo.apk
C:Usersvb3Desktopdocsn1.txt
C:Usersvb3Desktopdocsnew.txt
C:Usersvb3Desktopdocsnew2.html
C:Usersvb3Desktopdocsnew3.png
C:Usersvb3Desktopdocswebnew3.js
C:Usersvb3Desktopdocswebindex.html
C:Usersvb3Desktopdocswebbackground.jpg
C:Usersvb3Desktopdocswebbanner.jpg
...
...

But I want output something like this:

C:Usersvb3Desktopdocswebbackground.jpg
C:Usersvb3Desktopdocswebbanner.jpg
C:Usersvb3Desktopdocsn1.txt
C:Usersvb3Desktopdocsnew.txt

without if else statement is there any way to filter path of only jpg and txt files

google sheets – Using UrlFetchApp.fetch(url) with regex to extract website data

I’m trying to extract data from a list of >1000 URLs using a script that uses UrlFetchApp.fetch(url) and regex based on this article.

This is the code I’m using.

function importRegex(url, regex_string) {
  var html, content = '';
  var response = UrlFetchApp.fetch(url);
  if (response) {
    html = response.getContentText();
    if (html.length && regex_string.length) {
      var regex = new RegExp( regex_string, "i" );
      content = html.match(regex)(1);
    }
  }
  content = unescapeHTML(content);
  Utilities.sleep(1000); // avoid call limit by adding a delay
  return content;  
}

var htmlEntities = {
  cent:  '¢',
  pound: '£',
  yen:   '¥',
  euro:  '€',
  copy:  '©',
  reg:   '®',
  lt:    '<',
  gt:    '>',
  mdash: '–',
  quot:  '"',
  amp:   '&',
  apos:  '''
};

function unescapeHTML(str) {
    return str.replace(/&((^;)+);/g, function (entity, entityCode) {
        var match;

        if (entityCode in htmlEntities) {
            return htmlEntities(entityCode);
        } else if (match = entityCode.match(/^#x((da-fA-F)+)$/)) {
            return String.fromCharCode(parseInt(match(1), 16));
        } else if (match = entityCode.match(/^#(d+)$/)) {
            return String.fromCharCode(~~match(1));
        } else {
            return entity;
        }
    });
};

and the importregex function formula I’m using is

=importRegex(A4, "<h1 class=""ch-title"".*?>(.*)</h1>")

It gives the following error

TypeError: Cannot read property '1' of null (line 9).

enter image description here

I’m not sure how to fix it.

Google App Script: using UrlFetchApp.fetch(url) with regex to extract website data

I’m trying to extract data from a list of >1000 URLs using a script that uses UrlFetchApp.fetch(url) and regex based on this article.

This is the code I’m using.

function importRegex(url, regex_string) {
  var html, content = '';
  var response = UrlFetchApp.fetch(url);
  if (response) {
    html = response.getContentText();
    if (html.length && regex_string.length) {
      var regex = new RegExp( regex_string, "i" );
      content = html.match(regex)(1);
    }
  }
  content = unescapeHTML(content);
  Utilities.sleep(1000); // avoid call limit by adding a delay
  return content;  
}

and the importregex function formula I’m using is, and neither of them work

=importRegex(A4, "<div class="ch-title".*?<h1>(.*)</h1>")

enter image description here

And

=importRegex(A5, "<title>(.*)</title>")

enter image description here

I’d initially tried importxml with xpath, but it doesn’t work with a large number of URLs, so I’m trying the UrlFetchApp.fetch(url) approach, the xpath that I’ve used with importxml (that works) that extracts the required data is

=IMPORTXML($A4,"//h1(contains(@class,'ch-title'))")

enter image description here

I’m not sure what I’m doing wrong, but the importregex is not working.

node.js – To extract data as Json from mysql and return to controller (Node JS)

-I am using a query to fetch data in Json format from MySql In Node JS

 Get_productslist: function (data, callback) {
    console.log('In productsmodel');
    var query = "select json_object('productid',product_id ,'productname',product_name,'product_description', product_description) from products";
   // var query = 'SELECT * FROM  products p,  subcategories sub  WHERE p.category_id ='+ 4 +' and sub.category_id='+ 4;
   console.log(query);
   db.query(query, callback, (err, result) => {
      if (result) {
        console.log('results');
        console.log(result);
       // return callback(null, results);
      } else {
        return callback(err, null);
      }

    });
  },

**

  • Getting the response but the problem is this
  • **({
    json_object(‘productid’,product_id ,’productname’,product_name,’product_description’, product_description): “{“productid”: 3, “productname”: “Chocolate Frosted Doughnut”, “product_description”: “Have a goog health”}”
    },

{
json_object(‘productid’,product_id ,’productname’,product_name,’product_description’, product_description): “{“productid”: 5, “productname”: “Vanilla”, “product_description”: “Have a goog health”}”enter code here
},

  • how to remove that “json_object(…….):” in the response

Photos missing in iCloud, only thumbnails available locally – can I extract the thumbnails?

I have around 1700 photos that I’ve discovered are missing from my iCloud storage. (These are family/baby photos that we desperately don’t want to lose.)

When I try to download the photos from iCloud to Photos I get the following error:

iPhoto Download Error

I can see full-screen thumbnails in the Photos app (and they mostly look to be a decent resolution) but when trying to export/share the file it must be looking for the original and gives this error:

iPhoto Export Error

Is there any way to export the thumbnails from the Photos app? I’ve had a look through the SQLite database file and can’t see any blob data that could be thumbnails, although I may have missed it.

I’m hoping someone has a better idea than just taking screenshots of each photo individually, which is the only option I can think of right now.

How do I extract an mtl file from a full color obj?

Is there a way I can extract the texture files from an obj? Blender can’t read my full-color obj scans without a texture file which I don’t have, but Meshlab is able to read it without the texture files and still have in color.

Why does Peazip create a folder of the same name of the archive around the items I want to extract?

When I open up an archive in Peazip that has a folder in it, and I want to extract the contents of the folder to a new folder, Peazip for some reason places a folder of the same name of the archive in the new folder, with the contents I wanted to extract inside the subfolder. This is annoying, as I have to move the items from within the subfolder to the grandparent (?) folder, then delete the former parent folder. 7zip doesn’t have this problem, and I don’t think WinRAR acted like this either. So, why is it a uniquely PeaZip thing and how do I change it to act like 7zip?