scheduling

How do I keep a Perl script running on Unix after I log off?

南笙酒味 提交于 2020-01-01 19:26:06
问题 I have a script that takes a lot of time to complete. Instead of waiting for it to finish, I'd rather just log out and retrieve its output later on. I've tried; at -m -t 03030205 -f /path/to/./thescript.pl nohup /path/to/./thescript.pl & And I have also verified that the processes actually exist with ps and at -l depending on which scheduling syntax i used. Both these processes die when I exit out of the shell. Is there a way to keep a script from terminating when I close the connection? We

How to schedule a Callable to run on a specific time?

断了今生、忘了曾经 提交于 2020-01-01 17:51:08
问题 I need to run a callable at a specific time of day. One way to do it is to calculate the timediff between now and the desired time , and to use the executor.scheduleAtFixedRate . Have a better idea? executor.scheduleAtFixedRate(command, TIMEDIFF(now,run_time), period, TimeUnit.SECONDS)) 回答1: For this kind of thing, just go ahead and install Quartz. EJB has some support for this kind of thing but really you just want Quartz for scheduled tasks. That being said, if you insist on doing it

How to schedule a Callable to run on a specific time?

烈酒焚心 提交于 2020-01-01 17:50:09
问题 I need to run a callable at a specific time of day. One way to do it is to calculate the timediff between now and the desired time , and to use the executor.scheduleAtFixedRate . Have a better idea? executor.scheduleAtFixedRate(command, TIMEDIFF(now,run_time), period, TimeUnit.SECONDS)) 回答1: For this kind of thing, just go ahead and install Quartz. EJB has some support for this kind of thing but really you just want Quartz for scheduled tasks. That being said, if you insist on doing it

Class Scheduling algorithm to show best match with criteria?

百般思念 提交于 2020-01-01 07:06:10
问题 I am looking to create a system where you can input the courses (3-7 courses) that you want to take at a college and then select preferences (Morning, Day, Evening, Night / M, T, W, TR, F). I need a way so that when the program queries the database (MySQL) it returns the best possible schedule that was made according to those parameters. I am writing it in php. Does any one know the best way to do this? Or a link to some sample code I could understand it from? 回答1: It's NP-complete. If you

Class Scheduling algorithm to show best match with criteria?

冷暖自知 提交于 2020-01-01 07:05:11
问题 I am looking to create a system where you can input the courses (3-7 courses) that you want to take at a college and then select preferences (Morning, Day, Evening, Night / M, T, W, TR, F). I need a way so that when the program queries the database (MySQL) it returns the best possible schedule that was made according to those parameters. I am writing it in php. Does any one know the best way to do this? Or a link to some sample code I could understand it from? 回答1: It's NP-complete. If you

What is voluntary preemption?

佐手、 提交于 2020-01-01 05:25:29
问题 What is voluntary preemption? I only know that it's a concept in scheduling. 回答1: It depends a little bit on the OS. In some RTOS, voluntary preemption means that the running process declares points where it can be preempted (where otherwise it would run until completion). Another way to think of this variant is that of a yield in a coroutine . This is in contrast to most desktop OS where the kernel determines preemption. Keep in mind that some RTOS do not have the concept of a "user mode".

What's the best way to implement a scheduled job using a windows service

限于喜欢 提交于 2019-12-31 03:25:07
问题 I have a database job that runs occasionally at night and I need a windows service to poll the database regularly to do some more work after the SQL job is done. I am a looking for a solid example to write a scheduler that can fail gracefully without crashing the service. 回答1: Take a look at http://codeplex.com/TaskService 回答2: Just make it a scheduled task. See windows service vs scheduled task 回答3: I would use MSMQ, add a final step to the job that adds a message to the queue (Via ActiveX

Checking if new interval overlaps - MySQL (or PHP)

折月煮酒 提交于 2019-12-30 23:28:39
问题 I've been thinking on how I can simplify the problem presented here. Complex MySQL Query - Checking for overlapping DATE intervals At it's heart, minus all the fancy magic with DATES this is simply a problem of checking for overlapping intervals. After all dates can be thought of as numbers and it may make the logic easier. Imagine the following table: Schedules schedule_id | start | end 1 | 1 | 3 2 | 4 | 7 3 | 8 | 13 4 | 15 | 16 5 | 18 | 24 6 | 25 | 28 I'm trying to insert a new interval

Checking if new interval overlaps - MySQL (or PHP)

最后都变了- 提交于 2019-12-30 23:27:13
问题 I've been thinking on how I can simplify the problem presented here. Complex MySQL Query - Checking for overlapping DATE intervals At it's heart, minus all the fancy magic with DATES this is simply a problem of checking for overlapping intervals. After all dates can be thought of as numbers and it may make the logic easier. Imagine the following table: Schedules schedule_id | start | end 1 | 1 | 3 2 | 4 | 7 3 | 8 | 13 4 | 15 | 16 5 | 18 | 24 6 | 25 | 28 I'm trying to insert a new interval

What are the better (pseudo) random number generator than the LCG for lottery scheduler?

戏子无情 提交于 2019-12-30 03:34:07
问题 I want to design a lottery scheduler and I need to have a very good (pseudo) random number generator similar to LCG but I was wondering if there are other better choice out there or not? I am specifically looking for random generators written in C. LCG code: unsigned long lcg_rand(unsigned long a) { return (a * 279470273UL) % 4294967291UL; } Also I would like to know if srand() can be used for this purpose or is not highly accurate? 回答1: If you need simple but decent quality, I would use the