Shamash, The Jewish Network Hebrew College     TES Ad
   Shamash Home  °    About  °   Create a list  °   Help  °   Mailing Lists  °   Jewish News  °   Links  °   Search  °   Staff  
   Kosher Database  °   Tanach/Bible  °   Holocaust  °   Jewish Books  °   Israel  °   Software/Graphics  °   Donate  

Mishloach Manot Manager
Download: mmm-3.1.tar.gz or mmm-3.1.zip

MISHLOACH MANOT MANAGER

Author:  Art Werschulz (agw STRUDEL comcast.net)
Date:    6 February 2004
Version: 3.1

# Copyright (c) 1993, 2000, 2001, 2003, 2004 by Arthur G. Werschulz.
# May be freely redistributed.  
# Send me mail if you like it or if you have any improvements.


Introduction
============

Our shul Sisterhood has a Mishloach Manot project.  People in the shul
send in lists of people to whom they'd like to send shlach manos, with
an indication as to whether they want to reciprocate.  At Purim, lo
and behold!  Baskets appear, one per family, with a piece of paper
attached to each basket, said note giving the name of the recipient
family, along with a list of those sending shlach manos to said
family.

The reciprocation wrinkle: Suppose Reuven says he'll reciprocate.  If
Shimon sends to Reuven, but Reuven didn't originally send to Shimon,
then Reuven will automatically send to Shimon.  (Since we charge for
each shlach manot sent, reciprocating increases the amount earned by
the shul.)

I have written some software to do this.  The name of the program is
"mmm", for "Mishloach Manot Manager".  It's inelegant, but it gets the
job done.  If you want to suggest improvements, feel free.


History
=======

The original version was a bash script, originally written in 1993.
Since this version could only run under UNIX (or on a non-UNIX machine
having access to certain UNIX utilities), I decided to rewrite it in
Perl in 2000.  Rather than maintaining both bash and Perl versions, I
have decided to abandon the bash version.

The main advantage of the Perl version over the original version is
that free versions of Perl are available on non-UNIX platforms (such
as Macintosh or Windows).  I mainly wrote this version because people
kept asking for a non-UNIX version.  I have tested it (on the sample
data file data.input) on several Unix platforms (RedHat Linux,
Solaris, and MacOS X), as well as on one Macintosh (Beige Power
Macinstosh G3 266MHz running MacOS 9, with MacPerl 5 [version
5.2.0r4]).  Please note that it has not been tested on any Windows
machines.


Invoking mmm
======== ===

You invoke mmm via the command line.  You can specify any of the
following command-line options: 
  -r: produce a recipient list
  -t: produce a TeX basket-tag list 
  -h: print brief usage message and exit
The order in which they are specified does not matter.  Any other
option is an error. 

You may also specify one input data file to be processed.  It must
have the extension "input"; however, this extension need not be
mentioned on the command line.  If you do not specify an input data
file, mmm will assume that your data file is named "data.input".
Specifying more than one data file is an error.

So, the following are legitimate uses of mmm:

  mmm
  mmm mordechai
  mmm -r
  mmm -t
  mmm -r -t purim


Input file format
===== ==== ======

The input file consists of records of the form: 

  sender reciprocating_flag name name name 

where the sender is the sender, the reciprocating_flag is either "t"
or "f", and the remainder of the line is the list of names the sender
is sending to.  Said record can extend over as many lines as
necessary.  Records are separated by blank lines.  If you have several
families named Schwartz, use Schwartz_A and Schwartz_C (or
Schwartz_Ari and Schwartz_Chana) to distinguish between two Schwartz
families.  That is, the underscore is used to separate the last name
and first name.  Note that this program does not (yet) handle surnames
with embedded blanks, such as "van Beethoven".

A couple of suggestions:

(1) If you're making TeX basket tags (see below), you should use "\&"
    instead of "&".  Thus, the name would be "Schwartz_Ari\&Chana".

(2) Be *very* careful to ensure that the input file conforms to this
    format.  If the input file does not adhere to the standards, mmm
    will most likely run to completion, but the results will be
    erroneous.  See the section below on "Pitfalls" for common
    errors. 


Files produced by mmm
===== ======== == ===

mmm always produces a file 
  data.rawtags (or somethingelse.rawtags)
of raw tags.

If the -r option is selected, it also produces a file
  data.reciplist (or somethingelse.reciplist)
of recipients.  It also produces a cleaned-up version
  data.clean-reciplist (or somethingelse.clean-reciplist)
of the recipient list.

