![]() |
ACBLmergeACBLmerge is a free (open source) program to merge hand records, double dummy results, and electronic scoring info with ACBLscore output, creating HTML output for websites. |
May 22, 2011: ACBLmerge 1.2.3 is out! This is a minor bug fix release for the 1.2.0 major update that included support for the Bridgemate and BridgePad electronic scoring systems, face view, and the masterpoint tooltip.
Overview
The American Contract Bridge League (ACBL) ACBLscore program is a very old program, originally written for DOS and minimally ported to Windows. It can generate many text based reports which were originally designed to be printed out. The same reports can also be generated in an HTML format. But the HTML generated by ACBLscore is an extremely minimal effort that making no use of the sophisticated document formatting that HTML allows. Instead, it simply uses the <pre> tag to display the results as plain text. In fact the HTML generated by ACBLmerge does not even strictly comply with the HTML standard though it displays in all major browsers due to the nearly universal tolerance for sloppy HTML.
ACBLmerge is a program that generates a richer report, one that makes much better use of the HTML formatting capabilities. It can present each deal next to the results for each board provided an electronic hand record is available. This capability of merging hands and results lends the program its name. Moreover, the program can display double dummy results and HCP totals for each board in a manner similar to the Dealmaster Pro recap sheets. Law of Total Tricks (LoTT) calculations and par results are also displayed. A cut-and-paste aid makes it easy to copy hands into e-mail or other documents. Version 1.1.0 introduced popup recap sheets for each pair. Version 1.2.0 introduced support for reading Bridgemate and BridgePad electronic score results, i.e. the contract and opening lead.
The HTML output format is detailed in the ACBLmerge Report Features document. It is also possible to generate a slight variant of the HTML report customized for the small screen of an iPhone or iPod touch. Such users are automatically redirected to such the customized reported if available when accessing the primary report.
License, supported platforms, and conformance
ACBLmerge is written in Perl and released under the terms of GNU General Public License GPLv3. To compute the double dummy results it uses Bo Haglund’s free double dummy solver, DDS, also released under the GNU Public License, and a command line based front-end called the Double Dummy Driver (DDD) written by P.M. Cronje. DDS is a very efficient solver, requiring about 5 minutes to consider every denomination and seat for a set of 36 hands on a 1.5 GHz Pentium laptop (circa 2004). On a modern quad-core computer the double dummy analysis may take under half a minute.
Perl runs on all major operating systems. The DDS and DDD source code is straight C++ so it should also run under any platform. I compiled it under Windows using the open source GNU g++ 3.4.4 compiler running under the Cygwin environment.
ACBLmerge generates clean HTML that validates as HTML 4.01 Transitional. The appearance has been verified under Firefox 3, IE7, IE8, Safari 3.1, and Google Chrome 4.1. All units are font relative which means the output should scale well if user changes the font size, e.g. via Ctrl+ and Ctrl- in Firefox. HTML appearance is controlled using CSS and may be changed by altering the ACBLmerge.css file.
Send feedback and bug reports to software@lajollabridge.com
Version history
For detailed version information see the Changelog.txt file. The following is a summary of the major changes in recent versions. Versions before the 1.0.6 release are not shown with the exception of the original release.
| Version | Date | Major Changes |
| 1.2.3 ⇓ | 22-May-2011 | Bug fixes. See Changelog for details. |
| 1.2.2 ⇓ | 24-Apr-2011 | Bug fixes. See Changelog for details. |
| 1.2.1 ⇓ | 25-Mar-2011 | Bug fixes. See Changelog for details. |
| 1.2.0 ⇓ | 21-Mar-2011 |
Added ability to include contract and opening lead from Bridgemate and BridgePad electronic scoring equipment. See -b option. Added -fs option for field strength calculation (average and geometric mean of masterpoint holdings of all players). Added -mp option to show player masterpoint holdings via tooltip when mouse pointer is held over a player name. Added -fc option to show player faces (images) via tooltip when mouse pointer is held over a player name. Added reading and writing of double dummy results from/to PBN files in OptimumResultTable. Added Bridgify format to Cut-and-Paste aid to help users who are not given a PBN link or have a broken one because the ACBLmerge user forgot to upload the PBN file. Beta testing by David Kopper of Wichita, KS (Thanks!) |
| 1.1.3 ⇓ | 17-Dec-2010 |
Added :crlf Perl I/O layer for proper handling of files with Windows CR LF line termination when running from Unix. Added -crlf switch to control line termination of output files. Default to http://lajollabridge.com/Software/ACBLmerge/ACBLmergeReport.htm for “Explanation of Features” help link if -hurl switch is not specified. Now only strip path from PDF filename if it is a Windows specific style path; otherwise leave alone anything that could be a valid hyperlink. Added -pbnurl option to link to a PBN file not placed in the same directory as the HTML file on a web server. |
| 1.1.2 ⇓ | 16-Apr-2010 |
Fixed numerous problems with popup recap sheets generated for Howell (one winner) movements by correcting JavaScript code. |
| 1.1.1 | 13-Apr-2010 |
Fixed bugs introduced in version 1.1.0 when multiple CPUs are used to perform double dummy analysis. |
| 1.1.0 | 07-Apr-2010 |
Added popup recap sheets for each pair. Fixed iPhone/iPod specific HTML output when player numbers are not present in ACBLscore output. Fixed “Jump directly to board” links which broke in IE 8 due to a Microsoft issue. Added option to show a table marker (green square) in center of each deal. Added ability to inject custom HTML in the <head> element and at start and end of the <body> element. Placed CSS and JavaScript in separate files (previously embedded in Perl code). |
| 1.0.8 | 04-May-2009 |
Added ability to use multiple CPUs / cores for faster double dummy analysis. Added code to automatically redirect iPhone / iPod users to iPhone / iPod customized HTML output. |
| 1.0.7 | 11-Apr-2010 |
Mostly bug fixes |
| 1.0.6 | 07-Apr-2009 |
Added iPhone / iPod customized HTML output. |
| 1.0.1 | 25-Sep-2008 |
Original release. |
Obtaining the software
ACBLmerge.pl can be downloaded as a zip (for Windows) or gzipped tar (for Unix) archive. Older versions which have a green arrow ⇓ at the right of the version number (above) can be downloaded by clicking on the green arrow.
The archive contains the files listed in the table below.
| Filename | Purpose |
| ACBLmerge.pl | Application file (PERL script) |
| ACBLmerge.js | Application support file (JavaScript) |
| ACBLmerge.css | Application support file (CSS) |
| ACBLmergeAbout.htm | Documentation for ACBLmerge user |
| ACBLmergeLogo.png | Documentation for ACBLmerge user (support file) |
| ACBLmergeReport.htm | Documentation for bridge players |
| ACBLmergeReport.png | Documentation for bridge players (support file) |
| Changelog.txt | Detailed revision history |
| facejson.pl | Server side support file for face view feature |
The first three files are required to run the application. The second pair of files is the documentation for running ACBLmerge, i.e. what you are reading now.
The ACBLmergeReport.png and ACBLmergeLogo.png files explain the ACBLmerge reporting features to bridge players. By default the “Explanation of Features” link in each HTML file created ACBLmerge will point to the copy of these files on the La Jolla Unit website. However, if you wish to keep users on your website, place these two files on your website in the same folder, and link to your website’s copy of ACBLmergeReport.htm from each ACBLmerge generated webpage using the -hurl command line option.
A precompiled version of ddd.exe for Windows can be downloaded from Bo Haglund’s website as a zip file or from the La Jolla bridge website as a zip file. The copy on the La Jolla bridge website is DDS 1.1.9 (2008) linked against DDD 1.0.5; it requires the included cygwin1.dll file to run unless you already have the Cygwin package installed. Note: the latest 2.x.x DDS versions are not compatible with DDD and hence not compatible with ACBLmerge. I am currently working on support for the 2.x.x DDS version.
Setting up the software
On Windows you will need to install the no cost open source Perl interpreter. ActiveState has a good Perl distribution which you can download from their web site. Just double click on the installer (.msi) file and choose the default options. Perl has been included on Apple computers since Max OS X. Some Linux distributions have Perl pre-installed.
- Install Perl.
- Put ACBLmerge.pl, ACBLmerge.css, and ACBLmerge.js together in whatever folder you please.
On Windows, C:\Perl, C:\ACBLmerge, or C:\Program Files\ACBLmerge, or your My Documents folder would all be fine. Windows Vista and Windows 7 make it hard to write directly to C:\Program Files so you may not want to use the C:\Program Files\ACBLmerge location. - Put ddd.exe and cygwin1.dll into a directory which is on the executable search path or just put them in the same directory as the ACBLmerge.pl Perl script.
Note: ACBLmerge will always check the folder it is located in for ddd.exe whether or not that folder is on the search path before trying the search path.
ACBLmerge only requires the threads Perl package for basic operation. This package has been part of the standard Perl installation since 5.6.0. The -b, -fs, and -mp options require additional Perl packages (DBI, DBD::ODBC, LWP::UserAgent, Archive::Lha) and their dependencies. If these packages are not installed, ACBLmerge will try to install them automatically on Windows when needed by invoking the Perl Package Manager (PPM). This has been tested on Window XP only. It might not work on Vista or Windows 7 and in any case will likely require administrator permission. On Unix, you must install the packages yourself — if you are running Unix you probably know how to do this. I could probably automate the process for Ubuntu (Debian) but I am not sure how general that would be for *NIX.
Running the software
Results from ACBLscore and the hand information must be available. The ACBLscore results must be saved in the “traveler format” as a text or HTML file. From within ACBLscore, navigate as follows: Reports (menu) → Recap/Press (menu) → Screen/File (LR) → 8. Press + Recap (traveler format). Alternatively, at the end you can select → 9. Short Press + Recap (traveler format), a slight variant that does not print out the home city for each player and presents the ranks in a more compact form. An example output filename would be 080914A.txt. If there are multiple sections, answer yes to the question, “Include recap for ALL combined sections?” so that player rankings from all sections are included. The output will show the same hands results multiple times but that will not affect the ACBLmerge program.
ACBLmerge aims to support output from the current version of ACBLscore. There is no specification for the ACBLscore output and thus the reporting format is may change at any time. ACBLmerge may support older ACBLscore output but testing will be limited. In general club owners should frequently update ACBLscore since masterpoint formulas, allowed event formats, and other details are regularly updated. Check for the latest version on the ACBL website.
The hand record information must be in Duplimate, Portable Bridge Notation (PBN), or GIB format. If you use Dealmaster Pro to generate the hands, you can save them from Dealmaster Pro in either Duplimate or PBN format. My recommendation is to give the output file the same name but with a different file extension, e.g. 080914A.dup, 080914A.pbn, or 080914A.gib. ACBLmerge can not read Dealmaster Pro PDF files because PDF is a documentation oriented format rather than a data interchange format.
Once you have both files available, start a DOS shell (on Windows) or the shell of your choice (on Unix / Mac). On Windows XP you can start a DOS shell via Start (menu) → Programs → Accessories → Command Prompt; or more simply via Start (menu) → Run, type cmd, and press <enter>. On Windows 7 (and probably Vista), Microsoft has gone to more trouble to hide the “scary” DOS shell and even the Run Box. See this explanation of how to get the Run Box to appear.
Once you have the DOS or Unix shell, type something like the following, first switching to the directory containing your files and then running Perl to invoke ACBLmerge.pl:
For XP: cd C:\Documents and Settings\username\My Documents (or wherever you have placed the files)
For Win7 / Vista: cd C:\Users\username\Documents (or wherever you have placed the files)
perl ACBLmerge.pl
perl C:\ACBLmerge\ACBLmerge.pl (if ACBLmerge.pl is in the C:\ACBLmerge folder)
perl -S ACBLmerge.pl (finds ACBLmerge.pl if it is on the system path)
Invoking ACBLmerge without any command arguments will display the full list of available command line switches. Next try something more useful, for example:
perl ACBLmerge.pl -h 080914A.dup -g -p -o -dd -t "Sep 14, 2008 Unit Game" -hurl "/software/ACBLmerge/ACBLmergeReport.htm"
This will use the Duplimate file 080914A.dup as the source of the hand records. Since the -r switch is missing, the ACBLscore results file will be assumed to be named 080914A.txt and to exist in the same directory as the 080914A.dup file. The -o switch will set the HTML output to default to 080914A.htm. The -p and -g switches will cause the PBN and GIB output to be generated as 080914A.pbn and 080914A.gib respectively and a links will be included in the HTML output to the PBN and GIB files on the expectation that they will be placed on your website in the same location as your HTML output. The -dd switch causes double dummy analysis to be performed. The -t switch sets the title of the output web page. And the -hurl switch set the location of the ACBLmerge Report webpage on your website.
If you want to specify the various filenames exactly, you could instead use a command like this one below:
perl ACBLmerge.pl -h 080914A.dup -r 080914A.htm -g Sep14.gib -p Sep14.pbn -o Sep14.htm -dd -t "Sep 14, 2008 Unit Game"
Only the -h switch is required. However, you will almost always want the -o switch because otherwise the output HTML will be sent to the screen, i.e. STDOUT. Most users will also want the -dd switch because the makeable contracts, LoTT calculation, and par contract can only be generated when double dummy results are available. If -t is not specified, the date will be determined from the ACBLscore output and the web page title will default to "Mmm DD, YYYY Game Result". In this example the -hurl switch has been removed; therefore the “Explanation of Report Features” link in the output HTML will link to the explanation on the La Jolla Bridge Unit website.
If the output HTML filename will have the name as the input file (regardless of case), the input file will be renamed first, e.g. to 080914A.orig.htm, to prevent the original file from being clobbered.
If you have a PDF hand record available, for example from Dealmaster Pro, a link can be added to the PDF file with the -pdf switch. Also, separate HTML tailored for the small screen of an Apple iPhone or iPod touch can be generated using the -iphone switch. When a web user views a page from an iPhone or iPod touch, the user will automatically be redirected to the iPhone customized webpage if it has been generated. After these options are included the first example becomes:
perl ACBLmerge.pl -h 080914A.dup -g -p -o -dd -pdf -iphone -t "Sep 14, 2008 Unit Game" -hurl "/software/ACBLmerge/ACBLmergeReport.htm"
For any switch which requires a filename to perform its function, you can specify a full (or relative) file path, as is typical for a command line based program. But if you do not specify a filename, ACBLmerge will automatically generate one based on the full filename of either the hand file or the ACBLscore results file by changing the file extension. This can save a lot of typing. The following table lists which filename each switch bases its automatic name generation on and the extension it is changed to.
| Switch | Base filename | New extension | Use |
| -r | Hand filename | .txt and .htm (checks for both) | Input file |
| -g | Hand filename | .gib | Input or Output file |
| -p | Hand filename | .pbn | Input or Output file |
| Hand filename | Input file | ||
| -b | Results filename | .bws | Input file |
| -o | Results filename | .htm | Output file |
| -iphone | Results filename | .htm | Output file |
| -txt | Results filename | .txt | Output file |
| -fc | Results filename | .ACM/.ACA/.ACE/.ACL* | Input file |
| -fs | Results filename | .ACM/.ACA/.ACE/.ACL* | Input file |
| -mp | Results filename | .ACM/.ACA/.ACE/.ACL* | Input file |
Note that this behavior cascades, i.e. if the -r switch is specified without a filename, then all the filenames automatically generated from the Results filename are effectively generated from the Hand filename.
*The treatment of the ACBLscore game file filename is a bit more complex. ACBLscore game files have a different extension depending on the session: morning (.ACM), afternoon (.ACA), evening (.ACE), and late (.ACL). This is a poor programming practice, but ACBLmerge must deal with it. If your Results filename follows the standard naming convention generated by ACBLscore, e.g. 110214A.txt, ACBLmerge will use the A (or E, M, L) to automatically generate 110214.ACA. If a valid letter is not find, ACBLmerge will exit with an error. Moreover, if the automatically generated game file is not found in the same directory as the Results file, ACBLmerge will also look in C:\ACBLSCOR\GAMEFILE, the ACBLscore’s default installation directory, if running on Windows.
If running on Unix, do not forget that the Unix filesystem is case sensitive. If ACBLmerge is not finding files that you expect it find automatically, check the case of the file extension.
Uploading ACBLmerge output to your website
Minimally, you need to upload the HTML output to your website. If you have generated the iPhone customized HTML, don’t forget to upload that too. If your hand record input was in PBN or GIB format and/or you generated those formats using the -p or -g switches, upload those files too; otherwise you will have broken PBN and/or GIB links near the top of the HTML report. Finally, you should upload the .txt and .pdf files if you used the -txt or -pdf switches.
It is unnecessary to upload the DUP, BWS, or ACBLscore game files.
Important: ACBLmerge assumes that you will be uploading all the files in the same folder on your website regardless of where they were on your filesystem when you ran ACBLmerge. By default ACBLmerge strips the file path from the related files before creating the links. For the PBN link you can override this behavior with the -pbnurl switch to explicitly give the URL (relative or absolute) of the corresponding PBN file. For the PDF file you can override this behavior by specifying a URL for the -pdf switch. In this case, ACBLmerge will not check if the PDF file exists; instead it will simply assume the user is going to place it on the website where indicated.
Including Bridgemate or BridgePad electronic scoring results
The Bridgemate and BridgePad electronic scoring systems capture the contract and optionally the opening lead. The electronic scoring results are captured in a file with the .bws extension, e.g. 080914A.bws. The contract and opening lead information can be included in the ACBLmerge report by specifying the BWS file using the -b switch, for example:perl ACBLmerge.pl -h 080914A.dup -b -g -p -o -dd -t "Sep 14, 2008 Unit Game"
This functionality has been tested for Bridgemate devices only. I would appreciate any feedback on its behavior for either Bridgemate or BridgePad devices. So far as I know, the electronic scoring output format is not documented. However, the file appears to be in an old version of the Microsoft JET database format, the internal format used by Microsoft Access. If you have Microsoft Access, you can change the .bws file extension to .mdb open it, and poke around. It is straightforward to read the relevant tables using ODBC and the “Microsoft Access Driver(*.mdb)” that ships with XP, Vista, and Windows 7.
Unfortunately, this functionality is limited to Windows. Microsoft’s ODBC has been ported to Unix but I am unaware of any Unix ODBC driver for JET databases.
Decorative Features
The -tm (table marker) switch adds a green marker to the center of each deal. This is purely decorative. Long heart or diamond suits in the West hand will overlap the table marker. Although this could be avoided by widening the hand layout area, it seems preferable to conserve screen real estate for the board results.
Taking Advantage of Multiple CPUs/Cores
On computers with multiple CPUs or multiple cores on one or more CPUs, e.g. an Intel Core 2 Duo computer, the -c option can be used to specify how many concurrent ddd.exe executables are spawned to perform double dummy analysis. Specifying a higher number than the actual number of cores will not speed up the processing and instead will actually slow it down very slightly. On Windows, each additional ddd.exe executable requires ~25 MB (Peak Private Bytes). Most computers should easily have enough memory to run as many executables as necessary to use all CPUs/cores; however if memory is tight, memory swapping may occur in which case the number of CPUs/cores used should be reduced. When memory is not a problem, all CPUs should be steadily pegged at nearly 100% utilization during the double dummy analysis. Below is a command line example appropriate for a duo core computer.
perl ACBLmerge.pl -h 080914A.dup -r 080914A.htm -g Sep14.gib -p Sep14.pbn -o Sep14.htm -dd -t "Sep 14, 2008 Unit Game" -hurl "/software/ACBLmerge/ACBLmergeReport.htm" -c 2
Reusing Double-Dummy Analysis for Multiple Events
If computed, or available from the input PBN or GIB file, double dummy results will be written to the output PBN and GIB files when the -p or -g switches respectively are specified. When several games are played with the same set of hands, the double dummy results may be reused from the PBN or GIB file to very quickly generate results for other games. This is particularly useful for Sectional, Regional, and National tournaments, but relevant even to large clubs running multiple games simultaneously. An example is shown below.
perl ACBLmerge.pl -h 090409A.dup -r 090409A_open.txt -g -p -o -dd -pdf -iphone -t "Thu Afternoon Open Pairs" -pbnevt "Thu Afternoon Pairs" -hurl "/software/ACBLmerge/ACBLmergeReport.htm"
perl ACBLmerge.pl -h 090409A.gib -r 090409A_299er.txt -g -p -o -dd -pdf -iphone -t "Thu Afternoon 299er Pairs" -pbnevt "Thu Afternoon Pairs" -hurl "/software/ACBLmerge/ACBLmergeReport.htm"
Here the results files are explicitly given as 090409A_open.txt and 090409A_299er.txt because there is a separate result from each game even though they use the same set of hands stored in 090409A.dup. In the second command, 090409A.gib, generated by the first command, is used instead of 090409A.dup to avoid the need to recompute the double dummy results (the -dd switch is still necessary to have the double dummy results included in the HTML output).
Also note the use of the -pbnevt switch. Normally the Event information recorded in the PBN file, e.g. [Event "Friday Morning Open Pairs"], is automatically taken from the Event> field of the ACBLscore report. But in the case where multiple events use the same boards, it is preferable to override this behavior, e.g. setting it to "Friday Morning Pairs", dropping "Open" since the boards apply to all morning events. Though not essential, this practice is more precise, avoiding potential confusion when say a player looking at the PBN file linked from the 299er pairs sees "Open Pairs" in the PBN file.
Note: Dealmaster Pro stores double dummy results to PBN or GIB files when asked to perform double dummy calculations. However, in its default mode, it only computes double dummy results for “likely” contracts and writes partially erroneous double dummy information. ACBLmerge will detect this situation and recompute the double dummy results. If you have used the -p and/or -g switch, you can avoid this a second time by feeding the PBN or GIB file created by ACBLmerge into the next event that uses the same hands.
Computing the field strength and displaying masterpoint totals
The -fs switch will compute the field strength in two ways, as the average of each player’s masterpoint total and as the geometric mean of each player’s masterpoint total. In a geometric mean, the mean is taken in a logarithmic manner. For example, the geometric mean of two players with 10 and 1000 MP respectively is 100 MP, rather than 505 MP. Less experienced players drag down the geometric mean more than the arithmetic mean. A field with a high geometric mean should in principle be uniformly tough and offer few gifts. I have argued that geometric mean is probably more meaningful, at least for the distribution of players at tournaments.
The -mp switch adds a “tooltip” display of each player’s approximate masterpoint total when the mouse pointer is held over the player’s name at the top section of the HTML report.
Both the -fs and -mp switch require an ACBLscore game file in order to read the player numbers which ACBLscore dropped from its reports sometime in 2009. If a filename is not specified, ACBLmerge will automatically generate a filename based on the results filename. For example, if the results file is 110214A.txt, ACBLmerge will use the A (or E, M, L) to automatically generate 110214.ACA. If the automatically generated game file is not found in the same directory as the Results file and you are running on Windows, ACBLmerge will also look in C:\ACBLSCOR\GAMEFILE, ACBLscore’s default installation directory.
The -fs and -mp switches require the ACBL Club Update database. If you are connected to the internet, ACBLmerge will automatically download the file. It will also automatically download an update if you have a previous month’s database and are running ACBLmerge after the 10th of the month (updates usually appear on the 7th of the month). If you already have an older copy of the database and ACBLmerge is unable to download an update, it will use the older copy.
Face View
The -fc switch adds a “tooltip” image for each player who has an image stored on your web server. This is intended to show faces though any image can be used. The -fc switch may be used in conjunction with the -mp switch. The -fc switch requires an ACBLscore game file in order to read the player numbers since the player numbers are used as the retrieve the images from your server. The advantage of using player numbers rather than names is that they are unique and permanent for ACBL members.
In order to support face view, you must perform several steps on your web server.- Create a folder on your server for the player images. The recommended location is /images/faces
Upload player images in the JPEG image format where the filename matches the player’s all numeric ACBL player numbers, e.g. 1182730.jpg. To convert a life master’s player number to an all numeric player number change J → 1, K → 2, etc. A reference table is provided below. If your web server is configured to be case sensitive, be sure to use a lowercase .jpg file extension. Do not use .jpeg.
J → 1 M → 4 P → 7 K → 2 N → 5 Q → 8 L → 3 O → 6 R → 9 The images may be any size and do not all need to the same size. My recommendation is to use roughly 150 x 150 pixel images so they contain good detail but still load quickly from your server. You may add or delete images from the server folder at any time without performing any extra steps. Also the folder may contain other images or files if desired (e.g. an alternative image); the ACBLmerge software will only look for those matching #######.jpg, ignoring all others.
- If you use a folder other than /images/faces, edit facejson.pl, changing the value of my $FACE_DIR. It is also possible that you will have to hard code the value of my $INTERNAL_FACE_DIR instead of using the value derived from $FACE_DIR.
- Upload facejson.pl to /cgi-bin on your server. Make sure it is executable by your web server, e.g. on a Unix based web server, you probably want to run chmod 744 facejson.pl
Test facejson.pl by typing http://yourdomain/cgi-bin/facejson.pl in your web browser. If you do this in Firefox, Google Chrome, or Safari, you should see something like the following where the player numbers are sorted:
[ "/images/faces/", [ 1015621, 1137379, … ] ]
If you do this in Internet Explorer, you will be prompted to download the data to a file and the file data should look like the above, but without any spaces.
When face view is selected, the JavaScript embedded in the ACBLmerge output makes an initial JSON request to the server to obtain the location of the player image folder and a list of ACBL player numbers for players with images. This technique eliminates requests for player images that do not exist on your server and avoids unnecessary 404 errors in your web server error logs.
If your web server does not support Perl or you wish to use an alternative server side solution such as PHP, you must recode the simple functionality provided by facejson.pl in the language of your choice and then change var FACEJSON in ACBLmerge.js to your alternate JSON provider. Important: the player numbers must be sorted in your JSON output because the client side JavaScript uses a binary search to maintain good performance even when there are a large number of available images.
Advanced Features
In order to integrate ACBLmerge output seamlessly into a sophisticated website you may wish to add a common header image, menubar, footer, or other features. ACBLmerge provides the -ih (insert head), -isb (insert start body), and -ieb (insert end body) switches for inserting content from user supplied files directly into the ACBLmerge HTML output just before the </head> tag, just after the <body> tag, and just before the </body> tag respectively. The following code is a simple example that might be included with the -isb switch to add a club banner at the top of each results page
<img src="/images/banner.jpg" width="800" height="80" alt="club banner" />
ACBLmerge does not perform any validation on user supplied HTML. Therefore, users should be sure to validate the combined result using a web service such as Total Validator or a dedicated application such as the excellent CSE HTML Validator which I found very useful for the development of ACBLmerge.
Sophisticated users who wish to alter aspects of the ACBLmerge appearance but do not wish to directly alter the ACBLmerge.css file can simply override the CSS as appropriate by using the -ih option.
Line Termination
ACBLmerge uses the :crlf Perl I/O layer to ensure that any input files with Windows style line termination (CR LF) will be correctly handled when running on Unix. By default, output files will be created using the line termination of the OS that the application is run on. However, the -crlf option can be used to force the use of Windows style line termination for all text based output files.
User Application Folder
The masterpoint database (see Computing the field strength) and intermediate files used during the double dummy calculation are stored in a per user application specific folder. This ensures the user can create/update these files even if the user only has read permission on the ACBLmerge application folder, the one containing ACBLmerge.pl and its support files.
On Windows, the application folder is %APPDATA%\ACBLmerge, e.g. C:\Documents and Settings\username\Application Data\ACBLmerge on Windows XP. On other platforms it is ~/.ACBLmerge, a hidden folder in the user’s home directory.
If ACBLmerge can not create the application folder when needed, it will exit with an error.
Command Line Help
Command line arguments in [ ] are optional. Strictly speaking only the -h handfname option is required, though you will almost certainly want the -o option.
Usage: ACBLmerge.pl -h handfname [-r resfname] [-b bwsfname]
[-o [outfname]] [-g [gibfname]] [-p [pbnfname]] [-pdf [pdffname]]
[-txt [txtfname]] [-dd] [-t title] [-iphone] [-pbnevt event_name]
[-hurl URL] [-tm] [-c #] [-fs [gamefname]] [-mp [gamefname]]
[-fc [gamefname]] [-v] [-q] [-crlf] [-pbnurl url] [-ih headfname]
[-isb sbdyfname] [-ieb ebdyname]
handfname : Hand record filename (Duplimate, PBN, or GIB format)
resfname : ACBLscore results filename. Default extension is .txt
Can also read HTML files generated by ACBLscore.
bwsfname : Bridgemate / BridgePad filename. Default extension is .bws
outfname : HTML output filename. If the -o option is not specified,
output is sent to STDOUT. Default file extension is .htm
gibfname : Write hands in Goren in a Box (GIB) library format. If -dd is
also specified, GIB file will contain the makeable contracts.
Default file extension is .gib
pbnfname : Write hands in Portable Bridge Notation (PBN) format. Default
file extension is .pbn
pdffname : Specifies filename or URL for PDF hyperlink in output HTML.
Typically this target would be PDF file produced by Dealmaster
Pro for printing paper copies of the hand records.
txtfname : Specifies filename for plaintext output (sometimes desired if
original ACBLscore output was in HTML)
gamefname : ACBLscore game filename. Required for field strength (-fs)
option and masterpoint (-mp) tooltip display option
If a filename is not supplied for any of the -r, -g, -p, or -pdf switches
the filename is automatically generated by changing the file extension of the
full filename of the hand record filename, i.e. .dup/.pbn/.gib --> .txt/.htm
(tries both), .gib, .pbn, or .pdf respectively.
If a filename is not supplied for any of the -b, -txt, -o, -iphone, -fs,
or -mp switches, the filename is automatically generated by changing the
file extension of the full filename of the ACBLscore results filename, i.e.
.txt/.htm --> .bws, .txt, .htm, .htm, .ACA/.ACE/.ACM/.ACL (last two)
respectively.
headfname : Optional HTML file to insert in the \lt;head> element of the
output. Code is added after ACBLmerge \lt;head> content.
sbdyfname : Optional HTML file to insert at the start of the \lt;body>
element; for example to include a menu bar.
ebdyfname : Optional HTML file to insert at the end of the \lt;body>
element; for example to include contact information.
Options
-dd - Include double dummy makes, par contract, and LoTT statistics
-t - Specify title of HTML output. If not specified, the title
defaults to "Mmm DD, YYYY Game Result" where the date is
derived from the DATE> header of the ACBLscore file.
-iphone - Create additional output HTML file for viewing on the iPhone.
-pbnevt - Defines Event Name to be used in PBN output. If not specified
PBN output uses the Event Name from the ACBLscore results file.
-hurl - Specify URL that explains feature of ACBLmerge.pl output
This is used to create a link at the top of the HTML output.
Example: -hurl "/software/ACBLmergeReport.htm". Defaults to
http://lajollabridge.com/Software/ACBLmerge/ACBLmergeReport.htm
if -hurl is not specified. Use -nohurl to eliminate help link.
-pbnurl - Specify URL to PBN file (only required if PBN file will not be
placed in same directory as HTML output file on the web server)
-fs - Include field strength calculation
-mp - Include player masterpoints (hovering tooltip over player names)
-fc - Show players faces (hovering toolip over player names)
-tm - Include table marker in the center of each hand.
-crlf - Write Win32 style newlines (CR LF) even when running on Unix.
-c - Specify number of CPUs (cores) to use for double dummy analysis.
-q - Quiet mode. Do not print any informative messages to STDERR.
-v - Print program version on STDERR (overrides -q)
Note: for clarity the -ih, -isb, -ieb options have the alternate long
forms of -ihead, -isbody, and -iebody.
Produces HTML output that merges bridge hands with ACBLscore text results,
and optionally the contract and/or opening lead information from the
Bridgemate or BridgePad electronic scoring systems. Hands may be supplied
in Duplimate format (.dup), PBN, or GIB (Goren in a Box) library format.
The GIB format can store double dummy results. The ACBLscore results need
to be saved in the "traveler format". From ACBLscore navigate Report (menu)
--> Recap/Press (menu) --> Screen/File (LR) --> 8. Press + Recap
(traveler format). Or alternatively 9. Short Press + Recap (traveler format).
The report may be saved in either text or HTML format.
The HTML output includes advanced clipboard copy features and the HCP count
for each board. For each board, the pairs are sorted by N-S matchpoints.
If double dummy analysis is performed, makeable contracts (+number of tricks
for every contract), the par contract, and a LoTT calculation will also be
shown. Hands may also be output in Portable Bridge Notation (PBN) format
for trick by trick double dummy analysis in programs such as Bridgify and
the Bridge Captain Double Dummy Solver (both free).
Example: perl ACBLmerge.pl -h 080914A.dup -r -dd -o -p
The input files are 080914A.dup and 080914A.txt (the ACBLscore filename
080914A.txt is implicitly assumed here because it is required but was not
supplied). Likewise, the HTML output will default to 080914A.htm since the
-o switch has no argument. The -dd switch specifies that double dummy
analysis will be performed. The PBN output will default to 080914A.pbn.
No GIB output will be generated since the -g is missing.
Web based documentation is at:
http://www.lajollabridge.com/Software/ACBLmerge/ACBLmergeAbout.htm
