Noob user, run into an error on prototyping attempt - google-app-engine

I'm making my first attempt at creating a Service and API prototype. I've been following this guide https://medium.com/madhash/prototype-your-app-with-firebase-api-7a51325de6f2
I've reached the step of "Run > Run Function > Initialize" but i'm getting an error relating to the code.gs I've pasted in from https://gist.github.com/dottedsquirrel/b248e5098fe2a9c860ed60f7db7c7e1d
The error i'm getting is "We're sorry, a server error occurred. Please wait a bit and try again. (line 49, file "Code")"
When I look at the line of code it states: var ss = SpreadsheetApp.openById(sheetID);
Can anyone provide me some pointers as to how to resolve this error? Could there be a problem with the data set I created? The data sheet i'm pointing looks like this:
ID
ItemFunctionalID
ItemFunctionalID
Type
CustodianGroupID
ProcessScopeID
CountryID
StartDt
EndDt
Status
1
28948190843
Release
100199
200002
01/01/2021
Active
2
28948190843
Release
100011
01/01/2021
Active
3
28948191024
Release
100199
200002
01/01/2021
Active
4
28948191024
Release
100011
01/01/2021
Active
5
28948191031
Release
100199
200002
01/01/2021
Active
Thanks!

I tried to run the code by:
Run> Run Function > Initialize
And it didn't work, instead try to go to select function, select initialize and then press the triangle on the left to run the script.

Related

"Connection closed" occurs when executing a agent

"Connection closed" occurs when executing a function for data pre-processing.
The data pre-processing is as follows.
Import data points of about 30 topics from the database.( Data for 9 days every 1 minute,
60 * 24 * 9 * 30 = 388,800 values)
Convert data to a pandas dataframe for pre-processing such as missing value or resampling (this process takes the longest time)
Data processing
In the above data pre-processing, the following error occurs.
volttron.platform.vip.rmq_connection ERROR: Connection closed unexpectedly, reopening in 30 seconds.
This error is probably what the VOLTTRON platform does to manage the agent.
Since it takes more than 30 seconds in step 2, an error occurs and the VOLTTRON platform automatically restarts the agent.
Because of this, the agent cannot perform data processing normally.
Does anyone know how to avoid this?
If this is happening during agent instantiation I would suggest moving the pre-processing out of the init or configuration steps to a function with the #core.receiver("onstart") decorator. This will stop the agent instantiation and configuration steps from timing out. The listener agent's on start method can be used as an example.

Compare a property value to an aggregated value in Gremlin

