From f319bf06d72d135e7ec14ff8b27627187f5e2595 Mon Sep 17 00:00:00 2001 From: minima Date: Sat, 28 Apr 2001 20:29:06 +0000 Subject: [PATCH] add another java client fix a problem with 'sorry connected to another ...' --- Changes | 2 + perl/IntMsg.pm | 4 +- perl/yesterday | 41 ++ spider-web/Format.class | Bin 0 -> 8079 bytes spider-web/Format.java | 550 ++++++++++++++++++++++++ spider-web/InfoDialog.class | Bin 0 -> 1401 bytes spider-web/InfoDialog.java | 38 ++ spider-web/IntTextField.java | 36 ++ spider-web/MultiLineLabel.class | Bin 0 -> 3052 bytes spider-web/MultiLineLabel.java | 111 +++++ spider-web/PersonalPreferences.java | 45 ++ spider-web/README | 37 ++ spider-web/StreamListener.class | Bin 0 -> 825 bytes spider-web/beam.class | Bin 0 -> 1570 bytes spider-web/beam.java | 41 ++ spider-web/dxannounce.class | Bin 0 -> 1967 bytes spider-web/dxannounce.java | 67 +++ spider-web/idleTime.class | Bin 0 -> 931 bytes spider-web/makefile | 7 + spider-web/setDate.class | Bin 0 -> 660 bytes spider-web/spider.cgi | 79 ++++ spider-web/spiderclient.class | Bin 0 -> 2607 bytes spider-web/spiderclient.java | 117 +++++ spider-web/spiderframe.class | Bin 0 -> 12496 bytes spider-web/spiderframe.java | 644 ++++++++++++++++++++++++++++ 25 files changed, 1817 insertions(+), 2 deletions(-) create mode 100755 perl/yesterday create mode 100644 spider-web/Format.class create mode 100755 spider-web/Format.java create mode 100644 spider-web/InfoDialog.class create mode 100755 spider-web/InfoDialog.java create mode 100755 spider-web/IntTextField.java create mode 100644 spider-web/MultiLineLabel.class create mode 100755 spider-web/MultiLineLabel.java create mode 100755 spider-web/PersonalPreferences.java create mode 100644 spider-web/README create mode 100644 spider-web/StreamListener.class create mode 100644 spider-web/beam.class create mode 100755 spider-web/beam.java create mode 100644 spider-web/dxannounce.class create mode 100755 spider-web/dxannounce.java create mode 100644 spider-web/idleTime.class create mode 100644 spider-web/makefile create mode 100644 spider-web/setDate.class create mode 100755 spider-web/spider.cgi create mode 100644 spider-web/spiderclient.class create mode 100755 spider-web/spiderclient.java create mode 100644 spider-web/spiderframe.class create mode 100755 spider-web/spiderframe.java diff --git a/Changes b/Changes index b33f106c..a32d1bed 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +28Apr01======================================================================= +1. fix an occasional problem with 'sorry connected to' messages 23Apr01======================================================================= 1. fix very long standing bug in storing and transmitting spots. The decimal point was left off :-( diff --git a/perl/IntMsg.pm b/perl/IntMsg.pm index 6e588b3e..e3360fdb 100644 --- a/perl/IntMsg.pm +++ b/perl/IntMsg.pm @@ -27,7 +27,7 @@ sub dequeue { my $conn = shift; - if ($conn->{msg} =~ /\n/) { + if ($conn && $conn->{msg} =~ /\n/) { my @lines = split /\r?\n/, $conn->{msg}; if ($conn->{msg} =~ /\n$/) { delete $conn->{msg}; @@ -41,7 +41,7 @@ sub dequeue } else { $_ = ''; } - &{$conn->{rproc}}($conn, $_); + &{$conn->{rproc}}($conn, $_) if exists $conn->{rproc}; } } } diff --git a/perl/yesterday b/perl/yesterday new file mode 100755 index 00000000..050f1948 --- /dev/null +++ b/perl/yesterday @@ -0,0 +1,41 @@ +#!/usr/bin/perl +# +# find files that were last modified 'yesterday' +# + +use strict; +my $debug = shift if $ARGV[0] eq '-x'; +my $dir = shift or die "yesterday: [-x] []"; +my $days = shift or 1; +opendir D, $dir or die "cannot open directory '$dir' $!"; +my @fn = map {[(stat("$dir/$_"))[9], "$dir/$_"]} readdir D; +closedir D; + +++$days; +my $t = time; +my $low = (int($t / 86400) - $days) * 86400; +my $high = (int($t / 86400) - ($days - 1)) * 86400; +my $clow = gmtime $low; +my $chigh = gmtime $high; +print "lowest: $clow highest: $chigh\n" if $debug; +for (sort {$a->[0] <=> $b->[0]} @fn) { + if (-f $_->[1]) { + if ($debug) { + my $cmtime = gmtime $_->[0]; + if ($_->[0] < $low) { + printf "%-30s LOW $cmtime < $clow\n", $_->[1]; + } elsif ($_->[0] >= $high) { + printf "%-30s HIGH $cmtime >= $chigh\n", $_->[1]; + } else { + printf "%-30s OK $cmtime\n", $_->[1]; + } + } elsif ($_->[0] >= $low && $_->[0] < $high) { + print "$_->[1]\n"; + } elsif ($_->[0] >= $high) { + last; + } + } +} + + +exit 0; diff --git a/spider-web/Format.class b/spider-web/Format.class new file mode 100644 index 0000000000000000000000000000000000000000..4f8de4294838daca1f5d0455e39badd063288be1 GIT binary patch literal 8079 zcmb7J34D~*wf~=)Z)U!kOp?ivi3x!aHj_+9h*1&}b^=IJKm}=WsW2py5E3#miwU@( z&mitgrA1Ikfc8z@3R+2`wr;iVcCoIti_ZnM)VA_QY zS~btO@T>=^_=ReoQ_b_L`Hc&|^&nlLpTh54_`Qc*FR11Z9=wQ`6!fxcUQx}fs(HA26$pX$T@eCN#vZn*aSTI3;wG3-%!o}sOC-8yrryqTgN-9 zb4bU#I^J{6`RtKr=3hIu&^hpIzH0zv5rr4e5&I!9skhrxsES%{8Pujbo{T5FLivS z<7*xN)^S9~kS@?gbg}7T*G1FCp^H-&7p01>i(40uE=jt0bxGDGMVC}ve7dCR;@4%A zF6p`ibji@=1YI(9$WYrG#+HT|0YyNx zfp2dO)v8W&xV~d`sJXF0DXQNXOEm@UqSg zYr}14hSoL{<7lO6lu~FhHb$nNt}rw?9NIABSZNECxNl8e^Z%l*Qq(iQttH3WX3R9y z5otV*Be+l+hntTxT%*=8)Ycwe5@~4=WQ^d;>H-oe8TH4Jv4F$%k+uzLctOFjCMtZ* zaqv|m;!hmGj1dX74WUNvij4eoj#aBX<7^AJhC^KIjQpzV5hb{4BP|z%+elK7UsGK@ zf|z4bYQKl-IO}#}Pv+%+TQ+ZfV|Tc2wQ`m+%3a?Us$EU@6ZV9=TZaccD>7&YcQ#mul|zVjq6&k{Mo^DYF#sY%hL-|8~h7 zugsNsUJT$4FYZ^(LG*iZA6aP7e1^!9lS)rMWm;Le7x&`l0$;2@y&|->wl2*5nSh!% zziPq4MJ}oG$^uzPXLsk$%DrfE{Y4&S)h_zA(?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9g=mYLbawZq6^%p6h7GN_nc@(iFcmhf0)nh9@JEb*vJ zLK^#Srci!{(@qh6!SX}nH@Qw3sC-MD^3zfKqmnlw2>%Kv4|B;LVPt(2Ir10^<=4!E zPhg!q$(za3yp=q|MDZ+d8_)4HJdda3w{#?*Os(a-jgHjm@@6_RFCCk=D~p)6OAaWz zcEU^KWwkd%;mEt8JeC}ll^INsMsm!{(5`N%aArDFx8DX&rqd_{OcB;*P~^c(=KwDM z<}A#O_abNUGH38Av(9U%kk>I+{)96{)sK9NvX=aGTI!*t|DdI&>pD{_H12w*R>n*7 zq)biKXcaLVv($$3cbgh3ojooIxD?wycopU5TXqlqE>p{6$;IiF>#<{_xH5EWYDH=p z6jPl7nA;4+yZ9_&?4T1YCVvl^)Fin=ih}h_Y@HkWuuu{2#B3!(t5e&=*`o~wv|Eu< z6rdB;-W&Q@_0z0AYez*=WanLl_yej2 zv+p&x+0+AhnXabAi5o@LjETNv*=QDt^yTOTLjM+vDvH=bs5S6kVWIt7E8WVgC5b#2 zT7woY%gw%81P01cl`PbY6NxvCNZb*lP9V*4D@n=DI^)A7GdbhSww#X_kRx2SAvkS- z+s4;fn+=7009b6(u-@iCtIdT@n~rO39_+Ry;UFIdp0@GN;d~r;!Ip+YHa~`J0U2e> Qkf2S~ + *
  • a % (required) + *
  • a modifier (optional) + *
    + *
    +
    forces display of + for positive numbers + *
    0
    show leading zeroes + *
    -
    align left in the field + *
    space
    prepend a space in front of positive numbers + *
    #
    use "alternate" format. Add 0 or 0x for octal or hexadecimal numbers. Don't suppress trailing zeroes in general floating point format. + *
    + *
  • an integer denoting field width (optional) + *
  • a period followed by an integer denoting precision (optional) + *
  • a format descriptor (required) + *
    + *
    f
    floating point number in fixed format + *
    e, E
    floating point number in exponential notation (scientific format). The E format results in an uppercase E for the exponent (1.14130E+003), the e format in a lowercase e. + *
    g, G
    floating point number in general format (fixed format for small numbers, exponential format for large numbers). Trailing zeroes are suppressed. The G format results in an uppercase E for the exponent (if any), the g format in a lowercase e. + *
    d, i
    integer in decimal + *
    x
    integer in hexadecimal + *
    o
    integer in octal + *
    s
    string + *
    c
    character + *
    + * + * @exception IllegalArgumentException if bad format + */ + + public Format(String s) + { width = 0; + precision = -1; + pre = ""; + post = ""; + leading_zeroes = false; + show_plus = false; + alternate = false; + show_space = false; + left_align = false; + fmt = ' '; + + int state = 0; + int length = s.length(); + int parse_state = 0; + // 0 = prefix, 1 = flags, 2 = width, 3 = precision, + // 4 = format, 5 = end + int i = 0; + + while (parse_state == 0) + { if (i >= length) parse_state = 5; + else if (s.charAt(i) == '%') + { if (i < length - 1) + { if (s.charAt(i + 1) == '%') + { pre = pre + '%'; + i++; + } + else + parse_state = 1; + } + else throw new java.lang.IllegalArgumentException(); + } + else + pre = pre + s.charAt(i); + i++; + } + while (parse_state == 1) + { if (i >= length) parse_state = 5; + else if (s.charAt(i) == ' ') show_space = true; + else if (s.charAt(i) == '-') left_align = true; + else if (s.charAt(i) == '+') show_plus = true; + else if (s.charAt(i) == '0') leading_zeroes = true; + else if (s.charAt(i) == '#') alternate = true; + + + else { parse_state = 2; i--; } + i++; + } + while (parse_state == 2) + { if (i >= length) parse_state = 5; + else if ('0' <= s.charAt(i) && s.charAt(i) <= '9') + { width = width * 10 + s.charAt(i) - '0'; + i++; + } + else if (s.charAt(i) == '.') + { parse_state = 3; + precision = 0; + i++; + } + else + parse_state = 4; + } + while (parse_state == 3) + { if (i >= length) parse_state = 5; + else if ('0' <= s.charAt(i) && s.charAt(i) <= '9') + { precision = precision * 10 + s.charAt(i) - '0'; + i++; + } + else + parse_state = 4; + } + if (parse_state == 4) + { if (i >= length) parse_state = 5; + else fmt = s.charAt(i); + i++; + } + if (i < length) + post = s.substring(i, length); + } + + /** + * prints a formatted number following printf conventions + * @param s a PrintStream + * @param fmt the format string + * @param x the double to print + */ + + public static void print(java.io.PrintStream s, String fmt, double x) + { s.print(new Format(fmt).form(x)); + } + + /** + * prints a formatted number following printf conventions + * @param s a PrintStream + * @param fmt the format string + * @param x the long to print + */ + public static void print(java.io.PrintStream s, String fmt, long x) + { s.print(new Format(fmt).form(x)); + } + + /** + * prints a formatted number following printf conventions + * @param s a PrintStream + * @param fmt the format string + * @param x the character to + */ + + public static void print(java.io.PrintStream s, String fmt, char x) + { s.print(new Format(fmt).form(x)); + } + + /** + * prints a formatted number following printf conventions + * @param s a PrintStream, fmt the format string + * @param x a string that represents the digits to print + */ + + public static void print(java.io.PrintStream s, String fmt, String x) + { s.print(new Format(fmt).form(x)); + } + + /** + * Converts a string of digits (decimal, octal or hex) to an integer + * @param s a string + * @return the numeric value of the prefix of s representing a base 10 integer + */ + + public static int atoi(String s) + { return (int)atol(s); + } + + /** + * Converts a string of digits (decimal, octal or hex) to a long integer + * @param s a string + * @return the numeric value of the prefix of s representing a base 10 integer + */ + + public static long atol(String s) + { int i = 0; + + while (i < s.length() && Character.isSpace(s.charAt(i))) i++; + if (i < s.length() && s.charAt(i) == '0') + { if (i + 1 < s.length() && (s.charAt(i + 1) == 'x' || s.charAt(i + 1) == 'X')) + return parseLong(s.substring(i + 2), 16); + else return parseLong(s, 8); + } + else return parseLong(s, 10); + } + + private static long parseLong(String s, int base) + { int i = 0; + int sign = 1; + long r = 0; + + while (i < s.length() && Character.isSpace(s.charAt(i))) i++; + if (i < s.length() && s.charAt(i) == '-') { sign = -1; i++; } + else if (i < s.length() && s.charAt(i) == '+') { i++; } + while (i < s.length()) + { char ch = s.charAt(i); + if ('0' <= ch && ch < '0' + base) + r = r * base + ch - '0'; + else if ('A' <= ch && ch < 'A' + base - 10) + r = r * base + ch - 'A' + 10 ; + else if ('a' <= ch && ch < 'a' + base - 10) + r = r * base + ch - 'a' + 10 ; + else + return r * sign; + i++; + } + return r * sign; + } + + /** + * Converts a string of digits to an double + * @param s a string + */ + + public static double atof(String s) + { int i = 0; + int sign = 1; + double r = 0; // integer part + double f = 0; // fractional part + double p = 1; // exponent of fractional part + int state = 0; // 0 = int part, 1 = frac part + + while (i < s.length() && Character.isSpace(s.charAt(i))) i++; + if (i < s.length() && s.charAt(i) == '-') { sign = -1; i++; } + else if (i < s.length() && s.charAt(i) == '+') { i++; } + while (i < s.length()) + { char ch = s.charAt(i); + if ('0' <= ch && ch <= '9') + { if (state == 0) + r = r * 10 + ch - '0'; + else if (state == 1) + { p = p / 10; + r = r + p * (ch - '0'); + } + } + else if (ch == '.') + { if (state == 0) state = 1; + else return sign * r; + } + else if (ch == 'e' || ch == 'E') + { long e = (int)parseLong(s.substring(i + 1), 10); + return sign * r * Math.pow(10, e); + } + else return sign * r; + i++; + } + return sign * r; + } + + /** + * Formats a double into a string (like sprintf in C) + * @param x the number to format + * @return the formatted string + * @exception IllegalArgumentException if bad argument + */ + + public String form(double x) + { String r; + if (precision < 0) precision = 6; + int s = 1; + if (x < 0) { x = -x; s = -1; } + if (fmt == 'f') + r = fixed_format(x); + else if (fmt == 'e' || fmt == 'E' || fmt == 'g' || fmt == 'G') + r = exp_format(x); + else throw new java.lang.IllegalArgumentException(); + + return pad(sign(s, r)); + } + + /** + * Formats a long integer into a string (like sprintf in C) + * @param x the number to format + * @return the formatted string + */ + + public String form(long x) + { String r; + int s = 0; + if (fmt == 'd' || fmt == 'i') + { s = 1; + if (x < 0) { x = -x; s = -1; } + r = "" + x; + } + else if (fmt == 'o') + r = convert(x, 3, 7, "01234567"); + else if (fmt == 'x') + r = convert(x, 4, 15, "0123456789abcdef"); + else if (fmt == 'X') + r = convert(x, 4, 15, "0123456789ABCDEF"); + else throw new java.lang.IllegalArgumentException(); + + return pad(sign(s, r)); + } + + /** + * Formats a character into a string (like sprintf in C) + * @param x the value to format + * @return the formatted string + */ + + public String form(char c) + { if (fmt != 'c') + throw new java.lang.IllegalArgumentException(); + + String r = "" + c; + return pad(r); + } + + /** + * Formats a string into a larger string (like sprintf in C) + * @param x the value to format + * @return the formatted string + */ + + public String form(String s) + { if (fmt != 's') + throw new java.lang.IllegalArgumentException(); + if (precision >= 0) s = s.substring(0, precision); + return pad(s); + } + + + /** + * a test stub for the format class + */ + + public static void main(String[] a) + { double x = 1.23456789012; + double y = 123; + double z = 1.2345e30; + double w = 1.02; + double u = 1.234e-5; + int d = 0xCAFE; + Format.print(System.out, "x = |%f|\n", x); + Format.print(System.out, "u = |%20f|\n", u); + Format.print(System.out, "x = |% .5f|\n", x); + Format.print(System.out, "w = |%20.5f|\n", w); + Format.print(System.out, "x = |%020.5f|\n", x); + Format.print(System.out, "x = |%+20.5f|\n", x); + Format.print(System.out, "x = |%+020.5f|\n", x); + Format.print(System.out, "x = |% 020.5f|\n", x); + Format.print(System.out, "y = |%#+20.5f|\n", y); + Format.print(System.out, "y = |%-+20.5f|\n", y); + Format.print(System.out, "z = |%20.5f|\n", z); + + Format.print(System.out, "x = |%e|\n", x); + Format.print(System.out, "u = |%20e|\n", u); + Format.print(System.out, "x = |% .5e|\n", x); + Format.print(System.out, "w = |%20.5e|\n", w); + Format.print(System.out, "x = |%020.5e|\n", x); + Format.print(System.out, "x = |%+20.5e|\n", x); + Format.print(System.out, "x = |%+020.5e|\n", x); + Format.print(System.out, "x = |% 020.5e|\n", x); + Format.print(System.out, "y = |%#+20.5e|\n", y); + Format.print(System.out, "y = |%-+20.5e|\n", y); + + Format.print(System.out, "x = |%g|\n", x); + Format.print(System.out, "z = |%g|\n", z); + Format.print(System.out, "w = |%g|\n", w); + Format.print(System.out, "u = |%g|\n", u); + Format.print(System.out, "y = |%.2g|\n", y); + Format.print(System.out, "y = |%#.2g|\n", y); + + Format.print(System.out, "d = |%d|\n", d); + Format.print(System.out, "d = |%20d|\n", d); + Format.print(System.out, "d = |%020d|\n", d); + Format.print(System.out, "d = |%+20d|\n", d); + Format.print(System.out, "d = |% 020d|\n", d); + Format.print(System.out, "d = |%-20d|\n", d); + Format.print(System.out, "d = |%20.8d|\n", d); + Format.print(System.out, "d = |%x|\n", d); + Format.print(System.out, "d = |%20X|\n", d); + Format.print(System.out, "d = |%#20x|\n", d); + Format.print(System.out, "d = |%020X|\n", d); + Format.print(System.out, "d = |%20.8x|\n", d); + Format.print(System.out, "d = |%o|\n", d); + Format.print(System.out, "d = |%020o|\n", d); + Format.print(System.out, "d = |%#20o|\n", d); + Format.print(System.out, "d = |%#020o|\n", d); + Format.print(System.out, "d = |%20.12o|\n", d); + + Format.print(System.out, "s = |%-20s|\n", "Hello"); + Format.print(System.out, "s = |%-20c|\n", '!'); + } + + + private static String repeat(char c, int n) + { if (n <= 0) return ""; + StringBuffer s = new StringBuffer(n); + for (int i = 0; i < n; i++) s.append(c); + return s.toString(); + } + + private static String convert(long x, int n, int m, String d) + { if (x == 0) return "0"; + String r = ""; + while (x != 0) + { r = d.charAt((int)(x & m)) + r; + x = x >>> n; + } + return r; + } + + private String pad(String r) + { String p = repeat(' ', width - r.length()); + if (left_align) return pre + r + p + post; + else return pre + p + r + post; + } + + private String sign(int s, String r) + { String p = ""; + if (s < 0) p = "-"; + else if (s > 0) + { if (show_plus) p = "+"; + else if (show_space) p = " "; + } + else + { if (fmt == 'o' && alternate && r.length() > 0 && r.charAt(0) != '0') p = "0"; + else if (fmt == 'x' && alternate) p = "0x"; + else if (fmt == 'X' && alternate) p = "0X"; + } + int w = 0; + if (leading_zeroes) + w = width; + else if ((fmt == 'd' || fmt == 'i' || fmt == 'x' || fmt == 'X' || fmt == 'o') + && precision > 0) w = precision; + + return p + repeat('0', w - p.length() - r.length()) + r; + } + + + private String fixed_format(double d) + { String f = ""; + + if (d > 0x7FFFFFFFFFFFFFFFL) return exp_format(d); + + long l = (long)(precision == 0 ? d + 0.5 : d); + f = f + l; + + double fr = d - l; // fractional part + if (fr >= 1 || fr < 0) return exp_format(d); + + return f + frac_part(fr); + } + + private String frac_part(double fr) + // precondition: 0 <= fr < 1 + { String z = ""; + if (precision > 0) + { double factor = 1; + String leading_zeroes = ""; + for (int i = 1; i <= precision && factor <= 0x7FFFFFFFFFFFFFFFL; i++) + { factor *= 10; + leading_zeroes = leading_zeroes + "0"; + } + long l = (long) (factor * fr + 0.5); + + z = leading_zeroes + l; + z = z.substring(z.length() - precision, z.length()); + } + + + if (precision > 0 || alternate) z = "." + z; + if ((fmt == 'G' || fmt == 'g') && !alternate) + // remove trailing zeroes and decimal point + { int t = z.length() - 1; + while (t >= 0 && z.charAt(t) == '0') t--; + if (t >= 0 && z.charAt(t) == '.') t--; + z = z.substring(0, t + 1); + } + return z; + } + + private String exp_format(double d) + { String f = ""; + int e = 0; + double dd = d; + double factor = 1; + while (dd > 10) { e++; factor /= 10; dd = dd / 10; } + while (dd < 1) { e--; factor *= 10; dd = dd * 10; } + if ((fmt == 'g' || fmt == 'G') && e >= -4 && e < precision) + return fixed_format(d); + + d = d * factor; + f = f + fixed_format(d); + + if (fmt == 'e' || fmt == 'g') + f = f + "e"; + else + f = f + "E"; + + String p = "000"; + if (e >= 0) + { f = f + "+"; + p = p + e; + } + else + { f = f + "-"; + p = p + (-e); + } + + return f + p.substring(p.length() - 3, p.length()); + } + + private int width; + private int precision; + private String pre; + private String post; + private boolean leading_zeroes; + private boolean show_plus; + private boolean alternate; + private boolean show_space; + private boolean left_align; + private char fmt; // one of cdeEfgGiosxXos +} diff --git a/spider-web/InfoDialog.class b/spider-web/InfoDialog.class new file mode 100644 index 0000000000000000000000000000000000000000..9527a0071dab62104954edadf71ee8b6b50dfccf GIT binary patch literal 1401 zcmah}Yg5xe6g^8r)5btcd5Nfq4}>D(`&AURQmqydQL*@#*|xDnLxSm6#y{jIzc{1q zC^P;5f0X0BZKsJdIDY76_uRebp8M$j`u*c4BACN#1LK&{kv7nSSp%mqr{lDNUd+dF z0B2%2%iuX3=VQ2Fz`#YuFX^~!pdVLsTs4ryHNKRIVZp$4++fbdIBwz=?{4#wHE;(@ zI&wPh3PekFr94+)pzv0Hkn?g!&EIZ88G&9$mMljgSy-++$}ZThRbYfn(FNPJ)eV8m z(}82oms?h*eRiZ|Oq9sGZ@fFUbiC?m&d$UU+!GiMGWGn5 zR=gdW z&}~_MN1xgzpMpNNW|6`u=~pd9#R`plXDrEU)8_HkD|T($tI;l8(oT8;rf$Fo*;A1wM0yuJ#bhFxXd=>pM#tXb zTyiKmq%{%!20fjMrN2UNAihpEqnO&)g!v79yXY@Ak+`OfX}d@kwKl~7QH*Ki(APj} zJ)IgH(^{Sl45b?w{z8ETj?sD!CarN2vkxP*KZ!oV5?G{n=pF`8L<(gL!oe`M>4w56 zc^=1!P8y4pXoMI>XTM^E<9$LOMHr>ue(iJQb2rdPE87DUW}N5`66GPHoFJO1E*X)?D literal 0 HcmV?d00001 diff --git a/spider-web/InfoDialog.java b/spider-web/InfoDialog.java new file mode 100755 index 00000000..1442f7f0 --- /dev/null +++ b/spider-web/InfoDialog.java @@ -0,0 +1,38 @@ +import java.awt.*; + +public class InfoDialog extends Dialog { + protected Button button; + protected MultiLineLabel label; + + + public InfoDialog(Frame parent, String title, String message) { + super(parent, title, false); + + this.setLayout(new BorderLayout(15,15)); + label = new MultiLineLabel(message, 20, 20, 1); + this.add("Center", label); + + button = new Button("OK"); + Panel p = new Panel(); + p.setLayout(new FlowLayout(FlowLayout.CENTER, 15, 15)); + p.add(button); + this.add("South", p); + + this.pack(); + this.show(); + } + + public boolean action(Event e, Object arg) { + if (e.target == button) { + this.hide(); + this.dispose(); + return true; + } + else return false; + } + + public boolean gotFocus(Event e, Object Arg) { + button.requestFocus(); + return true; + } +} diff --git a/spider-web/IntTextField.java b/spider-web/IntTextField.java new file mode 100755 index 00000000..421a28fe --- /dev/null +++ b/spider-web/IntTextField.java @@ -0,0 +1,36 @@ +import java.awt.*; + +public class IntTextField extends TextField +{ + + public IntTextField() + { + ; + } + + public IntTextField(String s) + { + this.setText(s); + } + + public boolean isValid() + { + int value; + try + { + value = Integer.valueOf(getText().trim()).intValue(); + + } + catch (NumberFormatException e) + { + requestFocus(); + return false; + } + return true; + } + + public int getValue() + { + return Integer.parseInt(getText().trim(),10); + } +} diff --git a/spider-web/MultiLineLabel.class b/spider-web/MultiLineLabel.class new file mode 100644 index 0000000000000000000000000000000000000000..c2fed4a2b83715927abf659bae5b4782642a1040 G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bd*K{KV9NRKTX7_u5jQrwDOwTHZp8fsh^r*0h%-XlQQDrP#aWDac6&;8JLI-DmOsVMTs+Nnv@06E$8BPWGdQb=Wz+IU51_;KiYLMJLh zTONmAAe8?dl#)OPM@b+=3P+f4>&6`xl9=N5d5Dp~kMsEoeD5Q)UzW!uiH8&O@}&6H zCPcO*=GU?FC&J24GehlS$x#olM;wKVj!GUXn9dS9g=tF3;ZJf)n#et-yX%;rhV^a! zhuB^65Dz5h2Yp8Z_hECb=?7vv_{mQ=+s04yL);9rb##k$2bJn@pqI8>YAG&- z)my@W{z&^8_S^}m-c~z57?u;WoqW4dxI#ObXOb2#c!AAh5hr1jBniyo8eAmtD%bCF Krr~*&*35tNmq?ZX literal 0 HcmV?d00001 diff --git a/spider-web/MultiLineLabel.java b/spider-web/MultiLineLabel.java new file mode 100755 index 00000000..770a5d92 --- /dev/null +++ b/spider-web/MultiLineLabel.java @@ -0,0 +1,111 @@ +import java.awt.*; +import java.util.*; + +public class MultiLineLabel extends Canvas { + public static final int LEFT = 0; + public static final int CENTER = 1; + public static final int RIGHT = 2; + protected String[] lines; + protected int num_lines; + protected int margin_width; + protected int margin_height; + protected int line_height; + protected int line_ascent; + protected int[] line_widths; + protected int max_width; + protected int alignment = LEFT; + + protected void newLabel(String label) { + StringTokenizer t = new StringTokenizer(label,"\n"); + num_lines = t.countTokens(); + lines = new String[num_lines]; + line_widths = new int[num_lines]; + for(int i = 0; i < num_lines; i++) lines[i] = t.nextToken(); + } + + protected void measure() { + FontMetrics fm = this.getFontMetrics(this.getFont()); + if (fm == null) return; + + line_height = fm.getHeight(); + line_ascent = fm.getAscent(); + max_width = 0; + for(int i = 0; i < num_lines; i++) { + line_widths[i] = fm.stringWidth(lines[i]); + if (line_widths[i] > max_width) max_width = line_widths[i]; + } + } + + public MultiLineLabel(String label, int margin_width, + int margin_height, int alignment) { + newLabel(label); + this.margin_width = margin_width; + this.margin_height = margin_height; + this.alignment = alignment; + } + + public MultiLineLabel(String label, int margin_width, int margin_height) { + this(label, margin_width, margin_height, LEFT); + } + + public MultiLineLabel(String label, int aligment) { + this(label, 10, 10, aligment); + } + + public MultiLineLabel(String label) { + this(label, 10, 10, LEFT); + } + + public void setLabel(String label) { + newLabel(label); + measure(); + repaint(); + } + + public void setFont(Font f) { + super.setFont(f); + measure(); + repaint(); + } + + public void setForegroundColor(Color c) { + super.setForeground(c); + repaint(); + } + + public void setAligment(int a) { alignment = a; repaint(); } + public void setMarginWidth(int mw) { margin_width = mw; repaint(); } + public void setMarginHeight(int mh) { margin_height = mh; repaint(); } + public int getAlignment() { return alignment; } + public int getMarginWidth() { return margin_width; } + public int getMarginheight() { return margin_height; } + + public void addNotify() { super.addNotify(); measure(); } + + public Dimension preferedSize() { + return new Dimension(max_width + 2 * margin_width, + num_lines * line_height + 2 * margin_height); + } + + public Dimension miniumSize() { + return new Dimension(max_width, num_lines * line_height); + } + + public void paint(Graphics g) { + int x,y; + Dimension d = this.size(); + y = line_ascent + (d.height - num_lines * line_height) / 2; + for(int i = 0; i < num_lines; i++, y += line_height) { + switch(alignment) { + case LEFT: + x = margin_width; break; + case CENTER: + default: + x = (d.width - line_widths[i]) / 2; break; + case RIGHT: + x = d.width - margin_width - line_widths[i]; break; + } + g.drawString(lines[i], x, y); + } + } +} diff --git a/spider-web/PersonalPreferences.java b/spider-web/PersonalPreferences.java new file mode 100755 index 00000000..e63f02b8 --- /dev/null +++ b/spider-web/PersonalPreferences.java @@ -0,0 +1,45 @@ +import java.awt.*; + +public class PersonalPreferences extends Dialog +{ + public PersonalPreferences(spiderframe parent, String Call, + String Fullname, Font font) { + super(parent, "Personal Preferences", true); + this.parent = parent; + this.setFont(font); + + Panel p1 = new Panel(); + p1.setLayout(new GridLayout(2,2)); + p1.add(new Label("Call: ")); + p1.add(call = new TextField(Call, 6)); + p1.add(new Label("Passwort: ")); + p1.add(fullname = new TextField(Fullname)); + add("Center", p1); + + Panel p2 = new Panel(); + p2.add(new Button("OK")); + p2.add(new Button("Cancel")); + add("South", p2); + + resize(250,120); + show(); + } + + public boolean action(Event evt, Object arg) { + if (arg.equals("OK")) { + dispose(); + parent.setCall(call.getText()); + parent.setFullname(fullname.getText()); + } + else if (arg.equals("Cancel")) { + dispose(); + } + else return super.action(evt, arg); + return true; + } + + private TextField call; + private TextField fullname; + + private spiderframe parent; +} diff --git a/spider-web/README b/spider-web/README new file mode 100644 index 00000000..b32b7c3b --- /dev/null +++ b/spider-web/README @@ -0,0 +1,37 @@ +Spider-WEB v0.6b + +Completely based on a clx web client written in Java by dl6dbh +(ftp://clx.muc.de/pub/clx/clx-java_10130001.tgz) + +The webserver has to run on the same machine as your DxSpider software! + +Installation instructions: + +Put all the files in the spider-web directory into a newly created directory +under the documentroot of your websever for instance 'client'. In my case +this is: +/usr/local/httpd/spider/client/ + +================================================================ +!NOTE! this directory has to be writeable by your http daemon!!!! +================================================================= + +move spider.cgi to the cgi-bin directory of your webserver, in my case that is +/usr/local/httpd/cgi-bin/ +make it worldreadable. + +edit spider.cgi and change the following parameters: + +portnumber=$"1407" +tempdir=$"/usr/local/httpd/spider/client/" +clustercall=$"PA4AB-15" + +'portnumber' is the portnumber that you use to connect to your DxSpider via +telnet (see Listeners.pm) + +'tempdir' is the directory that you just created and that you used to move +the *.java and *.class files to. + +'clustercall' is the call of your cluster. + +You now can connect to Spider-Web via http://yourserver/cgi-bin/spider.cgi diff --git a/spider-web/StreamListener.class b/spider-web/StreamListener.class new file mode 100644 index 0000000000000000000000000000000000000000..1d906da5975845046c725f9fb6c44a584211a963 GIT binary patch literal 825 zcmZ`%%Wl&^6g^`nb>h0u(3C=f0By;u39w*65t{%~rO+-KT3CVOOv_Y>9obGPU&AtG ziA00M0+vYp2|odxsTIUS$nu@J_a2`)_jta3|M&?e)^Xd0gQYAcaY2WRI$gGL372hL zK|zPB7OvU2j+G2nEv#9%Az&z9V5xcN9=UZD)E~I9yXp4_@lG5{x3@unw=Xc&jQXl0 z!~M|hNfsyWDPP6+1xm#~I{)P)cDIuA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b/spider-web/spider.cgi @@ -0,0 +1,79 @@ +#! /bin/sh +# +################################################### +# +# Edit the following lines +# +# +portnumber=$"1407" +tempdir=$"/usr/local/httpd/spider/client/" +clustercall=$"PA4AB-15" +# +# +# +# End of configurable part +# +#################################################### +hostname=$"localhost" + +echo "Content-type: text/html" +echo +echo "" +echo "Spider DX Cluster" +echo "" +echo '' +echo "
    "
    +
    +pattern=$(echo ${QUERY_STRING} | sed -e s,'call=',, | sed -e s/"&passwd="/" "/)
    +call=$(echo $pattern | cut -d' ' -f1)
    +passwd=$(echo $pattern | cut -s -d' ' -f2)
    +
    +
    +if [ ${call} = ""]  ; then
    +  echo "
    " + echo "
    " + echo "Welcome to the Spider DX Cluster" + echo "" + echo ${clustercall} + echo "" + echo "

     

    " + echo '
    ' + echo "Your Call Please: " + echo ' ' + echo '' + echo "
    " + echo "
    " + +else + echo "" > ${tempfile}${call}.html + echo "" >> ${tempfile}${call}.html + echo "" >> ${tempfile}${call}.html + echo "" >> ${tempfile}${call}.html + echo '' >> ${tempdir}${call}.html + echo '' >> ${tempdir}${call}.html + echo '' >> ${tempdir}${call}.html + echo "" >> ${tempdir}${call}.html + echo "" >> ${tempdir}${call}.html + echo "" >> ${tempdir}${call}.html + GOTO='' + echo ${GOTO} + +fi + echo "
    " + echo "" + +# all *.html tempory files remove older than 10 min +# +cd ${tempdir} +files=$(find *.html -mmin +10) +rm ${files} diff --git a/spider-web/spiderclient.class b/spider-web/spiderclient.class new file mode 100644 index 0000000000000000000000000000000000000000..679401f392f41d5a99c1fa35060140742f06ed8e GIT binary patch literal 2607 zcmaJ?>30)V6#u=nWzxx`OQ59{kR93pjk1VXMBB8bkNs)HID`HDAUK-hsNx2 z1xcnU{^%+uFsWh%rW6=VkE>XP6Rd42m}ZWpVl8auq}k+g1&)eM$S}ucPL@qh@~;^M zrxctH;*5$Xa8|`OoMZlzAv}er+1WFEd{)783Z54b8G**caqXlQwRAT+Vkb}NZl^$% zoplA8e2HO4haAIlM_fnOrb!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fnk?S?VrOU zF)jtLA94DV0Ca@CT`mq8Oe-KNyE}@FPC9@-a`7_&kb0k%R&%s`3g8B)*+`Q)f@|DL z6}*iWa1&H(rd1q;S}Rg&o$so(TuNGznrmaJ!*qKzty@|jsTv%8GAd1}4jhfnNNaSg zWN5q{J|>Qgw-pDLz=5?vvmMZ^9Y(g3mhmoVbrP?1Z#9HiB`MR)p@#jKzLEh*;>XmM zj2z*78Ndq!=@*(*co=D%W6 zR+P^e`ccP|^tk>`@C0^*Y$qe6IQDn}a`p@1jxK_P)x5@$lY2DWkwIjG2Q<7mp#@!|5DM(hD8N?0~&OQwITi zV2@D(Fw1^1N%wUaM+fZXnY4bI_L8P~0`{s5n&)#(`>oJC?*{CXGik4B+V3>&`GEcV zOq$r&Ec<0myFXyB*0kB#fnzDS4(#ziJ9oZ}b#!Pr&};5d~bBDWDe(wg&7!9Z^7arhq^9 z)L?wT-lPRM7NLd;zx}4%kjf9(n~x-%Kg<;Vmmb3TV89L@QNTT!0^aH=;G%$CcSHeO zGX?y$r+~!)yIu>B#N@ypmT;K5(YGCbDQC1_yRU?r)GeoXQXlk zMD%5FsF%W_UWQ!Za>T)_@n`SX&;-7grt^>Kc>W1h^B%;%n`kpWYBVqkeZGa-`BvJ^ zx6w6xJN_>E4%*Kh^a$TcFYsOT2fmx$=X>Zg-iJT3x)-^^eLRZqN3QSy>W}?g#}D#0 z{u!Un5Am&>1XmY7#t-v5e1H$}qx>B|rpEFUY9c?0k1bE(PbZ#HF@9F<=I2xg{=E4C zKB%7N7u7+2NxjLx^%(rJC!b&O9L2ACPT 0) { + InputPos--; + input.setText(InputBuffer[InputPos]); + } + return true; + } + else if (evt.key == Event.DOWN) { + if (InputPos < MaxInputPos) { + InputPos++; + input.setText(InputBuffer[InputPos]); + } + else { + input.setText(""); + } + + } + return true; + } + + return super.handleEvent(evt); + } + + public synchronized void show() { + move(50, 50); + super.show(); + } + + public void setUserColor(Color c, String whichColor) { + if (whichColor.equals("Output Background ...")) { + OutBackgroundColor = c; + } + else if (whichColor.equals("Output Foreground ...")) { + OutForegroundColor = c; + } else if (whichColor.equals("Input Background ...")) { + InBackgroundColor = c; + } + else if (whichColor.equals("Input Foreground ...")) { + InForegroundColor = c; + } else if (whichColor.equals("Output own text ...")) { + OutOwnColor = c; + } + + setColors(); + } + + + public void connected() { + connect_menuitem.setLabel("Disconnect"); + connectState.setText("Connected to "+Hostname+":"+Port); + input.setEditable(true); + copy_menuitem.enable(); + Connected = true; + connectButton.disable(); + disconnectButton.enable(); + } + + public void disconnected() { + Connected = false; + connect_menuitem.setLabel("Connect"); + connectState.setText("Disconnected from "+Hostname); + input.setEditable(false); + copy_menuitem.disable(); + paste_menuitem.disable(); + connectButton.enable(); + disconnectButton.disable(); + } + + public void setUserFont(String name, int size, int style, + String whichFont) { + if (whichFont.equals("Area ...")) { + OutFont = new Font(name, style, size); + } + else if (whichFont.equals("Input Line ...")) { + InFont = new Font(name, style, size); + } + + setFonts(); + } + + + public void getSelectedText() { + CopyPaste = new String(output.getSelectedText()); + paste_menuitem.enable(); + } + + public boolean action(Event evt, Object arg) { + if (evt.target instanceof MenuItem) { + if (arg.equals("Quit")) { + this.hide(); + // } else if (arg.equals("Personal preferences ...")) { + // PersonalPreferences pp = new PersonalPreferences(this, + // Call, Fullname, OutFont); + } else if (arg.equals("Connect")) { + parent.doconnect(); + } else if (arg.equals("Disconnect")) { + parent.dodisconnect(); + } else if (arg.equals("About")) { + InfoDialog id = new InfoDialog(this, "About", + "JAVA Spider Webclient 0.6b\nPA4AB\n" + + "pa4ab@pa4ab.net \n" + + "April 2001\n" + + "Based on source of the CLX Client from dl6dbh" ); + + id.resize(500,300); + id.show(); + } else if (arg.equals("Copy")) { + getSelectedText(); + } else if (arg.equals("Paste")) { + input.insertText(CopyPaste,input.getSelectionStart()); + } else if (arg.equals("Bye")) { + if (Connected) out.println("bye"); + } else if (arg.equals("Help")) { + if (Connected) out.println("help overview"); + } else if (arg.equals("Show Last DX")) { + if (Connected) out.println("sh/dx"); + } else if (arg.equals("Status")) { + if (Connected) out.println("sh/conf"); + } else if (arg.equals("Show WWV")) { + if (Connected) out.println("sh/wwv"); + } else if (arg.equals("Show Beam Direction")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("sh/heading " + Prefix ); + } else if (arg.equals("search DX")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("sh/dx " + Prefix ); + + } else if (arg.equals("Search QSL Info")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("sh/qsl " + Prefix ); + + + } else if (arg.equals("search Adress")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("sh/qrz " + Prefix ); + + + } else if (arg.equals("search qsl Manager")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("sh/qsl " + Prefix ); + + + } else if (arg.equals("search DXCC")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("sh/dxcc " + Prefix ); + + // buttom settings + + } else if (arg.equals("Set Beep")) { + if (Connected) out.println("set/Beep"); + + }else if (arg.equals("Set QTH / City")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("set/qth " + Prefix ); + + + }else if (arg.equals("Set Name")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("set/name " + Prefix ); + + } + else if (arg.equals("Set Locator")) { + beam pp = new beam(this, Prefix, OutFont); + if (Connected) out.println ("set/loc " + Prefix ); + + + } + else if (arg.equals("Show Personal Settings")) { + if (Connected) out.println ("show/sta " + Call ); + + + } + + // dx announce + + else if (arg.equals("DXannounce")) { + dxannounce pp = new dxannounce(this, Call2, Freq, Remarks, OutFont); + if (Connected) out.println ("dx " + Call2 + " " + Freq + " " + Remarks ); + + } + // mailbox + else if (arg.equals("last 50 Msgs")) { + if (Connected) out.println ("dir/50 " ); + } + else if (arg.equals("list DX Bulletins")) { + if (Connected) out.println ("dir/bul " ); + } + else if (arg.equals("new Msgs")) { + if (Connected) out.println ("dir/new " ); + } + else if (arg.equals("own Msgs")) { + if (Connected) out.println ("dir/own " ); + } + + + + else return false; + } + else if (evt.target instanceof Button) { + if (arg.equals("Connect")) { + if (!Connected) { + parent.doconnect(); + } else return false; + } else if (arg.equals("Disconnect")) { + if (Connected) { + parent.dodisconnect(); + } else return false; + } + + else return false; + } + + return true; + } + + private idleTime idle; + + private TextArea input; + private TextArea output; + private MenuBar menubar; + private Menu file; + private Menu edit; + private Menu settings; + private Menu colors; + private Menu fonts; + private Menu commands; + private Menu show; + private Menu set; + private Menu dxann; + private Menu mailbox; + + + private MenuItem connect_menuitem = new MenuItem("Connect"); + private MenuItem copy_menuitem = new MenuItem("Copy"); + private MenuItem paste_menuitem = new MenuItem("Paste"); + + private Button connectButton = new java.awt.Button("Connect"); + private Button disconnectButton = new java.awt.Button("Disconnect"); + + private Date today = new Date(); + private Label DateLabel = new Label(today.toLocaleString()); + private Label IdleLabel = new Label("00:00"); + private Label connectState = new Label("not connected"); + + + private Color OutBackgroundColor = new Color(0,0,66); + private Color OutForegroundColor = new Color(255,255,0); + private Color OutOwnColor = Color.red; + private Color InBackgroundColor = new Color(234,199,135); + private Color InForegroundColor = Color.red; + + private Font OutFont = new Font("Courier", Font.PLAIN, 13); + private Font InFont = new Font("Courier", Font.BOLD, 13); + + private String Call = new String("NOCALL"); + private String Fullname = new String("NOBODY"); + private String Hostname = new String("localhost"); + private String Port = new String("3600"); + private String Channel = new String("0"); + + + private String Prefix = new String (""); + private String Call2 = new String (""); + private String Freq = new String (""); + private String Remarks = new String (""); + + + + + + + + private PrintStream out = null; + + private String InputBuffer[] = new String[256]; + private int InputPos = 0; + private int MaxInputPos = 0; + + private String CopyPaste; + + private boolean Connected; + + private spiderclient parent; + +} + +class setDate extends Thread { + + spiderframe cf; + + public setDate(spiderframe cf) { + this.cf = cf; + this.start(); + } + + public void run() { + for(;;) { + try { sleep(1000); } catch (InterruptedException e) {} + today = new Date(); + cf.setTime(today.toLocaleString()); + } + } + + private Date today = new Date(); + +} + + +class idleTime extends Thread { + + spiderframe cf; + int count; + + public idleTime(spiderframe cf) { + this.cf = cf; + this.start(); + count = 0; + } + + public void resetTimer() { + count=0; + } + + public void run() { + + for(;;) { + try { sleep(1000); } catch (InterruptedException e) {} + count++; + String sec = new Format("%02d").form(count % 60); + String min = new Format("%02d").form(count / 60); + cf.setIdle("Idle: "+min+":"+sec); + } + } +} -- 2.43.0