How to display the message after 10 min of logging-in in progress4GL - openedge

How to display the message after 10 min of logging-in in progress4GL
A user can be logged in for a maximum of 10 minutes in the session. A warning message should
be displayed after 9 minutes of logging in .

You can try using ETIME to calculate the time after logging in (just remember that this is in milliseconds)...
https://knowledgebase.progress.com/articles/Article/P55318
DEFINE VARIABLE timer AS INT64 NO-UNDO.
timer = ETIME(yes).
WHEN timer > 600000 THEN DO:
//code
END.

Related

Map 624 could not be created for player GUID + unable to zone in while an encounter is in progress (Wintergrasp)

In the worldserver.conf I have disabled all Wintergrasp processing with the following option
Wintergrasp.Enable = 2
When I look at the Wintergrasp map no encounter is in progress, the doors to VOA are open but when I try to enter the VOA raid I get teleported back to my hearthstone location and receive the message:
unable to zone in while an encounter is in progress
The worldserver output shows:
Map 624 could not be created for player GUID Full: 0x0000000000000001 Type: Player Low: 1, porting player to homebind
I have tried changing the worldserver config Wintergrasp.Enable from 0 to 1 or 2 and it didn't have any effect on the in-game error unable to zone in while an encounter is in progress or the worldserver output error Map 624 could not be created for player GUID Full: 0x0000000000000001 Type: Player Low: 1, porting player to homebind
I also tried to see if it timed out but after 4 hours of letting the server run, the error remained the same when trying to enter the VOA raid.
Any tips on how to clear/fully disable the Wintergrasp encounter so I can enter VOA without being teleporter back to my hearthstone location when entering the raid?
Fixed this by setting the AzerothCore Wintergrasp enable setting to 0 so the battleground is disabled but processing is enabled and set the timers for the battle duration to 1 and nobattle timer to 90 minutes. This causes it to finish processing and after processing, it opens up for horde/alliance every 80 minutes with a 1-minute battle in between where you can't zone in. There is a check though in the source that whenever the counter is below 10 minutes you will be unable to zone in. So thats why the nobattle timer should be on 90 minute+. Both factions can enter the raid portal for VOA if you have an option to teleport over there for players

Verify time with 3 seconds buffer

Get Current Audio Upload Time
${time}= Get Current Date
${converted-time}= Convert Date ${time} result_format=%H:%M:%S
Log To Console time is ${converted-time}
Set Global Variable ${converted-time}
this script verifies that after searching the string, the result is returned then verify time is correct.
however, there is elapsed when the robot captured the current time vs the application captured time.
I cannot verify it directly, I need to give 3 seconds buffer.
robot captured time: 16:38:04
app captured time: 16:38:56
Verify Audio Time
[Arguments] ${RandomNumber}
Wait For Elements State //mark[text()='Dual-Channel-Audio-${RandomNumber}']//following::td[text()='${converted-time}']
UI which shows time

How to solve pdblp Time out issue

I am using Python to download some data from bloomberg. It works most of the time, but sometimes it pops up a 'Time Out Issue`. And after that the response and request does not match anymore.
The code I use in the for loop is as follows:
result_IVM=con.bdh(option_name,'IVOL_MID',date_string,date_string,longdata=True)
volatility=result_IVM['value'].values[0]
When I set up the connection, I used following code:
con = pdblp.BCon(debug=True, port=8194, timeout=5000)
If I increase the timeout parameter (now is 5,000), will it help for this issue?
I'd suggest to increase the timeout to 5000 or even 10000 then test for few times. The default value of timeout is 500 milliseconds, which is small!
The TIMEOUT Event is triggered by the blpapi when no Event(s) arrives within milliseconds
The author of pdblp defines timeout as:
timeout: int Number of milliseconds before timeout occurs when
parsing response. See blp.Session.nextEvent() for more information.
Ref: https://github.com/matthewgilbert/pdblp/blob/master/pdblp/pdblp.py

Idle time function on an Arduino

I want to add a timer to this function so that every time a uid is read it restarts and I can set another function to do a serial.write once a certain time is reached. Let's call this an idle time function. I cannot tie this to the ID read as I have 28 IDs potentially being read. I want to reset my audio player with an ASCII command via serial.write if no iud has been read for say longer than 180 seconds... Suggestions?
if(uid[0] == 0x64 && uid[1] == 0xBF && uid[2] == 0xD8 && uid[3] == 0x51)
{
//pause at beginning
delay (500);
//Serial.write("for Bässgen MM3210")
Serial.write("listplay 1 1");
Serial.write(13);
//pause at end
delay (3000);
}
You could assign each uid a value from the millis() call.
It basically counts the milliseconds since the chip turns on. It is stored in a long so it will reset to zero every 80 days or so I think (I never left it that long)
I did this to time a random array that was writing faster or slower based on how many pieces of data were in it. Instead of using delay() and counted loops, using millis() allowed me to jump in at a certain time.

Get ASP.NET Session Last Access Time (or Time-to-Timeout)

I'm trying to determine how much time is left in a given ASP.NET session until it times out.
If there is no readily available time-to-timeout value, I could also calculate it from its last access time (but I didn't find this either). Any idea how to do this?
If you are at the server, processing the request, then the timeout has just been reset so the full 20 minutes (or whatever you configured) remain.
If you want a client-side warning, you will need to create some javascript code that will fire about 20 minutes from "now". See the setTimeout method.
I have used that to display a warning, 15 minutes after the page was requested. It pops up an alert like "your session will expire on {HH:mm}, please save your work". The exact time was used instead of "in 5 minutes" as you never know when the user will see that message (did he return to his computer 10 minutes after the alert fired?).
For multi-page solution one could save last request time in cookie, and javascript could consider this last access time for handling warning message or login out action.
I have just implemented a solution like the one asked about here and it seems to work. I have an MVC application and have this code in my _Layout.chtml page but it could work in an asp.net app by placing it in the master page I would think. I am using local session storage via the amplify.js plugin. I use local session storage because as Mr Grieves says there could be a situation where a user is accessing the application in a way that does not cause a page refresh or redirect but still resets the session timeout on the server.
$(document).ready(function () {
var sessionTimeout = '#(Session.Timeout)'; //from server at startup
amplify.store.sessionStorage("sessionTimeout", sessionTimeout);
amplify.store.sessionStorage("timeLeft", sessionTimeout);
setInterval(checkSession, 60000); // run checkSession this every 1 minute
function checkSession() {
var timeLeft = amplify.store.sessionStorage("timeLeft");
timeLeft--; // decrement by 1 minute
amplify.store.sessionStorage("timeLeft", timeLeft);
if (timeLeft <= 10) {
alert("You have " + timeLeft + " minutes before session timeout. ");
}
}
});
Then in a page where users never cause a page refresh but still hit the server thereby causing a reset of their session I put this on a button click event:
$('#MyButton').click(function (e) {
//Some Code that causes session reset but not page refresh here
amplify.store.sessionStorage("sessionTimeout", 60); //default session timeout
amplify.store.sessionStorage("timeLeft", 60);
});
Using local session storage allows my _Layout.chtml code to see that the session has been reset here even though a page never got refreshed or redirected.
You can get the timeout in minutes from:
Session.Timeout
Isn't this enough to provide the information, as the timeout is reset every request? Don't know how you want to display this without doing a request?
Anyhow, best way is on every request setting some Session variable with the last access time. That should provide the info on remote.

Resources