Problems with Google Sheets importxml - google-sheets

I am trying to import data from the Bscscan: https://bscscan.com/address/0x2ceDA5cf32A34702D342f0DedA0af298C1BD8049 to Google Sheets, using the formula =IMPORTXML(A1,A2), ie:
A1= https://bscscan.com/address/0x2ceDA5cf32A34702D342f0DedA0af298C1BD8049
A2= //[contains(concat( " ", #class, " " ), concat( " ", "mb-md-0", " " ))]//[contains(concat( " ", #class, " " ), concat( " ", "align-items-center", " " )) and (((count(preceding-sibling::) + 1) = 1) and parent::)]//*[contains(concat( " ", #class, " " ), concat( " ", "col-md-8", " " ))]
The problem is that every time it shows an error that says that is not possible to fetch url. I only have problems with this website, can someone please help me?

Related

I have a variable inside the print function but the output is not leaving space

character_name = "Tom"
character_age = "50"
print("There once was a man named" +character_name+ ",")
print("he was" + character_age + "years old")
character_name = "Mike"
print("He really liked the name" + character_name + ",")
print("but didn't like being" + character_age +",")
output
There once was a man namedTom,
he was50years old
He really liked the nameMike,
but didn't like being50,
How do I put space between named and Tom or was50years
character_name = "Tom"
character_age = "50"
print("There once was a man named " +character_name+ ",")
print(" he was " + character_age + " years old")
character_name = "Mike"
print("He really liked the name " + character_name + ",")
print("but didn't like being " + character_age +",")
Try this
character_name = "Tom"
character_age = "50"
print("There once was a man named " +character_name+ ",")
print("he was " + character_age + " years old")
character_name = "Mike"
print("He really liked the name " + character_name + ",")
print("but didn't like being " + character_age +",")
Another way to solve this is to add " " between your print statements like this:
character_name = "Tom"
character_age = "50"
print("There once was a man named" + " " +character_name+ ",")
print("he was " + character_age + " " + "years old")
character_name = "Mike"
print("He really liked the name"+ " " + character_name + ",")
print("but didn't like being" + " " + character_age +",")

Construct queries with a condition

I am using Spring Data Neo4j and I have a repository like this:
public interface MyNeo4jRepository extends Neo4jRepository<Object, Long> {
#Query("with ['X', 'Y','Z'] as list_labels, "
+ "$appsFilter as appsList\n "
+ "MATCH (apps:) where apps.n IN appsList "
+ "MATCH (a)<-[:event]-(nodes) "
+ "WHERE any(x IN labels(nodes) WHERE x IN list_labels) "
+ "CALL apoc.path.expandConfig(nodes, { "
+ "relationshipFilter: 'R1|R2>',"
+ "labelFilter: '-l1|>l2',"
+ "maxLevel: 6,"
+ "endNodes: [apps],"
+ "uniqueness: 'NODE_PATH'}) YIELD path "
+ "unwind nodes(path) as n "
...
}
I want to create this query using conditions like this:
#Query("with ['X', 'Y','Z'] as list_labels, "
+ "$appsFilter as appsList\n "
+ "MATCH (apps:) where apps.n IN appsList "
+ "MATCH (a)<-[:event]-(nodes) "
+ "WHERE any(x IN labels(nodes) WHERE x IN list_labels) "
if (condition) + "WHERE ...." else + ""
+ "CALL apoc.path.expandConfig(nodes, { "
...
Is there a way to do it in the Neo4j query or do I have to do it with Spring composable repositories?
I think what you are looking for is the CASE construct
'WHERE ....'
+
CASE
WHEN condition1 THEN 'cypherFragement1'
WHEN condition2 THEN 'cypherFragement2'
ELSE 'cypherFragementElse'
END
+
.....
Maybe you can rewrite your entire cypher via apoc.do.when or apoc.do.case functions, which provide conditional judgment.

Google Ads Scripts AWQL "CONTAINS_ANY" operator doesn't work

I'm trying to extract Search queries by certain rules and I need to get Queries that contain one of the given strings:
" WHERE " +
" Impressions > " + IMPRESSIONS_THRESHOLD +
" AND AverageCpc > " + AVERAGE_CPC_THRESHOLD +
" AND Query CONTAINS_ANY ['for sale in', 'buy'] " +
" DURING YESTERDAY ");
But I'm getting error message (tryed different variations):
One of the conditions in the query is invalid. (file Code.gs, line 19)
Although it seems like I do everything according to Formal Grammar:
String -> StringSingleQ | StringDoubleQ
StringSingleQ -> '(char)'
StringDoubleQ -> "(char)"
StringList -> [ String (, String)* ]
If I do just 1 string it works fine:
" WHERE " +
" Impressions > " + IMPRESSIONS_THRESHOLD +
" AND AverageCpc > " + AVERAGE_CPC_THRESHOLD +
" AND Query CONTAINS 'for sale in' " +
" DURING YESTERDAY ");
IIRC, the CONTAINS_ANY operator only works when you are filtering on labels. I'm not sure if this constraint is actually documented, but this article seems to at least imply it.

Formula references data that are not shown

I need some help with my Google Sheets... I don't understand why but my data are capricious...
I use a simple ={'Mysheet'!A1:D} and I get only the first cell.
Please find a link to a copy of my sheet. The problem is in 'Up&Down OR'
https://docs.google.com/spreadsheets/d/1HJ_bqQtsjWe9RxaDzLUypY-D9dyuqWNpw2pG0XHVYjI/edit?usp=sharing
most likely there is some residue from the script you are usiing but you can always reference original:
=QUERY(Encodage!A1:AAA ;"select C, " & params!K1 & ", " & params!L1 & ", " & params!M1 & " where A = FALSE AND B = '1OR' ORDER BY " & params!K1 & " + " & params!L1 & " + " & params!M1 & " LIMIT 10 LABEL " & params!K1 & " '" & INDIRECT("Encodage!"& params!K1 & "1") & "', " & params!L1 & " '" & INDIRECT("Encodage!"& params!L1 & "1") & "', " & params!M1 & " '" & INDIRECT("Encodage!"& params!M1 & "1") & "'" ;1)

Vaadin Desktop Notifications

Is there any support for html5 browser 'desktop notifications' in Vaadin? I've looked for this and can't find anything specific.
I've tried something like this with no luck.
JavaScript.getCurrent().execute(
"if (window.webkitNotifications) {" +
"if (window.webkitNotifications.checkPermission() == 0) { // 0 is PERMISSION_ALLOWED" +
" window.webkitNotifications.createNotification(" +
" 'icon.png', 'Notification Title', 'Notification content...');" +
" } else {\n" +
" window.webkitNotifications.requestPermission();" +
" } " +
"} else { " +
" console.log('no notifications')" +
"}");
Using vaadin 8
You tried with the old api, it hasn't been supported for many versions. The new api should work:
JavaScript.getCurrent().execute(
" if (!(\"Notification\" in window)) { " +
" alert(\"This browser does not support system notifications\"); " +
" } else if (Notification.permission === \"granted\") { " +
" new Notification(\"Hi there!\"); " +
" } else if (Notification.permission !== 'denied') { " +
" Notification.requestPermission(function (permission) { " +
" if (permission === \"granted\") { " +
" Notification(\"Hi there!\"); " +
" } " +
" }); " +
" } "
);
Can't say this is a good way to do it though.
There is a plugin for vaadin 7 https://vaadin.com/directory#!addon/webnotifications you can adopt it to 8. Or create a JavaScript component or at at least a JavaScript function that will make using it easier.

Resources