recurrence

Creating recurring dates in PHP based on current date, and boolean for done or not

Ello, I am struggling with some date troubles here in PHP/MySql. I have a form that offers the recurrence of a payment yearly,quarterly,monthly,bi-weekly,or weekly and I need to be able to track when payments are made. So for example, if something is added on Monday March 8th (that's the date it is being entered), recurring Weekly on T...

How can I compute the number of characters required to turn a string into a palindrome?

I recently found a contest problem that asks you to compute the minimum number of characters that must be inserted (anywhere) in a string to turn it into a palindrome. For example, given the string: "abcbd" we can turn it into a palindrome by inserting just two characters: one after "a" and another after "d": "adbcbda". This seems to b...

Recurrence Relations

I am currently enrolled in a programming class and we are covering recurrence relations. I was just wondering if, ever these actually get used on the job. If so, I'd love to hear some examples of when it is useful. ...

Unix: How to use Bash backticks recursively

Either I missed some backlash or backlashing does not seem to work with too much programmer-quote-looping. $ echo "hello1-`echo hello2-\`echo hello3-\`echo hello4\`\``" hello1-hello2-hello3-echo hello4 Wanted hello1-hello2-hello3-hello4-hello5-hello6-... ...

recurrence solution, too loose a bound?

I have the following worked out: T(n) = T(n - 1) + n = O(n^2) Now when I work this out I find that the bound is very loose. Have I done something wrong or is it just that way? ...

Dot Game and Dynamic Programming

I'm trying to solve a variant of the dot game with dynamic programming. The regular dot game is played with a line of dots. Each player takes either one or two dots at their respective end of the line and the person who is left with no dots to take wins. In this version of the game, each dot has a different value. Each player takes a...

Update Item has Recurrence in SharePoint

Hi all, I had an event list. I created a new item that has recurrence daily ( Start Time : 1/5/2010 12 : 00 AM and End Time : 5/30/2010 12:00 AM). I want to delete the item which has Start Time : 5/12/2010 12:00 AM but my application throwed exception. My code as below : DateTime eventDate = DateTime.Parse(list.Fields.GetFieldByIn...

Finding recurrence relations of an algorithm

I'm reading my algorithms text book, and I'm reading about recurrence relations and finding the algorithms big O complexity. I run across this line "In the case of the merge-sort algorithm, we get the recurrence equation: t(n) = b if n < 2 = 2t(n/2) +bn if n >= 2 for b > 0 my response was "how ...

Outlook.RecurrencePattern to iCal string

Is there an easy way to convert an Outlook.Recurrence object to a recurrence string in iCal format? ...

Recurrence Relation: Finding Big O

Hello, I am trying to find the big O bound for the following recurrence relation: T(n) = T(n-1) + n^c, where c >= 1 is a constant So I've decided to solve this by using iteration: T(n) = T(n-1) + n^c T(n-1) = T(n-2) + (n-1)^c T(n) = T(n-2) + n^c + (n-1)^c T(n-2) = T(n-3) + (n-2)^c T(n) = T(n-3) + n^c + (n-1)^c + (n-2)^c T(n) = T(n-k...

Filtering events with RFC 2445-style recurrence rules by date?

I'm trying to figure out what the best way to find all instances of recurring events in a given date range for a whole set of calendars. Most of the examples I've seen (e.g. Fowler's paper on Temporal Expressions) seem to focus on querying a single event and asking if it's occurring at a certain time, which I'm not sure would work at th...

t-sql recurrency procedure problem

Hi. I have this code: CREATE PROCEDURE AddTask @SessionID uniqueidentifier, @Login nvarchar(max), @Uni nvarchar(max), @Time datetime, @MaxOverviewTime int, @Date datetime, @DoTaskTime int, @Priority int, @TaskID int, @TaskWillBeDoIn datetime output AS BEGIN SET NOCOUNT ON; /*Algorytm 1. Pobranie wszystkich zadań do tymczasowej tabelki ...

What is wrong with my recurrence data string?

Hey guys! I'm trying to create recurrence rule to export my timetable to Google Calendar, but I'm doing something wrong. The string is the following: 'DTSTART;TZID=Europe/London:20100822T080000\r\nRRULE:FREQ=WEEKLY;COUNT=5;BYDAY=Mo,Tu,We,Th,Fr;UNTIL=20100827T164500Z\r\nDTEND;TZID=Europe/London:20100822T180000\r\n' It is working fine i...

3rd <day_of_week> of the Month - MySQL

I'm working on a recurrence application for events. I have a date range of say, January 1 2010 to December 31 2011. I want to return all of the 3rd Thursdays (arbitrary) of the each month, efficiently. I could do this pretty trivially in code, the caveat is that it must be done in a stored procedure. Ultimately I'd want something lik...

Standard Format for Representing Time Recurrence/Schedules?

I'm aware of iCal's RECUR value but I'm not sure how flexible it is. Are there any other formats that can represent arbitrarily complex recurrence schedules? I'd like to use a standard because the component I'm writing is meant to interface with other applications I've written and ideally third party applications. Something like: ...

Writing a recurrence relation for a method

I have a bit of code and need to write a recurrence relation for it. The code simply calculates 2 raised to the nth power. Any help is appreciated. public static int two(int n) { if (n==0) { return 1; } else if (n%2 == 0) { int x = two(n/2); return x*x; } else { return 2 * two(n-1) } ...

Recurrence Relation for a loop

The question is to set up a recurrence relation to find the value given by the algorithm. The answer should be in teta() terms. foo = 0; for int i=1 to n do for j=ceiling(sqrt(i)) to n do for k=1 to ceiling(log(i+j)) do foo++ ...

Recurrence Relation

Hi, everyone I have simple recurrence relation and I need to solve it in teta() terms. (n-1)^2 f(n) = (n-1)(n+1)f(n-1) + (n-3)(n+1)f(n-2) + (n(n-1))/2 That would be great if you can help me out. Thanks ...

Highly scalable db schema for recurring events

Which is the best way to design a db schema in which store hundreds of thousand events, with recurrencies, and that will support milions of query asking which events will occur in a range of dates? I mean, designing the tables to describe the model should be not difficult, but doing that in such a way that the huge amount of data can be...