Tag Archives: MEEPME

Storing recurring events in a database

One problem that seems to affect many web developers (and desktop programmers as well) is how to store recurring events in a database. There are several ways to do this, all with varying degrees of complexity (both inserting and selecting), storage requirements, and requirements on the type of recurrences. These can all be found by googling, and most are language agnostic in their implementations.  In my case, I needed to store events that could have a very complex set of requirements. Some examples:

  • Weekly on Thursday and Friday forever
  • Once a month on Friday for 6 months
  • Every other Friday
  • Every third Friday of the month

Also, it needed to be able to handle exceptions and extensions to existing recurring events, and the events could not be purely virtualized instances, since other objects would references event id numbers as a way of collating data collected. After all this, a set of three tables seems appropriate, with Event, EventModel, and EventException objects.  Each Event is an instantized version of EventModel, and once instantized will remain forever in the database.  While this is not best practice, negative infinity in our case is relatively manageable for now.  In the future, implicit grouping of data according to a index-less key may be used.  EventModel, which contains all the attributes of a single event, plus meta data relating to recurrences acts as a prototype event for recurring events.  To normalize the data a bit, even non-recurring events will be stored as EventModels.  This will aid in data manipulation later.  The EventException object belongs to a third table, which stores individual event exceptions.

In practice, a daily cron script will create events for that day based upon the rules in EventModels.

When viewing events, the easiest way is to view EventModels, with sub-grouping of recent and upcoming events associated with that EventModel.

 

Of course, I’m not an actual programmer or computer scientist, so suggestions are welcome.

MEEPME at Blarney

Aside from some technical glitches and miscommunication, tonight went pretty well for MEEPME.  Almost a hundred people signed up, and everyone seemed to have a fun time playing around with it.  We got to demo our new AJAXified text feed, and other than a screensaver problem and a video cable problem, it worked great all night.  We could even update the page in real time since the AJAX reloaded the contents every .5 seconds.  I have no idea how much load this was actually putting on the server, but hopefully this should hold together until the next major revision.  The first priority is now to finish the admin backend.

PennApps in Summary

Wow, what a trip.  When Matt contacted me a week before the competition to ask if I had a team yet, I had no idea we would get this far.

Timeline

  • Thursday, before competition – Meet up with Matt, go over idea, get introduced to Twilio API
  • Friday, 6pm – Watch intros, get theme, meet the team (Fred and Vincent), then leave to go DJ
  • Saturday, 10am – arrive to start coding, hungover.
  • Saturday, 1pm – basic ideas and framework fleshed out
  • Saturday, 10pm – so many bugs!
  • Saturday, midnight – start website component
  • Sunday, 4am – mostly done, still fixing bugs
  • Sunday, 10am – nap on hammock
  • Sunday, noon – demo to judges individually
  • Sunday, 2pm – demo for 2.5 minutes in front of audience
  • Sunday, 4pm – MEEPME announced as Grand Prize winner!
  • Monday, 4pm – start social media blitz for Student Choice Award
  • Following Monday, 12:15am – MEEPME wins Student Choice Award!

Next stop: Wharton Business Plan Competition and Philly Startup Weekend!

Media

httpv://www.youtube.com/watch?v=nnyaOXn_HY4
httpv://www.youtube.com/watch?v=W4DGTf0fvRQ