If the -t option is selected, it also produces
  data-basket.tex (or somethingelse-basket.tex),
which can be used by the TeX typesetting program to make pretty tags
to attach to each basket. 

Now, for a description of these files.

Each line of the raw tag file is a raw basket tag, having the form
  recipient sender1 sender2 ...  
This is useful for archival purposes.  It is also useful for automatic
postprocessing into usable tags that can be attached to each basket.

The recipient file contains lines of the form 
  sender name1 name2 ...
Each line consists of input data (excluding the reciprocating_flag),
but also contains names of additional recipients that arise because
the sender has magnanimously agreed to reciprocate.  Again, this file
is mainly useful for archival purposes.

The cleaned-up version of the recipient list consists of a packet
(containing one or more pages) for each giver.  Each giver's packet
contains his name, whether he is reciprocating, and an alphabetized
list of all people to whom he is giving.  This packet can be sent to
the giver next year, to let her know all the people to whom she gave
in the previous year.  This will make it easier for the giver to
decide on next year's recipients.  Moreover, since the giver will
presumably only be submitting changes to the previous year's list of
recipients, it also makes life easier for whoever is doing the data
entry.

The TeX basket tag file is a (plain) TeX input file for producing nicely
formatted basket tags.  Names of the form "Schwartz_A" are turned into
"Schwartz, A" in this file, which makes for nicer basket tags.

  Note: TeX is freely available on many platforms.  However if you
  don't already know something about TeX, it will probably take a lot
  of effort to learn how to install and use same.  

You may note that the TeX file inputs a file named mmm-basket-macros.tex. 
Among other things, this does the layout of the tags.  Note the following:

(1) It has been customized to work to format the basket tags in the
    way our shul wants them done.  Note that this is a landscape
    layout.

(2) It assumes that a PostScript printer is available, and that you
    want to use the Zapf Chancery Medium Italic font to print the tags.

If any of these assumptions don't hold, you should ask somebody who
knows a bit about TeX macros to edit the material between
  % Pick a nice-looking font at a nice magnification
and
  % most of this stuff deals with making two-column output
(Perhaps the simplest thing would be to delete this span of lines
entirely.) 


Pitfalls
========

A word of advice: be meticulously careful in preparing the input
file.  Typical errors include the following:

(*) forgetting the "t" or "f" after the sender's name,

(*) misspelled names,

(*) using a blank instead of an underscore in names such as "Schwartz_B",

(*) forgetting to leave a blank line between records.

The program does not deal gracefully with input errors.  In
particular, the program will generally run to completion when given
faulty input; of course, the results of the program will then be
erroneous. 


bagz: an auxiliary program
====  == ========= =======

I have added a new program, called "bagz", that computes various bag
statistics.  It will tell you
(*)    how many recipients got gifts from 1, 2, ... people
(*)    how many givers bought 1, 2, ... bags,
as well as how many small, medium, and large bags were ordered.
The default small/medium cutoff is 5 givers; the default medium/large
cutoff is 10 givers.

You invoke bagz from the command line, as
   bagz [-h] [-s cutoff] [-m cutoff] [inputFileRoot]
bagz needs the files inputFileRoot.rawtags and inputFileRoot.reciplist
in order to run. Note that you must have previously run 
"mmm -r [inputFile]" 
to create the latter.

bagz produces a report inputFileRoot.bagz, telling you:
   how many recipients got gifts from 1, 2, ... people
   how many givers bought 1, 2, ... bags 
   how many bags are small, medium, or large

If no inputFileRoot is specified, "data" is assumed.

Valid options for bagz are as follows:

  -h: print a help message
  -s: max number of recipients for this bag to be considered "small"
  -m: max number of recipients for this bag to be considered "medium"';


Contents of the MMM package
======== == === === =======

The package consists of the following:

  README                  this file
  bagz                    Perl program to obtain various bag statistics
  data.input              sample input file
  mmm                     the main mmm program (written in Perl)
  mmm-basket-macros.tex   plain TeX macros for producing basket tags

Good luck, and enjoy.  Let me know if you have any suggestions.


Art Werschulz (8-{)}   
agw STRUDEL comcast.net (I hate spam; change STRUDEL to an "at-sign")
(908) 272-1146


Mishloach Manot Manager
Download: mmm-3.1.tar.gz or mmm-3.1.zip

SHAMASH
Donate to Shamash with PayPal!
Tax Deductible
[ Search | Help ]

Copyright © 1990-2008 Shamash: The Jewish Network. All rights reserved.
http://shamash.org