schedule

Start method at the begin of the month in java

て烟熏妆下的殇ゞ 提交于 2019-12-08 10:13:53
问题 for a school project I have to calculate the 'hotItem' of a shoppingbag (which is the most popular item of that month). But I don't know how to call the method (getHotItem) every first day of the month. I've already did some research and found out about Timer and ScheduleExpressions, but from what I learned it is mostly used for a fixed time interval (which is not the case with months of 30 or 31days) Is there a way to call this method at a specific date in the future(every 1st of the month)?

Java EE-Timer / @Schedule in Websphere Liberty Profile

荒凉一梦 提交于 2019-12-07 05:51:14
问题 I want to use the timer-Service (especially @Schedule Annotation) in WebSphere Liberty Profile. Is that possible? Is there a feature for? https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/8.5.5.0/ is nothing ;–( 回答1: Update: as pointed out this answer is no longer correct since support was added in June 2015. 8.5.5.6 and newer sports ejb timers. There is no support for EJB Timers in the Liberty profile. The infocenter details the supported features and EJB

How to find first free start times from reservations in Postgres

巧了我就是萌 提交于 2019-12-07 04:23:05
问题 People work from 10:00AM to 21:00PM except Sundays and public holidays. Jobs for them are reserved at 15 minute intervals. Job duration is from 15 minutes to 4 hours. Whole job must fit to single day. How to find first nearest free start times which are not reserved for given duration in Postgres 9.3 starting from current date and time ? For example, Mary has already reservation at 12:30 .. 16:00 and John has already reservation at 12:00 to 13:00 Reservat table contains reservations, yksus2

crontab执行身份的小坑

徘徊边缘 提交于 2019-12-06 09:11:49
有个ubuntu服务器,跑着apache, PHP7, Laravel,supervisor。 apache和supervisor都是www-data用户。 平时管理员ssh登上去用的都是devuser用户。 今天发现Laravel日志异常了,连着几天都是只有短短一行日志记录。 新的日志都写不进去。chown 改成 www-data 后日志还是写不进去,见了鬼了。 后来尝试重启 apache, supervisor, PHP7 ,然后重命名掉今天的日志文件,发现新日志终于有了。是正常的 www-data 用户的文件。 怀疑为什么会有 devuser 的日志文件产生: 有人用 devuser 身份 SSH 登进来搞事情。 有什么软件是以 devuser 身份执行了。 我们检查了 apache, supervisor, PHP配置文件, 都是 www-data。百思不得其解。 最后排查到定时任务,才想起来我们使用了 crontab 来重复触发 artisan schedule:run 来执行定时任务。 由于我们使用了 devuser 来配置的 crontab -e,所以执行身份肯定是 devuser。 最后我们将 schedule:run 命令写入了 /etc/crontab 里面,指明用 www-data 执行。 天下太平了。 来源: oschina 链接: https://my

How would you build this daily class schedule?

廉价感情. 提交于 2019-12-06 05:16:48
问题 What I want to do is very simple but I'm trying to find the best or most elegant way to do this. The Rails application I'm building now will have a schedule of daily classes. For each class the fields relevant to this question are: Day of the week Starting time Ending time A single entry could be something such as: day of week: Wednesday starting time: 10:00 am ending time: Noon Also I must mention that it's a bi-lingual Rails 2.2 app and I'm using the native i18n Rails feature. I actually

Java EE 7: Get @Schedule date when is set to persistent = true

冷暖自知 提交于 2019-12-05 10:09:18
In my Java EE 7 application I have created a persistent Schedule task that runs every hour. I have used @Schedule annotation. When this job is called I want to perform some actions on events that have happened from the last hour until NOW. To obtain NOW I use "new Date()". This @Schedule has the default persistent attribute to "true", which is great because if the server stops during hours I want to perform these tasks when it restarts. The problem is that, if the server has been stopped during 5 hours, the job will be launched 5 times, but in all of the executions "new Date()" will be

How to find first free start times from reservations in Postgres

岁酱吖の 提交于 2019-12-05 05:54:58
People work from 10:00AM to 21:00PM except Sundays and public holidays. Jobs for them are reserved at 15 minute intervals. Job duration is from 15 minutes to 4 hours. Whole job must fit to single day. How to find first nearest free start times which are not reserved for given duration in Postgres 9.3 starting from current date and time ? For example, Mary has already reservation at 12:30 .. 16:00 and John has already reservation at 12:00 to 13:00 Reservat table contains reservations, yksus2 table contains workes and pyha table contains public holidays. Table structures are below. Reservat

Gantt chart with D3 [closed]

末鹿安然 提交于 2019-12-04 23:33:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I've been working on a D3 Gantt chart; it has a brush view, column labels for the tree grid view (I need this for my application), and tooltip. The chart allows you to expand and shrink nodes using the tree view, by clicking on the node in the tree hierarchy. With respect to the issues I have encountered, there

How can I schedule an email to be sent at some point in the future in django?

倖福魔咒の 提交于 2019-12-04 17:11:09
I want to schedule an email to be sent to a user upon a specific action. However, if the user takes another action I want to cancel that email and have it not send. How would I do that in django or python? Beanstalkd If you can install beanstalkd and run python script from command line I would use that to schedule emails. With beanstalkc client you can easily accomplish this. On ubuntu you might first need to install: sudo apt-get install python-yaml python-setuptools consumer.py: import beanstalkc def main(): beanstalk = beanstalkc.Connection(host='localhost', port=11300) while True: job =

How to find first free time in reservations table in PostgreSql

∥☆過路亽.° 提交于 2019-12-04 13:04:06
Reservation table contains reservations start dates, start hours and durations. Start hour is by half hour increments in working hours 8:00 .. 18:00 in work days. Duration is also by half hour increments in day. CREATE TABLE reservation ( startdate date not null, -- start date starthour numeric(4,1) not null , -- start hour 8 8.5 9 9.5 .. 16.5 17 17.5 duration Numeric(3,1) not null, -- duration by hours 0.5 1 1.5 .. 9 9.5 10 primary key (startdate, starthour) ); table structure can changed if required. How to find first free half hour in table which is not reserved ? E.q if table contains