[LON-CAPA-cvs] cvs: loncom / lonr /homework lonr.pm
www
www@source.lon-capa.org
Sat, 18 Apr 2009 16:03:17 -0000
www Sat Apr 18 16:03:17 2009 EDT
Modified files:
/loncom lonr
/loncom/homework lonr.pm
Log:
Improved blacklist
Modified sync: R turns long integers into scientific notation
Index: loncom/lonr
diff -u loncom/lonr:1.3 loncom/lonr:1.4
--- loncom/lonr:1.3 Fri Apr 17 01:00:10 2009
+++ loncom/lonr Sat Apr 18 16:03:14 2009
@@ -3,7 +3,7 @@
# The LearningOnline Network with CAPA
# Connect to R CAS
#
-# $Id: lonr,v 1.3 2009/04/17 01:00:10 www Exp $
+# $Id: lonr,v 1.4 2009/04/18 16:03:14 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -316,7 +316,7 @@
sub sync {
my ($command)=@_;
$counter++;
- my $expect=$counter.time;
+ my $expect=$counter;
print $command "$expect;\n";
while (1) {
my $output=&getroutput($command);
@@ -352,7 +352,7 @@
foreach my $line (split(/\n/,$output)) {
$line=~s/\s$//gs;
if ($line=~/^Error\:/) { $syntaxerr=1; next; }
- if (my ($result)=($line=~/^\[\d+\,*\]\s*(.*)/)) { $realoutput.=$result."\n"; }
+ if (my ($result)=($line=~/^\[?\d+\,*\]?\s*(.*)/)) { $realoutput.=$result."\n"; }
}
if (wantarray) {
return ($realoutput,$syntaxerr);
Index: loncom/homework/lonr.pm
diff -u loncom/homework/lonr.pm:1.2 loncom/homework/lonr.pm:1.3
--- loncom/homework/lonr.pm:1.2 Sat Apr 18 13:18:58 2009
+++ loncom/homework/lonr.pm Sat Apr 18 16:03:17 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Interface routines to R CAS
#
-# $Id: lonr.pm,v 1.2 2009/04/18 13:18:58 www Exp $
+# $Id: lonr.pm,v 1.3 2009/04/18 16:03:17 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,11 +61,13 @@
sub blacklisted {
my ($cmd)=@_;
foreach my $forbidden (
- 'read\.table','scan','plot','X11','windows','quartz',
+ 'read','write','scan','save','socket','connections',
+ 'open','close',
+ 'plot','X11','windows','quartz',
'postscript','pdf','png','jpeg',
'dev\.list','dev\.next','dev\.prev','dev\.set',
- 'dev\.off','dev\.copy','dev\.print','graphics\.off',
- 'library','package','source','sink','objects'
+ 'dev\.off','dev\.copy','dev\.print','graphics',
+ 'library','package','source','sink','objects',
) {
if ($cmd=~/$forbidden/s) { return 1; }
}