Give me a logic how to run a specific code for the background when the selected time is met - sql

I'm making a program for a hotel management where a user input a
check-in date and check-out date If the client stays beyond this time,
he is charged for another day.
my main problem here is that how can i execute my code that not needed to push a button.
my idea is use a timer and set a time interval every hour so that it checks
the database if the system time and check-out time is met. any ideas?

Related

Word date modified changes spontaneously

How well known is this one. ALL the modified dates on hundreds of word documents are different to day than they were on Friday. They have all changed by an hour.
Is this a bug or a feature.
My analysis: The clocks changed by an hour over the weekend, so helpfully, Microsoft has reset ALL of the modified dates across the entire system. Presumably in six months they will all change again.
A routine I run daily, that normally takes six minutes to pick up any changes or new documents, is today taking HOURS, and recording hundreds of non existent changes.
This is an operating system issue; not a Word issue. And yes, it reflects the change in local time between standard and daylight savings/summer time. Any time-stamp dependent routine should take account of that.

How can I have RabbitMQ run just once on first message send?

I'm really new to Rabbit and I am not sure how to search for the exact terms related to this question or what is the best way to execute this
I have a task that gets called when a user reaches a page. I just want that page to get run one time for that day. If more people reach that page, then the task is not executed since it already did. If no one ever goes to that page, then the task is never run.
Can someone please kindly point me to a direction as to what I should be looking for?
You can store a key in Redis (or any other db) and set it's value with timestamp of the last running task: in each page view you will check that value and compare it to the current timestamp; if it refer to the same day, ignore. If it older than current day, update the value and trigger your task.
If your task consume too much time you can wrap it with a simple small webserver (flash/bottle/..) and your original trigger only http request..

BPMN 2.0 Repeat Activity on a Fixed Date

I have a question related on example:
We have an activity X which has to be executed every 10th day of the month and produce a report as output. How do I build a BPMN model to reflect this?
The answer here really depends on what BPM tool you are using and the defined capabilities of that tool. Generally, you would create a process with a timed start event such that the process only initiates every 10th day of the month. Then, activity X would execute, it builds a report, and finally outputs that report as the process output.
If a start event that can recognize the 10th day of the month is not available, I would create that same process, but instead give it a message start event. Then, I would create a separate process that runs daily. In this process, I would simply check if the current date is the 10th day of the month. If so, fire a message to kick off that first process. If not, end.

sharepoint 2010 - How to force expiration policy to run everyday for all items on a list

Have on prem SharePoint 2010, setup expiration policy to run every day that triggers a workflow to create tasks and emails based on an alert day in a calculated column in the list. Calculated columns have dates set to 7 days prior to a due date event. Want the expiration policy to evaluate the entire list each day to create notification emails and tasks to the users of the list.
I have been successful in getting the policy to run the workflow every day, but it starts randomly within the window specified. My assumptions: workflow will not run against an item on the list if the “Expiration Date” in less than 24 hours, I cannot modify that column directly, tightening the run window does not force all items to be evaluated every day. Solution needs be done using designer or sharepoint, not custom code.
Does anyone have a workaround to force all items to be evaluated by the “Expiration Policy” every day?
On another issue, how to you force evaluation for items created under 24 hours?
In SP 2010 there are two timer jobs responsible for this task: "Information management policy" job and "Expiration policy". This blog post may give you some more insight. There is also one more important thing: Information management policy should run before Expiration policy.

Auto Daylight Savings Time behavior (isolated system)

First time on SO and I have a question that I'd like to get your guys' opinion on:
I work on isolated machines (linux OS, no network connections) and one of the issues I'm running across is what should happen when the user Enables an auto DST setting that I've made.
Since not all areas observe DST, the settings requires an 'on/off' type of setting. Furthermore, since the start and stop days seem to vary with the whims of politicians, it can be configured with start month/day/(1st,2nd,3rd,4th) along with stop month/day/(1st,2nd,3rd,4th). Yes, I left out '5th' but I don't envision that ever being a start/stop condition. So now the start and stop periods can be defined as flexibly as '1st sunday of march'.
Now the meat of the question: What then should happen when DST is enabled/disabled? I think I would expect it to auto-change the current time if the date & month falls within the DST period. At the same time I have a few users saying that it's a bit strange when the following workflow happens: Set time to 11:00 AM, Set date, Enable DST, time jumps to 12:00PM. Would it make more sense to not change the time upon enable/disable and just wait until the next DST date to correct it?
Looking forward to hearing some opinions :) TIA
I don't know that there's a best choice here. I think it comes down to user preference. Personally I'd probably apply the adjustment when the option is changed, but also try to make the resulting (possible) jump in the time obvious to the user so that if it's not what they expected, they'll know right away that they need to adjust the clock.
Depending on which locales you may need to work with, you should also be aware that not everywhere uses the "first Sunday in March" style for determining when to switch to/from DST. Some places use arbitrary dates hand-picked each year, others may use a specific day of the month. The time of day that the change occurs at varies as well, and some places base their changeover time & date on UTC while others base it on local time. You may need to account for several variations on how the changeover dates are determined unless you're only dealing with a limited set of locations that are more consistent in how they do this.
Even just in Canada, there are places that change at midnight and places that change at 2:00AM, and some that don't change at all.