Getting started with google gadgets - google-apps-script

i am still trying to get my first gadget working....
so i followed the help,
openend my site, openend the scripts, added a script, made a html-type ui, published for each semicomma i changed a version since otherwise there seems no way to test the script prior to publishing it, in the exe window it looks ok, so now i wanted to embed it into the site....
and ,,, it doesn't appear ....
added "by URL"
well so i pasted the exes page URL into it, and i get a
Unsupported feature: org.apache.shindig.common.xml.XmlException: The element type "meta" must be terminated by the matching end-tag "". At: (1383,5)
so i am stuck... how do i get my gadget onto the page???
URL is https://script.google.com/macros/s/AKfycbwbTcSDuGZLy1eNlAHjrewkmOm5ZHkDQsze3CPP4-M/dev
ciao
Bruno

The url of a gadget on a web page looks like this :
https://sites.google.com/macros/exec?service=AKfycbxLvE49lcgdQlvw3ouxLnjEvYwgdiOPH5ecNYClzw
The script has to be saved with a version and published (deployed) before it can be inserted.
Could you tell us if you have the script shown in the list of available scripts in 'manage this site' (see below)
and then when you try to insert the gadget you should have the very same list like this :
if none of these steps are ok then I suggest you re-create a new script by copy/pasting the code, publish it from the script editor of the site and retry... this is a pretty staightforward procedure and I don't know what could go wrong if you follow every step of it...
good luck ;)

in the insert menu there are 2 possibilities to insert gadgets (and the logic of that escapes me, that why it took so long to find...) the first one are public gadgets and the second one is the one i searched the whole time, with the local gadgets...
so problem solved,
sorry for the inconveninence....
Bruno

Related

Opening a downloaded mht file from Selenium (Help needed)

Long story short, I'm not a coder.
My team used to have this coder who created this Python/Selenium code to extract some information from chrome browser (Echocardiography reports) and/or downloaded mht file (also Echocardiography reports).
This code was working fine until recently, it stopped working.
The program still successfully downloads the mht file via chrome.
However, it fails to open the file and hence, code continues without extracting any information - resulting in empty extractions.
This is the part I need help figuring out
driver.get('chrome://downloads')
# driver.get('file:///C:/Users/name/Downloads/')
root1 = driver.find_element_by_tag_name('downloads-manager')
shadow_root1 = expand_shadow_element(root1)
time.sleep(2)
root2 = shadow_root1.find_element_by_css_selector('downloads-item')
shadow_root2 = expand_shadow_element(root2)
time.sleep(1.5)
openEchoFileButton = shadow_root2.find_element_by_id('file-link')
mhtFileName = openEchoFileButton.text
driver.get('file:///C:/Users/name/Downloads/' + mhtFileName) # go to web page
try:
echoDateElement = WebDriverWait(driver, delay).until(
EC.presence_of_element_located((By.XPATH, '/html/body/div[3]/p[1]/span[3]')))
except TimeoutException:
print("Loading page took too much time!")
I'm trying to figure out why it suddenly fails to open the downloaded mht files.
Last time our team tried using this code is back in 2020 and was successful.
Were there any updates to Chrome perhaps?
Help would be immensely appreciated.
Thank you so much in advance.
There are three obvious weaknesses in this code. The first two are the use of time.sleep() to wait for the element to appear and be manipulable. What if the machine is busy doing something else, and 1.5 seconds isn't enough? The right way to do that is to repeatedly check for the element to be ready. You've got a great example of how to do that using WebDriverWait() in this code already. The third weakness is the locator used in that presence_of_element_located() call. XPath locators rooted at "/html" are notoriously fragile, subject to breakage by small changes to the web page. Try to find something in the page that you can check via a more stable locator - ideally, an element with an ID= attribute.

Zabbix and HP OpenView integration

