Home > Domino Tips > Administrator > A fun site, with serious code
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEB

A fun site, with serious code


Chuck Connell
04.20.2005
Rating: -2.57- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Many sites out there ask you to submit pictures of yourself so other readers can vote on how good-looking you are. Last year I created a Domino Web site using the same general concept, only applied to how bad-behaving your boss is. You can use my site, called MyBossIsWorseThanYours.com, to relate something obnoxious your boss did, and ask other readers to vote on how obnoxious it was. The goal, of course, is to submit the "worst boss" story.

To create a story on the site, press the red link on the upper-left part of the screen. You can judge someone else's story by using the three Vote buttons to rate each story on outrageousness, humor and perceived truthfulness.

Besides getting a kick out of the site, you may also find the underlying code useful for a more serious Web application. The two main design challenges I faced were how to conduct the voting and how to handle the browser windows. (This tip will explain the voting code. A future tip will look at the window issue.)

The voting code had to meet four requirements:

  • Votes had to be submitted and stored anonymously, since the application is open to anyone on the Internet.
  • Each vote had to identify the story it concerned.
  • The tabulation code had to deal with the possibility of a large number of votes coming in very quickly.
  • I needed to keep a record of all votes, even after they were tabulated, so I could verify that the correct tallies were displayed for each story.
To meet these requirements, the voting design includes:
  • A "story ID" that is uniquely generated for each story, as it is composed. You can see these IDs at the bottom of each story.
  • A set of three vote forms, one each for outrageousnes, humor and truthfulness. The forms create separate documents in the database to record each vote. The vote forms inherit the story ID of the currently displayed story, so that a vote document captures which story was being read when the vote was cast.
  • Two views that hold the vote documents. One of the views shows all votes; the other shows votes that have not yet been tallied.
  • A periodic agent, called Tally Votes, which examines pending votes and enters them into the story totals. After recording a vote, the agent marks the vote document as "tallied" so that the vote is not counted again.

The periodic agent is well-documented and readable, but there is one wrinkle. Each story must contain not only the current average of the three kinds of votes, but also the number of votes recorded of each type. The reason is that each vote carries less weight as more votes come in. For each new vote, the new average is not based just on the old average plus the new vote. The new average is based on the old average, the new vote, and how many total votes have been cast.

I have posted the source code for this application on my Downloads page. As you look at the code, be sure to look at the views Admin/Controls and Admin/Development Info views. The first allows you to adjust various setup parameters; the second contains other information for programmers. Feel free to use/modify the code, as long as you credit me for the original design. The default ACL for the downloadable version is set to Manager, so it is easy to examine. Before using the database in production, you should change the default ACL so it matches the Anonymous ACL. The database uses R5 design.

Please let me know about any bugs or suggestions for improvement.

Chuck Connell is president of CHC-3 Consulting, which helps organizations with all aspects of Domino and Notes.


Do you have comments on this tip? Let us know.

Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Domino
How to upgrade to Lotus Notes 8 and retain Lotus Notes 7
Five Domino domain default server settings you should change and why
How DirLint verifies data in Lotus Notes Domino 8 directories
An introduction to Lotus Notes password options and essentials
Tivoli Directory Integrator synchronizes Notes Domino 8 directories
Setting up RSS feeds in Lotus Notes Domino 8
Secure Lotus Notes 8 with the Internet password lockout feature
Troubleshoot Lotus Notes Out of Office (OOO) agent error messages
A batch file for Lotus Notes Domino maintenance on Windows Server 2003
Avoid Lotus Notes Domino email archiving ACL issues with AdminP

Web
How to create a dynamic SVG graph using a Lotus Notes agent
Hosting multiple Lotus Domino servers at one IP address without a VPN
Upgrading and patching Firefox: Security considerations for administrators
Admin2005 Learning Guides
Making old, new flavors of Domino SSO work
Creating corporate welcome pages with Lotus Notes
Domino Web traffic analyzers
LotusScript error detection on the Web
One URL for all Webmail
Reasons to chat-enable your web site

Lotus Notes Domino Administration
How to convert Lotus Notes documents to .PDF files
A Domino Domain Monitoring primer
Getting up to speed on Notes/Domino administration
Daylight Saving Time 2007 -- seven helpful tips for Lotus Notes administrators
Our experts' favorite freeware tools for Lotus Notes and Domino
Separating a Lotus Notes network into two Notes Named Networks
IBM will add social networking tools for business
Lotusphere 2007 refocuses on users
Top 10 Notes/Domino administration tips of 2006
Managing Lotus Notes and Domino users and groups -- 10 tips in 10 minutes

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts