topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 9:25 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Calendar Math, which language to use?  (Read 14020 times)

vixay

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 140
  • ViXaY
    • View Profile
    • Donate to Member
Calendar Math, which language to use?
« on: December 23, 2008, 10:52 PM »
Hey all,

 I have a curious problem, and i was wondering if you have any insight on how this can be solved.

We have a rule at our office to have every 1st and 3rd saturday off for each month. And occasionally i need to do some arbitrary calendar math as well. I was wondering if there's any software out there (or a scripting language) that has excellent support for this? For example... If I should type

Print (1st Saturday of each month in 2009)
output: 2009-01-03, 2009-02-07 ...etc.
or calendar output: Show the calendar with all the selected dates circled/highlighted.

Select (Last Weekend (Sat & sun) of each month in 2009)


...etc.

Have any of you come across any such program, scripting language ...etc? That makes calendar/date manipulation easY? As a bonus if it could display calendars with the operations it would be great!
"Drunk on the Nectar of Life!" -me

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #1 on: December 24, 2008, 04:54 AM »
Wow quite a challenge! I wonder if something will turn up, and how much it will cost  :o

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #2 on: December 24, 2008, 08:23 AM »
You'll definitely want something with decent calendar support (which rules JAVA out, imho :P) - and involving a scripting language (for easily and rapidly updating calendar rules without having to re-build the app) sounds like a really good idea. Personally I'd start by looking a bit at JavaScript, since it's one of those things I haven't gotten around to using yet. I know it has date routines, but dunno how easy they are to use.

I assume your target OS is Windows, and Windows comes with a calendar control by default. it's not superfancy (it's the same you get when you doubleclick the clock in the tray notification area), but at least it's somewhere to start.
- carpe noctem

kovi2

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 32
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #3 on: December 24, 2008, 05:08 PM »
Would a webservice or a webpage be useful for you? In the next weeks I'm planning to start my page with some interesting features. This could be one of them.

Btw. your questions can easily be answered with Mathematica (maybe not a usual choice for this, but I do almost everything in Mathematica :))
Eg. the first one: {{2009,1,3},{2009,2,7},{2009,3,7},{2009,4,4},{2009,5,2},{2009,6,6},{2009,7,4},{2009,8,1},{2009,9,5},{2009,10,3},{2009,11,7},{2009,12,5}}

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #4 on: December 24, 2008, 06:00 PM »
If your company has a server with PHP, you can set up iZeit as you please

http://www.izeit.nu/
http://www.izeit.nu/features

Repeating events

Similar to Microsoft Outlook, each event can be assigned an interval with which it recurs. Extensive patterns are available, allowing you to set an item to recur on the nth day of each month, every other thursday, or virtually any other conceivable pattern.
-iZeit
Edited:
free, but donations are asked for.
« Last Edit: December 24, 2008, 06:06 PM by Curt »

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #5 on: December 24, 2008, 06:39 PM »
Thanks for pointing out izeit, curt. It might be just the thing I have been looking for to use for my club; atm we use google calendar and old software from the 90s which are aggregated into yet another static calendar. Very complicated very messy.

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #6 on: December 24, 2008, 07:16 PM »
- you're of course welcome.

@ housetier, you might want to know that there is a microscopic problem with the coding of your otherwise very fine pages  versus  the translating service you are using. You are using ISO 8859-1, but the service is using UTF-8, which means that I can never see both parts properly. Either your characters are displayed correctly, and their wrongly, or vice versa.

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #7 on: December 24, 2008, 07:21 PM »
This wouldn't be something relatively straightforward in Excel with a little VBA?

vixay

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 140
  • ViXaY
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #8 on: December 25, 2008, 12:09 AM »
Would a webservice or a webpage be useful for you? In the next weeks I'm planning to start my page with some interesting features. This could be one of them.

Btw. your questions can easily be answered with Mathematica (maybe not a usual choice for this, but I do almost everything in Mathematica :))
Eg. the first one: {{2009,1,3},{2009,2,7},{2009,3,7},{2009,4,4},{2009,5,2},{2009,6,6},{2009,7,4},{2009,8,1},{2009,9,5},{2009,10,3},{2009,11,7},{2009,12,5}}

Hmmm... that sounds great... how did you propose the question to mathematica? Will i have to learn a specialized syntax? Can you show the example above...
also can it output a calendar with the dates highlighted?

Izeit, sounds interesting let's take a look.

I think in excel and vba, it would be hard to design an input language for dates... and allow for all possibilities... but you are welcome to try.

Even thought of AHK, but no clear idea there either.

But thanks for the great suggestions guys.... one important thing is the ease of use as well, since this isn't a frequent operation....


"Drunk on the Nectar of Life!" -me

vixay

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 140
  • ViXaY
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #9 on: December 25, 2008, 03:40 AM »
I checked out iZeist and it does seem to work well... I used the demo, and that's great for trying it out temporarily... and the whole calendar display also works fabulously. You just have to create a new event for each calculation :)

Check out the screenshots of the various operations they support

