system
January 13, 2011, 11:45pm
21
(imported comment written by SystemAdmin)
JackCoates
holiday awareness is a big deal in maintenance windows and other service management type activities…
We should probably start a new thread on that topic. I can see maybe copying a text file containing the holidays of the calendar year to determine if the maintenance window should be opened or closed. Actually calculating the holiday dates would probably be CPU intensive (like Easter).
BenKus
January 14, 2011, 2:03am
22
(imported comment written by BenKus)
Winner? 72 characters!
(now+(if it=0 then 7 else it)*day)of((Thursday-current day_of_week)/day)
Ben
system
January 14, 2011, 2:26am
23
(imported comment written by JackCoates91)
fine, if you’re gonna take spaces out… 72 characters for me too
it whose(it as string starts with “Th”)of(now+it*day)of integers in(1,7)
BenKus
January 14, 2011, 3:56am
24
(imported comment written by BenKus)
Fine… How about this (43 characters)…
now+(Wednesday-(current day_of_week))+1*day
Elegant. Simple. Beautiful?
Ben
system
January 14, 2011, 4:52am
25
(imported comment written by SystemAdmin)
For what it’s worth…
Ben’s relevance does seem to evaluate a tad faster (.088ms to .100ms) than Jack (.099ms to .114ms)
However Jack’s relevance is easier to read.
Prior to Ben’s recent posting in the last 10 seconds… This would have been shorter at 70 characters…
it whose(it as string starts with “Th”)of(now+it*day)of(1;2;3;4;5;6;7)
Ben’s could be reduced as 41 as…
now+(Wednesday-(current day_of_week))+day
(I feel like a caddy for this game of golf)
system
January 14, 2011, 4:13am
26
(imported comment written by JackCoates91)
alright Ben, that’s pretty cool.