[sharp-discuss] Patch for error in JavaScript code

Clemens Vonrhein vonrhein@globalphasing.com
Mon, 13 Jan 2003 08:18:27 +0000


--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Dear SHARP users,

a small error got into the latest 3.0.15 release of Sushi (part of the
latest SHARP/autoSHARP release). It will manifest itself in cases
where 

 - you run SHARP through the interface and
 - you are *not* starting from BIG CYCLE 1

Then SHARP will report a read error (because the resulting SIN file
has strings 'undefined' in the STRATEGY card). Please note that this
does not affect autoSHARP or SHARP runs that always start from cycle
1!

It will be fixed in the next SHARP/autoSHARP release. In the meantime,
if you experience that problem please save the attached patch file and
apply it as follows:

  % cd $BDG_home/sushi/base/JavaScript
  % patch -p0 < ~/3.0.15.diff

Sorry about the inconvenience.

Clemens Vonrhein

-- 

***************************************************************
* Clemens Vonrhein, Ph.D.     vonrhein AT GlobalPhasing DOT com
*
*  Global Phasing Ltd.
*  Sheraton House, Castle Park     Tel: +44-(0)1223-353033
*  Cambridge CB3 0AX, UK           Fax: +44-(0)1223-366889
*--------------------------------------------------------------
* BUSTER Development Group      (http://www.globalphasing.com)
***************************************************************

--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="3.0.15.diff"

Index: x_cmd.js
===================================================================
RCS file: /home/somasys/Repository/Sushi/sushi/base/JavaScript/x_cmd.js,v
retrieving revision 1.17.4.6
diff -c -r1.17.4.6 x_cmd.js
*** x_cmd.js	12 Nov 2002 16:21:04 -0000	1.17.4.6
--- x_cmd.js	9 Jan 2003 09:38:04 -0000
***************
*** 341,348 ****
  
    if (top.cmd.mode_refine) {
      if ( top.cmd.SHARP_version_chk200 >= 0 ) {
!       for (i=1;i<top.cmd.big_cycle1;i++) {
! 	eval ("if (top.cmd.strategy_"+i+"== \"\"){top.cmd.strategy_"+i+"=0;};");
        }
        for (i=top.cmd.big_cycle1;i<=top.cmd.big_cycle2;i++) {
  	eval ("top.cmd.strategy_"+i+"=0;");
--- 341,348 ----
  
    if (top.cmd.mode_refine) {
      if ( top.cmd.SHARP_version_chk200 >= 0 ) {
!       for (i=1;i<top.cmd.big_cycle2;i++) {
! 	eval ("if (top.cmd.strategy_"+i+"== \"\"){top.cmd.strategy_"+i+"=top.cmd.strategy_max;};");
        }
        for (i=top.cmd.big_cycle1;i<=top.cmd.big_cycle2;i++) {
  	eval ("top.cmd.strategy_"+i+"=0;");
***************
*** 499,505 ****
      if ( top.cmd.SHARP_version_chk200 >= 0 ) {
        mS ("STRATEGY       ");
        for (i=1;i<=top.cmd.big_cycle2;i++) {
! 	eval("mS(\" \" + top.cmd.strategy_"+i+");");
        }
        mS ("\n");
      }
--- 499,506 ----
      if ( top.cmd.SHARP_version_chk200 >= 0 ) {
        mS ("STRATEGY       ");
        for (i=1;i<=top.cmd.big_cycle2;i++) {
! 	eval ("if (typeof top.cmd.strategy_"+i+"== undefined){top.cmd.strategy_"+i+"=top.cmd.strategy_max;};");
! 	eval ("mS(\" \" + top.cmd.strategy_"+i+");");
        }
        mS ("\n");
      }
Index: x_main.js
===================================================================
RCS file: /home/somasys/Repository/Sushi/sushi/base/JavaScript/x_main.js,v
retrieving revision 1.19.4.5.2.1
diff -c -r1.19.4.5.2.1 x_main.js
*** x_main.js	19 Dec 2002 16:32:37 -0000	1.19.4.5.2.1
--- x_main.js	9 Jan 2003 09:34:15 -0000
***************
*** 1895,1900 ****
--- 1895,1903 ----
  
  	// decompose the bit-representation of the STRATEGY card
  	var strategy_val = eval("top.cmd.strategy_"+i);
+ 	if ( strategy_val > top.cmd.strategy_max ) {
+ 	  top.cmd.strategy_max = strategy_val;
+ 	}
  	var strategy_sav = strategy_val;
  	for (j=8;j>=1;j--) {
  	  pow_2 = Math.pow(2,(j-1));

--2B/JsCI69OhZNC5r--