2008-12-25_162728.png
2008-12-25_162741.png
2008-12-25_162757.png
2008-12-25_162807.png

BUT the output is limited only to GUI (i.e. display),
How to get other output? I guess you could export it to iCal format ...etc.!

I'm still open to other command line based or other options.
"Drunk on the Nectar of Life!" -me
« Last Edit: December 25, 2008, 03:42 AM by vixay »

kovi2

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 32
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #10 on: December 25, 2008, 06:49 AM »
Hmmm... that sounds great... how did you propose the question to mathematica? Will i have to learn a specialized syntax? Can you show the example above...
also can it output a calendar with the dates highlighted?
The syntax would be easy: you want to have the first Sats from each month, you can use SelectDays[2009, {Saturday}, 1] or the one before the last one then SelectDays[2009, {Saturday}, -2] (as such -1 means the last one). The calendar output can also be solvable as my time permits. But I see iZeist could better be your choice.

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #11 on: December 25, 2008, 07:02 AM »
@ housetier, you might want to know that there is a problem with the coding of your pages  versus the translating service you are using. You are using ISO 8859-1, but the service is using UTF-8, which means that I can never see both parts properly.

I didn't know we had a translation service... but I'll forward it to our webmasters. thanks.

vixay

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 140
  • ViXaY
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #12 on: December 25, 2008, 09:53 PM »
Hmmm... that sounds great... how did you propose the question to mathematica? Will i have to learn a specialized syntax? Can you show the example above...
also can it output a calendar with the dates highlighted?
The syntax would be easy: you want to have the first Sats from each month, you can use SelectDays[2009, {Saturday}, 1] or the one before the last one then SelectDays[2009, {Saturday}, -2] (as such -1 means the last one). The calendar output can also be solvable as my time permits. But I see iZeist could better be your choice.

You know this is very close to the question I'd proposed in the first post. So it does seem good. I also recently saw some article about mathematica's awesome image processing capabilities so maybe this is a worthwhile tool to have around... i'll have to check it out. Thanks for the info, and let me know if you come across the calendar output.

/EDIT

I checked it out, mathematica retails for $1,750, so it's not a good idea unless you already have access to it . However it does have a  Free Mathematica player, maybe if you create a "notebook" we can play with it in the player? I don't know how it really works. But apparently you can publish apps in it.


"Drunk on the Nectar of Life!" -me
« Last Edit: December 25, 2008, 10:35 PM by vixay »

kovi2

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 32
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #13 on: December 26, 2008, 02:07 AM »
You know this is very close to the question I'd proposed in the first post. So it does seem good. I also recently saw some article about mathematica's awesome image processing capabilities so maybe this is a worthwhile tool to have around... i'll have to check it out. Thanks for the info, and let me know if you come across the calendar output.
OK, I will.
I checked it out, mathematica retails for $1,750, so it's not a good idea unless you already have access to it . However it does have a  Free Mathematica player, maybe if you create a "notebook" we can play with it in the player? I don't know how it really works. But apparently you can publish apps in it.
Yes, unfortunately it's not among the cheapest software. If you saw it somewhere for $1,750, that's still not bad since in their own online store it would be $2,495... (Fortunately I manged to get it few years before for the fraction of the original price, and since I just keep it upgraded as I use it for work.)

My first idea was to put a solution to a webMathematica-driven website where either some GUI would be implemented or a webservice (SOAP) could provide the requested information. But yes, you are right, I could create a small application which you can use with the free Player as well.

kovi2

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 32
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #14 on: December 26, 2008, 04:13 PM »
So I can imagine something similar.
calendar.png

jeromg

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #15 on: December 26, 2008, 04:45 PM »
Well, not sure if it can fill all your needs, but the best tool for calendar manipulation imho is remind (open source) that you can find at http://www.roaringpe....com/products/remind.
It's not a scripting language on its own, but it can do pretty much anything (including user defined functions) as far as dates and reminders manipulation. It has a steep learning curve though :\

The best introduction to remind can be found here: http://www.roaringpe...oad/remind-oclug.pdf

It can generate calendars in postscript or html.

Cheers  /jerome
« Last Edit: December 26, 2008, 04:51 PM by jeromg »

vixay

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 140
  • ViXaY
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #16 on: December 26, 2008, 08:36 PM »
looked at remind. compiled and ran for cygwin. You are right, it is a bit complex to use, still the more you know the better?

kovi2 the output looks great, but as i suspected if you write an app it will work only in limited circumstances (currently have slider only for saturdays), but never mind. I think izeit will have to do for now. Thanks a lot guys. You were great!
:)
"Drunk on the Nectar of Life!" -me

kovi2

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 32
    • View Profile
    • Donate to Member
Re: Calendar Math, which language to use?
« Reply #17 on: December 27, 2008, 07:41 AM »
Yes, that often happens when one to make a GUI for a multi-purpose function. Unfortunately for the Player it's necessary since the free Player does not allow explicit inputs. So my last offer in this theme is something like
calendar2.png
and of course the already seen calendar view can be inserted as well. If it's still not flexible enough then you really should try iZeit, I agree... ;)