How can I set specific duration for each dashboard using gem SinatraCyclist? - sinatra

Is there a way to set specific time/duration for specific dashboard using
gem 'sinatra_cyclist' link here.
Documentation says,
Usage
require "sinatra/base"
require "sinatra/cyclist"
class MyApp < Sinatra::Base
register Sinatra::Cyclist
set :routes_to_cycle_through, [:dashboard_1, :dashboard_2]
end
You can also specify a duration (in seconds) in the params to the cycle action
http://sinatra_app.com/_cycle?duration=10
Yes, it will cycle the 2 dashboards.
Is it possible (or not) to set for example 60 seconds for the 1st dashboard and 30 seconds for the 2nd?

Related

FleetApi - How to use legal rest times?

I'd like to know the position in which the driver would need to rest with given waypoints.
I am calling GET https://fleet.ls.hereapi.com/2/calculateroute.json with the following params:
{
mode: "fastest;car;traffic:enabled",
waypoint0: "19.286769, -99.652773",
waypoint1: "19.419185, -99.17755430000001",
waypoint2: "19.41530,-99.17844",
waypoint3: "31.29778, -110.93690",
restTimes: "MEX",
maxSpeed: 110,
departure: "2021-07-20T15:00:00.000Z"
}
This returns warnings with the info of rest times like this:
{
"message": "Taking the short driver rest time after 18036 sec for 1800 sec at routeLinkSeqNum 1485",
"code": 14,
"routeLinkSeqNum": 1485
}
I would like to know how to use/read this info. I don't know what routeLinkSeqNum is and how to utilize it.
Governments impose rules on how long a truck driver can drive before he needs to rest. Routing can consider these regulations w.r.t. short rests during a day and long (overnight) rests.
For example, in EU countries drivers have to rest after 4.5 hours of driving for at least 45 minutes, and must not exceed a total of 9 working hours per day before they have to rest for 11 hours.
Activate this feature in the router using the "&restTimes=local", in this case, it is the "MEX" in the request parameter. Routing will then consider each country's local regulations.
In the same parameter, you can specify whether the driver starts the route freshly or how long he is already driving / on duty since his last short or long rest period
routeLinkSeqNum is an index of the link array within a Leg. If you check the response, there will be response>route>[0]>leg[0]>[2]>link[1485].
So one route can have n-legs, 1 leg can have m-links
This will help you to plot the rest times.
Here is an example shown in the tool:
https://tcs.ext.here.com/examples/v3/fleet_telematics_api

Can I set duration to fluttertoast?

I am intending to use this library https://pub.dev/packages/fluttertoast/install for toasts.
Is there a way to set the duration. This is a web project, in case it makes any difference.
Thank you.
Here is what I've found:
The duration for which a toast is displayed on screen is unfortunately defined by a flag: you can either show it for a SHORT duration, which is 2 seconds or a LONG duration which is 3,5 seconds.
source
The package fluttertoast only implements those two types of duration and if you want a longer toast you will need to make your own implementation using native code.

How to call the controller task on each 1 min interval

I have created task on controller and there is loop which is loading for 100 times.
Now I want to load it for 25 times and pause that loop for 1 min and after that it will execute next 25 items same for next 25.
I have checked it with sleep but its not working.
Can you please advise me if is there any way on plugin event or any other method.
Thanks
This is actually unrelated to Joomla! Since you're creating a long running process you need to start it with something else than a browser. A CRON job is a good idea here if you want to execute this operation multiple times. Otherwise it can run via command line. Make sure the max_execution time setting of PHP does not cause any trouble.
If you still need this within Joomla please have a look at the CLI documentation.
https://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Platform

EzPublish AcitivityTimeOut Setting

Good Day Guys,
I'm wondering if it's possible to set the ActivityTimeOut Setting for 30 days?
I actually tried putting it on 30 days... 2592000 secs = 30days..
however after several hours of inactivity EzPublish logout my account.
As per the eZ Publish documentation :
# Number of seconds before a session is considered inactive/logged out, 1 hour is standard
ActivityTimeout=3600
Looking at the kernel code, where this setting is used, it looks like that it does not have any effect on really disconnecting a user, it's just about considering a user as inactive (via the fetchLoggedInList function for instance) which is used in the Admin > Sessions section of the admin interface (if you're using sql stored session, which is not the default behavior in the last 4.x versions of eZ Publish).
Have you tried and checked these parameters ?
[Session]
# "Remember me" feature of the login.
# Number of seconds a session cookie will last,
# if an user wants to store current session to the cookie
# should click on "Remember me" checkbox on login page.
# Empty or 0 means this ability will be disabled and CookieTimeout will be used.
RememberMeTimeout=
# Number of seconds a session will last, 3 days is standard
SessionTimeout=259200
# Number of seconds a session cookie will last,
# 0 means until browser is closed
# Leaving the field empty means to use the default PHP settings (session.cookie_lifetime)
CookieTimeout=
As you can see, cookies are by default controller by your PHP server configuration, so you should have a look here too.

Specify starting time of track within URL for SoundCloud?

Anyone know if there's a way to generate URL's for SoundCloud tracks that specify a start time for the song? I'm looking for a way to force playback of streams at a certain time in the stream without having to do any processing on my end via the API.
As #bsz correctly noticed, we have released a way of specifying start time on the sound when linking to it, append #t=12s to the sound's URL to start it at 12th second, etc.
If the audio is long enough, you can use (e.g.) #t=2h10m12s.
They seem to have added a #t option but not sure if you can also give an stop time:
https://soundcloud.com/razhavaniazha-com/06-06-2013-razhavaniazha-afn#t=54:00
You can also specify a start time one minute or over by appending
#XmXs
If you want a time right on the minute mark (e.g. 3:00), include 0 seconds (0s) in the time code (i.e. 3m0s), or else the start time will be ignored. It does not appear to support a start time over an hour.
Click share and set or pick time