changeset 3790:1e0d844b8f54

[project @ 2001-02-09 04:12:54 by jwe]
author jwe
date Fri, 09 Feb 2001 04:13:58 +0000
parents 2a257be5e488
children c1c532a0acb2
files scripts/ChangeLog scripts/strings/patch
diffstat 2 files changed, 10 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Fri Feb 09 04:12:31 2001 +0000
+++ b/scripts/ChangeLog	Fri Feb 09 04:13:58 2001 +0000
@@ -1,3 +1,13 @@
+2001-02-08  Paul Kienzle  <pkienzle@kienzle.powernet.co.uk>
+
+	* strings/dec2base.m: New file.
+	* strings/base2dec.m: New file.
+	* strings/strjust.m: New file.
+	* strings/dec2hex.m: Replace with version that just calls 2dec2base.
+	* strings/dec2bin.m: Likewise.
+	* strings/hex2dec.m: Replace with version that just calls base2dec.
+	* strings/bin2dec.m: Likewise.
+
 2001-02-07  David Livings <david.livings@asa.co.uk>
 
 	* statistics/base/ppplot.m: Use gset, not set.
--- a/scripts/strings/patch	Fri Feb 09 04:12:31 2001 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-*** strrep.m-2.1.28	Tue May  2 01:39:24 2000
---- strrep.m	Fri May 12 08:21:15 2000
-***************
-*** 45,70 ****
-      t = s;
-      return;
-    endif
-    ind = findstr (s, x, 0);
-!   len = length (ind);
-!   if (len == 0)
-      t = s;
-!   else
-!     save_empty_list_elements_ok = empty_list_elements_ok;
-!     unwind_protect
-!       empty_list_elements_ok = 1;
-!       l_x = length (x);
-!       tmp = s (1 : ind (1) - 1);
-!       t = strcat (tmp, y);
-!       for k = 1 : len - 1
-!         tmp = s (ind (k) + l_x : ind (k+1) - 1);
-!         t = strcat (t, tmp, y);
-!       endfor
-!       tmp = s (ind(len) + l_x : length (s));
-!       t = [t, tmp];
-!     unwind_protect_cleanup
-!       empty_list_elements_ok = save_empty_list_elements_ok;
-!     end_unwind_protect
-    endif
-  
-  endfunction
---- 45,94 ----
-      t = s;
-      return;
-    endif
-+ 
-    ind = findstr (s, x, 0);
-!   if (length(ind) == 0)
-      t = s;
-! 
-!   elseif (length(y) > 0)      # replacement
-!     ## Copy the parts of s that aren't being replaced.  This is done
-!     ## with an index vector, with jumps where each search string
-!     ## is found.  For a jump of 0 (target length == replacement length)
-!     ## the index is just cumsum ( ones (length (s))).  For non-zero
-!     ## jumps, add the jump size to the ones vector at each found position.
-!     jump = length(y) - length(x);
-!     if (jump > 0)     # s expands
-!       di = ones(size(s));
-!       di (ind) = 1 + jump * ones (length (ind), 1);
-!       t (cumsum (di)) = s;
-!       if (size(s,1) == 1)
-! 	t = t';
-!       endif
-!     elseif (jump < 0) # s contracts
-!       di = ones (jump * length (ind) + length (s), 1);
-!       di (ind + jump * [0:length(ind)-1]) = 1 - jump * ones(length(ind), 1);
-!       t = s (cumsum (di));
-!     else              # s stays the same length
-!       t = s;
-!     endif
-! 
-!     ## Now, substitute a copy of the replacement string whereever the
-!     ## search string was found.  Note that we must first update the
-!     ## target positions to account for any expansion or contraction
-!     ## of s that may have occurred.
-!     ind = ind + jump * [ 0 : length (ind) - 1 ];
-!     repeat = [1 : length (y)]' * ones (1, length (ind));
-!     dest = ones (length (y), 1) * ind + repeat - 1;
-!     t (dest) = y (repeat);
-! 
-!   else                        # deletion
-!     ## Build an index vector of all locations where the target was found
-!     ## in the search string, and zap them. 
-!     t = toascii(s);
-!     repeat = [1 : length (x)]' * ones (1, length (ind));
-!     delete = ones (length (x), 1) * ind + repeat - 1;
-!     t (delete) = [];
-!     t = setstr(t);
-    endif
-  
-  endfunction