Prefect Job Scheduling for specific date and time - scheduled-tasks

I want to schedule jobs in prefect for non-cron and intervals , I have some specific dates for which I want the flow to run, I saw that it is possible in prefect 1 using DateClocks but I do not see any example, can you provide me with one that includes time zone as well?
I want to use code to do this rather than the UI
I Haven't tried it it because I am new to this, I want to set up runs for specific dates, can you please give me an example where we can include timezone as well?

Yes, that's very doable - the easiest way is to leverage pendulum and the run_deployment utility:
import pendulum
from prefect.deployments import run_deployment
run_deployment(
name="flow/deploy_name",
scheduled_time=pendulum.datetime(2023, 4, 1, 20, 0, 0, 0, tz="Europe/Berlin"),
)
run_deployment(
name="flow/deploy_name",
scheduled_time=pendulum.datetime(2023, 4, 2, 20, 0, 0, 0, tz="Europe/Berlin"),
)

Related

Flutter AwesomeNotification: How schedule a notification for several days of the week?

I'm using the package awesome_notifications 0.7.4+1 and I want to schedule a notification for several days of the week (for example on Monday and on Wednesday). I thought that the NotificationCalendar is the way to go, but I only have the option to put an int after weekday: . My code example shows, how I wish it was implemented (but it isn't), so you can get a better idea of what I want.
schedule: NotificationCalendar(
weekday: [1;3],
hour: 1,
minute: 1,
timeZone: timezone,
repeats: true,
)
I am aware that there is also the option to user NotificationAndroidCrontab but I want my app to work also for iOS.
Is it even possible or do I need to create separate notifications?

correlation of two values in one receive buffer Load runner

I have recorded a script in LR11.5 version using Winsocket protocol (Only protocol I was able to use to record my application). I want to correlate few receive buffers. In one such buffer I have two values to correlate, given that both are same values. Buffer is as below :-
recv buf30 136
"&SOT&148\vF.USER\vSK1\vTIME.OUT.MINUTES&EOT&&START&148\v3\v999&END&&START&"
"99\v56\v28 FEB 2016\vSK1\v8298,\v28 FEB 2016 16:23\vg15.0.00\vr11.000&END&"
The high lightened values are the one that I need to correlate. What should I do for this. I have used to lrs_save_param() function for correlation.
The correlation API you need depends on the network protocol recorded in your script. If it uses constant offsets of fields, you can safely use lrs_save_param. The result of correlation would be something like this:
lrs_save_param("socket0", LRS_LAST_RECEIVED, "param1", 16, 3);
lrs_save_param("socket0", LRS_LAST_RECEIVED, "param2", 138, 3);
(Zero-based offset, length of the value.)
But if the offsets vary from run to run, the situation is more complicated: you'll have to specify boundaries for the extracted values. For instance:
lrs_save_searched_string("socket0", LRS_LAST_RECEIVED, "param1", "LB/BIN=\v", "RB/BIN=\v",
2, 0, -1);
lrs_save_searched_string("socket0", LRS_LAST_RECEIVED, "param2", "LB/BIN=\v", "RB/BIN=\v",
8, 0, -1);
(Left and right boundary, 1-based number of occurrence, offset from the left boundary, length, which is autodetected in this case.)
Please check the official documentation for details.

How to find out the difference between two times with Moment.js?

I am having two times one is sleeping time and another one is wake up time, and I want to find out difference between these two times.
Is there any way to do so? I am using Moment.js.
Please read the documentation for momentjs here: http://momentjs.com/docs/#/displaying/difference/
var a = moment([2007, 0, 29]);
var b = moment([2007, 0, 28]);
a.diff(b) // 86400000

SSRS cell Expression produces #ERROR in cell when report is run

Anyone know why the following expression would make my cell just say "#ERROR"?
=IIf(Sum(Fields!curr.Value) = 0, 0, Sum(Fields!due.Value) / Sum(Fields!curr.Value))
Is it not short circuiting so it still hits the division by zero? If so, would there be a way around this?
Microsoft thinks they are smarter than you and are checking for a divide by zero even though you'll never hit it because of your logic.
The Trick (i.e. Workaround for Microsoft's propensity for "helping" and making things worse) is to use another IIF:
=IIf(Sum(Fields!curr.Value) = 0, 0, Sum(Fields!due.Value)) / IIF(Sum(Fields!curr.Value) = 0, 1, Sum(Fields!curr.Value))
SSRS Expression Divide by Zero Error
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ef1a0375-414e-41f4-b32f-3b782c5b4c85/error-using-iif-and-divide-by-zero?forum=sqlreportingservices

celery.beat implementation of crontab

My task is to add a new stream in Wowza media server which must take place at a user specified time. Currently I'm using crontab together with http provider for this purpose. I want a celery.beat implementation for this. Can anyone help?
If this is a one-off task to be executed at a specific time then you don't need to use Periodic Tasks (celerybeat).
Rather you can use the eta/countdown argument to task.apply_async:
task.apply_async(eta=datetime(2012, 07, 1, 14, 30))
task.apply_async(countdown=30) # in 30 seconds
Read more here:
http://celery.github.com/celery/userguide/calling.html