I'm trying to implement a sort of "window function" in a Gremlin query: I want to select all the edges leaving a vertex, which have a timestamp within 24 hours of the last update (local to the vertex).
For example if User A accessed the following resources:
Resource 1 at 2019/04/02 23:00
Resource 2 at 2019/04/02 01:00
Resource 3 at 2019/04/01 22:00
.. then I'd want the query to return resources 1 & 2, and omit resource 3 because it was accessed 25 hours before User A's latest access (outside the 24-hour window).
I've tried a few different approaches, for example using local and aggregate:
g.V()
.hasLabel(VertexLabel.User)
.local(__.outE(EdgeLabel.Accesses) // I also tried "sideEffect" here
.values(EdgeProperties.UpdateTime).max().math("_ - 24*60*60*1000")
.aggregate("windowStart"))
.where(
__.outE(EdgeLabel.Accesses)
.has(EdgeProperties.UpdateTime, P.gt("windowStart"))
)
This particular example gives me the error ClassCastException: java.lang.Double cannot be cast to org.apache.tinkerpop.gremlin.structure.Element.
And also using a sack:
g.V()
.hasLabel(VertexLabel.User)
.sack(Operator.assign).by(
__.outE(EdgeLabel.Accesses).values(EdgeProperties.UpdateTime).max())
.sack(Operator.minus).by(__.constant(24*60*60*1000)
.where(
__.outE(EdgeLabel.Accesses)
.not(__.sack().is(P.gt(__.values(EdgeProperties.UpdateTime))))
)
This gives me the error ClassCastException: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal cannot be cast to java.lang.Long.
I feel like I'm just getting hung up on Gremlin semantics--I'm trying to compare the values in the wrong form. What do I need to do to access the "windowStart" value for the current vertex in the traversal, in a gt/lt predicate?
I've made a few assumptions on what the answers to my comments could be. The following query will give you every user and his respective accessed resources within the last 24 hours (with the reference time being the times of the last resource access time):
g.V().hasLabel(VertexLabel.User).
match(__.as("user").map(outE(EdgeLabel.Accesses).
values(EdgeProperties.UpdateTime).max()).
math("_-24*60*60*1000").as("m"),
__.as("user").outE(EdgeLabel.Accesses).
where(gt("m")).
by(EdgeProperties.UpdateTime).
by().
inV().fold().as("resources")).
select("user","resources")

report server timeout after 1.5 minutes in browser

I desperately need help/suggestions
I'm not sure if this question is ok for SO, so sorry in advance...
well, problem is:
I have this one report in visual studio 2013 ( which doesn't really matter )
and it has a subquery
the query itself takes ~5 seconds
but hence it's in a sub
time dataretrieval = 33343
time processing = 388703
and time rendering = 22
the problem is that NONE of the browsers show the result
all of them just stop (i don't know what to call it, render? the thing that keeps on circling just stops ) after 1 minute 30 seconds.
I checked if I have timeouts anywhere
some said 1800 seconds, changed it to 0 and higher, still 1.5 minute dead end.
please, I'm open to suggestions.
the subquery generates ~300-500 excel pages
it works in VS itself
and even in browsers, when I check ExecutionLog2 it says success but no data is shown in the browser(s)
thanks guys & sorry if inappropriate.

sp_send_email sending stored proc variable result

I was given some lengthy code that in essence builds a long string and was tasked with being able to get this long string sent via t-sql email. The code is over 1300 lines long and they don't want me to rewrite the code. I was able to convince them to let me turn it into a stored procedure which I did and that works fine.
My question is, is there a way to capture the "Message" tab results and send them out via the sp_send_email stored procedure?
So if, for example, the message tab says:
DB Instance: SqlSvrName\Instance
Timestamp: Apr 7 2015 2:21PM
QATech: DomainName\Name
CLAIMS TASKS CLEAN UP
1.0 Delete Duplicated Tasks
Claims Tasks That Have Duplicates
1 Claims Have Duplicated Tasks
1.1 Duplicate Removal 1
0 Tasks Deleted
1.1 Duplicate Removal 1 Complete
1.2 Duplicate Removal 2
0 Tasks Deleted
1.2 Duplicate Removal 2 Complete
1.3 Duplicate Removal 3
0 Tasks Deleted
1.3 Duplicate Removal 3 Complete
Set up your stored procedure to use #MR as an OUTPUT parameter

SQl Server I need to fix the error of "Timeout expired. The timeout period elapsed"

I know it's been asked a bunch of times but I can't seem to get the fixes I've read to solve my issue. I'm getting the SQL Server error that "the timeout period elapsed prior to completion of the operation or the server is not responding." I changed the setting under Tools>Options>Designers>"Override connection string time- out value" to 120 seconds as per this posting, but... it still times out after 30 seconds. I'm accessing the database from visual studio, working directly with it, and not with ado in client code. I'm open to suggestions... here's the query btw:
SELECT
Symbol
FROM
tblSymbolsMain
WHERE
((SELECT dbo.LatestDateInDailyPricingVolBySymbol(tblSymbolsMain.Symbol) AS Expr1) < dbo.RecentTradingDateByNumber(5))
In a nutshell, the goal is to return all stock symbols from a main symbols table that don't have a daily pricing data point in the pricing table for at least 5 trading days.
As always thanks in advance..
The code doesnt appear to be correct ... you have ...WHERE (SELECT...)
WHERE what?
Are you sure you are not after
SELECT MyCols FROM MyTable WHERE ID IN (...)
OR
SELECT MyCols FROM MyTable WHERE ID NOT IN (...)
Where (...) represents another select returning some sort of ID.
Otherwise of course you'd get a timeout. That select may return a count and WHERE 1 can go on and on and on...

Resources