Did someone ever set up Zabbix to work with HP OpenView ?
Zabbix docs doesn't mention much information on that.
I know I have to create a media linked to a script.
In that script I have to use the opcmsg command but I don't understand the part which involves the database.
Can someone who ever experienced it drives me to the solution ?
Regards
You are missing media script doc. Parse input in your media script and process it with 'opcmsg'.
Try to find similar alert scripts (concept, not code) for your inspiration - https://www.zabbix.com/documentation/3.0/manual/config/notifications/media/script
And finally please publish your script with documentation (I recommend Github + Zabbix share).
Finally we have decided to create a media script which is writing output to a file.
Then that file will be monitored by a HP OpenView agent.
The steps are the following:
Create media script which is referencing your script :
In my case the script is named hpov.sh
The location of your script has to be referenced in your server config file (zabbix_server.conf) this way : AlertScriptsPath=/path/to/zabbix/scripts
Create an action which will be triggered on problems. Specify the macro you want in the first tab. The condition you want in the second one (leave as default). And finally set the third tab "Operations" like that:
You are free to change Users who are concerned
As the documentation says, link that media script to a user of your choice
That's it !

Multiple Shiny apps using the ui to populate the second app

I currently have a app that manages projects. The user sees a list of projects and can select one. They can should (it would be nice) be able to click a run button and have another app open. The parameters stored in the project they selected are populated into the second application. The issue I am having is firing the second application. runApp generates the following.
ui code line:
actionButton("RunProj", "Run"),
Warning in run(timeoutMs) :
Unhandled error in observer: Key / already in use
observeEvent(input$RunProj)
I would like to trigger the second app and pass in the location of the project directory I have looked at parseQueryString and still trying to figure out a way to include that. Maybe via a redirect?
Any suggests would be much appreciated.
Regards,
Rich
I'm not 100% sure if I understand your intention correctly but here is a few things I think you may want to think about.
In one project, if you want to run a few kinds of analyses, you may want to try navbarPage
If there are many different types of analyses, you may want to try shinydashboard
If you know the link to each app and you really want to add those "run" buttons, you can add a button manually in ui.R. I think you can write some codes in server.r to generate the link based on your database.
tags$a(href="the link to your apps", class= "btn btn-default", "Run App")

No Google BigQuery table created after importing data through webclient

I'm currently familiarizing myself with Google BigQuery by working through the examples at https://cloud.google.com/bigquery/web-ui-quickstart. Doing a query over the pubic datasets runs fine.
I run into problems when uploading custom data into a new table through the WebUI. I create a new dataset and table, and upload the csv file provided with the example case. As in the example I input the schema and submit the file. Now the upload window stays on top and turns grey as if it's working. Nothing seems to happen afterwards though. When clicking away the upload window after a long wait, the table seems to be created in the tree on the left. However, when clicking on the table an error is shown:
"Unable to find table: ndwtest-984:csvtest.csvdata"
This seems like a trivial action, however I cannot seems to get it to work. I've tried varies different files, uploaded the file to Google Cloud Storage first and played around with the advanced options the last two days, but keep getting the same error.
Help would be much appreciated.
Some steps to help you:
billing must be enabled
you need to choose to upload one single TXT file from the example eg: yob2013.txt and not the zip file
make sure the schema is entered as text: name:string,gender:string,count:integer
on the last screen of the wizard you don't need to change the default CSV option parameters (for demo purposes works as it is)
I just tried the example, and it does work for me. In case you still have errors, than you can check your Job History menu in the Web UI, direct link would be, warning you need to put your Id in the link.
https://bigquery.cloud.google.com/jobs/YOUR_ANONYMOUS_PROJECT_ID_HERE?pli=1

How to search a word in a html file without any java coding?

I'm doing a project in Java which creates a user manual (html files that are linked together like Windows "Help and support centre") of software. Now once a user manual is created I have only html files remaining. Now I want to search html file that contains specified keyword(Search Engine).How can I do this without Java code??
grep, find, python script, or open any file with a text editor and try edit->search
(on windows use windows search in file)
If all of your other code is written in java, then it'll be sensible (without knowing your usecase) to use java for searching as well. You might of course use some commandline programs as grep or find - or built in search functionality in a webbrowser, but if the search should be part of a java application anyway, why not go for java and e.g. Lucene?
If this 'help' is going to be online than you can embed google search in it (limiting the search results to specified site:). Alternatively if you're hosting the pages yourself you can use htdig for indexing the pages.
However if it's going to offilne you'll be better of by generating a static index page with links to topics. In order to create a more help-system-alike user experience you can hide the contents of the index in the invisible html DIV tags and add a JavaScript that takes searched phrase as an input and that unhides the matched words with their links.
Maybe I'm missing something, but have you looked at javahelp? It has indexing and searching built in, and can be used online or offline.