Month: August 2013

Simple Automation with Quartz.net

Simple Automation with Quartz.net

I’ve found that Quartz offers great flexibility and ease of use when implementing scheduled tasks within an application.

With the release of Quartz 2.0 the code to run jobs has been changed quite drastically. The following is an example that allows a user to start and stop a job manually based on a time frequency in seconds that they set.

private IScheduler _scheduler; private ITrigger _jobTrigger; private IJobDetail _job; private int _timeInterval = 30; public int TimeInterval { get { return _timeInterval; } set { _timeInterval = value;} } internal void InitializeJob() { _job = JobBuilder.Create(typeof(JobQueueJob)) .WithIdentity("JobQueueJob") .Build(); buildTrigger(); } private void buildTrigger() { _jobTrigger = TriggerBuilder.Create() .WithIdentity("JobTrigger") .WithSimpleSchedule(x => x.RepeatForever().WithIntervalInSeconds(_timeInterval)) .StartNow() .Build(); } internal void StartJob() { ISchedulerFactory sf = new StdSchedulerFactory(); _scheduler = sf.GetScheduler(); _scheduler.Start(); buildTrigger(); _scheduler.ScheduleJob(_job, _jobTrigger); } internal void StopJob() { _scheduler.Shutdown(true); }

And the class that implements IJob

public class JobQueueJob : IJob { public void Execute(IJobExecutionContext context) { //Do your thing here } }

Tiger needs to be in the lead to play well

Tiger needs to be in the lead to play well

TigerWoods

History has proven that Tiger Woods does not play well on the weekend at majors if he is not in the lead, or have a share of the lead. There’s a few tournaments that come to mind in the last couple of years that will support my Tiger playing theory.

2012 PGA Championship

Coming into 18 Tiger had a share of the lead with Vijay Singh. On this very windy day Tiger was one of the few players to shoot under par for the round. After the round Keegan Bradley said it was one of the best rounds of golf he had ever seen. Tiger was on the green in 2 on 18 shooting for birdie and the outright lead. The putt lipped out, and left a difficult putt for par. Tiger ending up 3 putting for bogey, and was no longer in the lead. I believe this really bothered Tiger and he was not comfortable after that. He probably didn’t sleep as well, and didn’t have the confidence that a birdie on 18 would have provided.

2013 British Open

Going into 17 Tiger was tied with Lee Westwood at -2. One of the easiest holes on the course, Tiger sent a 3 wood trying to reach the green in 2. His ball found a trap and he ended up bogeying. Westwood makes birdie and goes to -3. Tiger was out of the lead, and out of the final pairing for Sunday. Tiger ended up shooting 4 over on Sunday and missing a few very easy putts. I believe that 3 wood shot on 17 cost him the tournament.

I’ve noticed in tournaments where Tiger doesn’t play well he is usually doing well at some point on Thursday. Maybe a few off the lead and seems to be cruising for a good under par round. Then one shot will go astray, or he’ll get a bad bounce. He may bogey and lose the momentum for the round. I’ve seen Tiger bogey 18 quite a bit in tournaments. This further hurts his confidence and keeps him from his comfort zone when playing with the lead.

Bottom line is that Tiger is different player mentally when he’s winning the tournament, not matter what day it is. Whether it be the middle of the round on Thursday, or trying to come back on Sunday, he simply isn’t the same player.