[REBOL] Question: Move the REBOL List? Re:(3)

2000-10-11 Thread peoyli


How come, that the archive won't fit a CD-ROM ?

I have archived all the messages to the REBOL list since -97
(the core/alpha days), and during 2000, I have received anything
between 500 and 1400 messages per month..

The lists have existed about three years now, which will allow about
18MB of mails per month to fill up a CD.. 18MB and 1500 messages gives
an average mail size of 12k (assuming that the list received 1500
messages a month in November -97)...

As I can see from the yet unsorted 1704 messages during September and
October, the REBOL list's average message size is about 2-3k, which is
also true for the Ally list (which have received about 2200 mails since
middle of February)

Back in the time when it was possible to get digests of the messages,
the maximum size of the 100-message mail I got was 330k.

/PeO

 That would be good.  For the archive, Scott mentioned that it is so large now that 
it does not fit on a CD-ROM.  Perhaps if we compressed it?  Scott?
 
 -Carl
 
 At 10/10/00 08:25 PM -0500, you wrote:
 Carl-
 
 So long as the list continues to send e-mail to the eScribe archive, I'm all 
 for it (smart search engine there.)
 
 Also, is there any way you can make all past messages available in some kind 
 of package? I could then update the eScribe archive with messages before July 
 2000.
 
 -Ryan
 
 It's great to have so much activity happening with REBOL these days.  
 Unfortunately, our servers are overloading.  We're starting to have gigabyte 
 days.  While it is good to have all this activity, it is making life 
 difficult for a few folks around here. What would you think if we were to 
 move this main list to a site like egroups.com? That would also give you web 
 access to archives, file lists, and other features.
 
 Your thoughts?
 
 -Carl
 
 
 
 
 
 




[REBOL] read (url)

2000-10-09 Thread peoyli


how do I read the following URL using REBOL ?

http://www3.aftonbladet.se/tv/kanaler.asp?chID=27

It generates an "Internal Server Error" using at least REBOL, wget
and Lynx..

..so trying to get it manually:

solarisbox-1:[~]# telnet www3.aftonbladet.se 80
Trying 212.112.180.18...
Connected to www3.aftonbladet.se.
Escape character is '^]'.
GET /tv/kanaler.asp?chID=27
HTTP/1.1 500 Internal Server Error
Server: Microsoft-IIS/5.0
Date: Mon, 09 Oct 2000 17:08:07 GMT
Connection: Keep-Alive
Content-Length: 292
Content-Type: text/html
Set-Cookie: TV=GUID=63444862610%2F9%2F2000+7%3A08%3A08+PM; path=/
Set-Cookie: ASPSESSIONIDGGQQQWAY=CPKOANFCDKGNMPOJEEMCAAKL; path=/
Cache-control: private
 
 font face="Arial" size=2
pMicrosoft VBScript runtime /font font face="Arial" size=2error '800a000d'
/font
p
font face="Arial" size=2Type mismatch: 'Response.Cookies(...).Expires'/font
p
font face="Arial" size=2//global.asa/fontfont face="Arial" size=2, line 33
/font Connection closed by foreign host.
solarisbox-1:[~]#

It seems like it wants to set a cookie, and refuses to show the page
if it fails..

Any idea on how to solve this one ?

/PeO




[REBOL] View 0.10.38 for the rest of us ?

2000-10-09 Thread peoyli


only the Amiga and the BeOS platform does not yet have the new
REBOL/View, and xpers page was last updated a week ago..

still waiting for the new (Amiga) version...

/PeO




[REBOL] creation of a block with a lot of integers Re:(4)

2000-10-07 Thread peoyli

 Thanks for the numbers!
 
Here's some more tests..

I did the same test using perl, and its native .. range operator:

5   10  20  40
20001-7 20001-1220001-2220001-42
REBOL5s 10s 20s 41s
Perl 1s  3s  8s 15s

11  11
-5 - 5  -15 - 5
REBOL   10s 10s
Perl 5s  4s

I can run a test in assembly language too, but I think it will be too
fast to be timed even with 40 values...

Maybe REBOL could need a native range operator anyway (I've seen that
discussion some time ago) ?

/PeO

 [EMAIL PROTECTED] wrote:
  
   Hi, peoyli,
  
  ...
  
   It would be interesting to have you try a couple of the above options
   along with your original  for  version and post the timings, if you
   have the spare time.
  
   -jn-
  
  Ok,,
  
  here comes my test results, along with the code being tested..
  


#!/usr/local/bin/perl

intblock(20001, 25000);
intblock(20001, 7);
intblock(20001, 12);
intblock(20001, 22);
intblock(20001, 42);
intblock(-5, 5);
intblock(-15, -5);


sub intblock
{
  my($min,$max) = @_;
  local($len_a,$tim1);

  $tim1 = time();
  @a = ($min..$max);
  print "\nElapsed time: ", time() - $tim1, " seconds\n";

  $len_a = @a;
  print "Size of array: $len_a\n";
  print "Array's first value: $a[0]\n";
  print "Array's last value: $a[$len_a - 1]\n";
}



[REBOL] creation of a block with a lot of integers Re:(2)

2000-10-06 Thread peoyli

 Hi, peoyli,
 
...
 
 It would be interesting to have you try a couple of the above options
 along with your original  for  version and post the timings, if you
 have the spare time.
 
 -jn-

Ok,,

here comes my test results, along with the code being tested..

Method 0: 1st try: unallocated block, for-loop, insert
Method 1: 2nd try: allocated block, for-loop, insert tail
Method 2: 3rd try: allocated block, modified iota to accept a minimum value 
(repeat-loop)
Method 3: 4th try: allocated block, map iota... (repeat-loop)
Method 4: 5th try: allocated block, filter iota / range...
Method 5: 6th try: allocated block, fromto function... (while-loop)


Summary:
Method 0 is slow (only timed with 5000 values)
Method 2 is twice as fast as method 1 (repeat vs. for)
Method 3 always gave incorrect result or failed otherwise (and was also twice as slow 
as method 1)
Method 4 did not work with negative values, and was about as slow as method 3
Method 5 is almost as fast as method 2

Method 2 (3rd try)  Method 5 (6th try) are those who produce the
desired result, and is most efficient.

num of values
range

50005   10  20  40
20001-25000 20001-7 20001-1220001-2220001-42
Method
0   0:00:34 -   -   -   -
1   0:00:01 0:00:10 0:00:19 0:00:38 -
2   0:000:00:05 0:00:10 0:00:20 0:00:41
3   *1) 0:00:17 *2) 0:00:37 *2  0:01:16 *2) -
4   0:00:05 0:00:17 0:00:30 0:00:59 -
5   0:000:00:05 0:00:11 0:00:24 0:00:46

11  11
-5 - 5  -15 - -5
0   -   -
1   0:00:20 0:00:18
2   0:00:10 0:00:10
3   0:00:37 *3) 0:00:38 *3)
4   0:00:13 *4) *5)
5   0:00:11 0:00:11


*1) Script Error (caused by the result printing, block size = 0)
27.Work:Programming/REBOL_core_2.3 rebol -q ../REBOL/intblock.r 20001 25000 3
0:00:014th try: allocated block, map iota...
Size of block:  0
** Script Error: Out of range or past end.
** Where: first b


*2) Incorrect result
27.Work:Programming/REBOL_core_2.3 rebol -q ../REBOL/intblock.r 20001 7 3
0:00:174th try: allocated block, map iota...
Size of block:  3
Block's first value:  20001
Block's last value:  5

27.Work:Programming/REBOL_core_2.3 rebol -q ../REBOL/intblock.r 20001 12 3
0:00:374th try: allocated block, map iota...
Size of block:  8
Block's first value:  20001
Block's last value:  10

27.Work:Programming/REBOL_core_2.3 rebol -q ../REBOL/intblock.r 20001 22 3
0:01:164th try: allocated block, map iota...
Size of block:  18
Block's first value:  20001
Block's last value:  20

*3) Incorrect result
intblock -5 5 3
intblock -15 -5 3
0:00:374th try: allocated block, map iota...
Size of block:  11
Block's first value:  1
Block's last value:  11

*4) Incorrect result
intblock -5 5 4
0:00:135th try: allocated block, filter iota / range...
Size of block:  5
Block's first value:  1
Block's last value:  5

*5) Script Error (caused by the result printing, block size = 0)
0:005th try: allocated block, filter iota / range...
Size of block:  0
** Script Error: Out of range or past end.
** Where: first b



REBOL []

; Parameters: num, min
iota_mod: function [n [integer!] min [integer!]] [r i] [
r: make block! n
repeat i n [insert tail r i + min - 1]
r
]

; Parameters: num
iota: function [n [integer!]] [r i] [
r: make block! n
repeat i n [insert tail r i]
r
]

map: function [[catch] b [block!] f [any-function!]] [r v] [
r: make block! length? b
foreach c b [
if found? v: do [f c] [insert/only tail r v]
]
r
]

filter: function [
[catch] b [block!] f [any-function!]
][
r v
][
r: make block! length? b
foreach c b [
if do [f c] [insert/only tail r c]
]
r
]

range: func [lb [integer!] ub [integer!]] [
filter iota ub func [n] [n = lb]
]

fromto: function [lb [integer!] ub [integer!]] [r] [
r: make block! (ub - lb + 1)
while [lb = ub] [insert tail r lb  lb: lb + 1]
r
]

intblock: func [
"Create an array with a range of integers"
min [integer!] "The lowest number to include"
max [integer!] "The highest number to include"
meth [integer!] "Method of creating block with values"
/local temp
][
if min  max [temp: min min: max max: temp]
num: max - min + 1

switch meth [
  ; 1st try: unallocated block, for-loop, insert
  0 [
tim1: now/time
b: [] clear b
for temp min max 1 [ insert b temp ]; Generate array with valid numbers
print reduce [now/time - tim1 "   

[REBOL] creation of a block with a lot of integers

2000-10-05 Thread peoyli


Hi,

Is there a efficient way of creating a block consisting of a range of
integers..

using a for-loop is ok for a small amount of values, but when reaching
1000 values, it takes about 2 seconds on a 060 equipped Amiga, 2000
values takes about 8 seconds, and so on...

also.. is this supposed to function like this (local variable is not
cleared between function calls) ?

REBOL []

maybe-bug: func [
  min [integer!]
  max [integer!]
  /local testblock temp
][
  testblock: []
  for temp min max 1 [ insert testblock temp ]
  testblock
]

 do %../REBOL/bug.r
Script: "Untitled" (none)
 maybe-bug 1 5   
== [5 4 3 2 1]
 maybe-bug 1 5
== [5 4 3 2 1 5 4 3 2 1]
 maybe-bug 1 5
== [5 4 3 2 1 5 4 3 2 1 5 4 3 2 1]
 

A work-around, appending a 'clear testblock' after the testblock: []
will fix this, but shouldn't testblock: [] do it in the first place ?

/PeO




[REBOL] Re: irc Re:

2000-09-14 Thread peoyli

 Hello list,tried rebol-irc.r and connected-then I connected using AmIRC on
 the Amiga to see what a version check would show.Much to my suprise I did
 not show up as being connect to the channel.Ideas?No big deal was just
 curious what version would show.This from rebol-ittc.r console:
 Loading configuration...
 Server: irc.elric.net:6667
 Username: alanwall
...


   --|You have joined channel ##team*Amiga.
   «Names»|Users on ##team*Amiga: @alanwall
   «Names»|##team*AmigaEnd of /NAMES list.
 324 alanwall ##team*Amiga +
«Mode»|Channel ##team*Amiga was created on 14-Sep-2000 19:56:40

edit your RebIRC.rc file and remove the "#" before the channel name,
and it should work..

Also, this (early, experimental whatever) version of RebIRC does not handle
many entered commands (the only aliases to the RAW commands I have created
is /leave as an alias for part, and a shortened /part so that you don't
have to use /part #channel)

/PeO




[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(7)

2000-09-08 Thread peoyli


...but then, your message, arriving at my mailbox 12 seconds after the
one you copied the X-SELMA number from has the field

X-SELMA: [REBOL] 342011

in the header..

I did not get those 84 messages in between..

/PeO

 there is a "gimme message" - command somewhere @ selma?
 and in the 
 X-SELMA: [REBOL] 341927
 in the mail-header is a number..
 look your missing numbers and write a script..
 and tell me this selma - command , somewhere in deep space HD here ..
 
 Volker
 




[REBOL] I give up Re:(4)

2000-09-08 Thread peoyli


I've done a client too, it is available at http://www.algonet.se/~peoyli/RebIRC,
but its code needs some more work..

I mostly wrote this to learn Rebol and the IRC protocol, and it was meant to be
a bot that jumps into a channel and gets the userlist and leaves again (to make
the channel's people's page more interesting)..

My solution to the PING/PONG stuff was something like..

handle-irc-cmd: func [] [
  switch/default/case irc/command reduce[
"PING" [
  insert irc-port rejoin ["PONG " (first irc/params) newline]
  prin #"^G"
]
...

with "irc" being an object which consists of

irc-obj: make object! [
  prefix: make object! [full: nick: user: host: string!]
  command: string!
  params: block!
]

(as described in the RFC)

/PeO

 
 I've done a whole IRC client in REBOL, but not in position to release it in
 total.  It was quite a while ago, so I need lots of head scratching to go
 back and figure things out... but will help if you're REALLY stuck.
 
 Russ
 




[REBOL] IRC Protocol (I give up ) Re:(6)

2000-09-08 Thread peoyli


 Is this line "prefix: make object! [full: nick: user: host: string!]"
 supposed to be replaced with the actual nick user  and host portions or is
 this proper syntax!
 
 Paul Tretter
 

I use this object to store a parsed RAW line from the IRC server (a
call to a parse-irc-str function I wrote for this purpose).

'full' contains the whole prefix from the string sent by the server, and
the rest of the prefix object contains the actual parts of the prefix.

From the RFC:

   Each IRC message may consist of up to three main parts: the prefix
   (optional), the command, and the command parameters (of which there
   may be up to 15).  The prefix, command, and all parameters are
   separated by one (or more) ASCII space character(s) (0x20).

   The presence of a prefix is indicated with a single leading ASCII
   colon character (':', 0x3b), which must be the first character of the
   message itself.

...
message  ::= [':' prefix SPACE ] command params crlf
prefix   ::= servername | nick [ '!' user ] [ '@' host ]

It could be nice to have a REBOL function to actually parse (any)
whole 'pseudo' BNF formatted description..

/PeO




[REBOL] IRC Re:

2000-09-06 Thread peoyli


Hi,

You could take a look at http://www.algonet.se/~peoyli/RebIRC, or..

do %http://www.algonet.se/~peoyli/RebIRC/RebIRC.r

in the REBOL console.

It's far from completed, but it is useable, and supports a couple of
CTCP commands as well (VERSION TIME PING CLIENTINFO ACTION SOURCE).

 Has anyone made a client for IRC or know the handshaking involved.  Is it
 possible to create an IRC client with REBOL?
 
 

/PeO




[REBOL] IRC Re:(3)

2000-09-06 Thread peoyli

 Hello [EMAIL PROTECTED]
 
 Tried do %http://www.algonet.se/~peoyli/RebIRC/RebIRC.r and did not work
 but
 do http://www.algonet.se/~peoyli/RebIRC/RebIRC.r did.Is there a server set
the % was a typo by me

 up for Rebol irc?Remember to have run across 1 but don't remember where

If you are asking for a #rebol channel, there is one on DALnet. Also,
a 'webchat'-like thingy exists at http://www.rebol.org/cgi-bin/cgiwrap/chat.r
but I have never seen anyone using it.

/PeO




[REBOL] Announcing: REBOL FOR DUMMIES Re:(2)

2000-09-02 Thread peoyli


At least for me, the main reason for buying this book (and all other
REBOL books) is to support Carl, Ralph, Elan, REBOL, and REBOL Press.

These books are about $20 cheaper in sweden, but I think it is worth
buyinf from REBOL Press/Alexander Books anyway.

/PeO


 Hey, I'm a dummy! That's why I'm going to buy this book! Thanks, Ralph!
 
  REBOLs aren't dummies. But they know folks who are! g
  
  Announcing the pre-publication sale of REBOL FOR DUMMIES by Ralph
  Roberts. Take a look at the contents and sample chapter (on CGI) at
  http://www.REBOLpress.com. Then pass this link on to your friends and
  co-workers who need to join the REBOLution.
  

-- 
/*  P-O Yliniemi, Bizlink Systems  Development AB   *\
\* [EMAIL PROTECTED] | Solaris (SunOS 5.6-5.8), Perl, REBOL | [EMAIL PROTECTED] */
/* +46-70-4663336 |   CGI, (S)HTML, PHP, sql |+46-70-5685919 *\
\*| Apache, qmail, squid, BIND, IPFilter |+46-911-205474 */




[REBOL] One disk OS + REBOL Re:(3)

2000-08-17 Thread peoyli


Hi,

Maybe QNX would be useable for this.. but.. not even REBOL/Core is
available for Neutrino/RTOS yet...

Maybe QNX could put together a new demodisk which will fit REBOL/View
and some scripts if REBOL Tech asks them (I didn't even have to ask for
something..)

/PeO

 An Amiga would would be awesome, but unfortunately this is a mass production
 lowest cost type of thing.
 
 If I could get /View running on a floppy I would go into an ecstatic seizure
 of convulsionary back flips.
 
 --Ryan
 




[REBOL] unixtime

2000-08-16 Thread peoyli

Hi,

I have written some routines unix time to human readable time and the
other way around.. but..

ah.. the routines seems to work now (I can't remember what I
changed).. The problem was that 

 print unixtime-to-time time-to-unixtime now print now
16-Aug-2000/15:29:11+1:00
16-Aug-2000/15:29:12+1:00

returned alot different times (about 2 minutes in difference)..

/PeO


-- 
/*  P-O Yliniemi, Bizlink Systems  Development AB   *\
\* [EMAIL PROTECTED] | Solaris (SunOS 5.6-5.8), Perl, REBOL | [EMAIL PROTECTED] */
/* +46-70-4663336 |   CGI, (S)HTML, PHP, sql |+46-70-5685919 *\
\*| Apache, qmail, squid, BIND, IPFilter |+46-911-205474 */



REBOL []

unixtime-to-time: func [
  {Convert from unix time to human readable date/time}
  unixtime [integer!] "Seconds since 1-Jan-1970 0:00"
  /local days resttime
] [
  days: unixtime / 3600 / 24
  resttime: to-time rejoin ["0:0:" to-integer (days - to-integer days) * 3600 * 24]
  return to-date rejoin [
(01-Jan-1970 + to-integer days) "/" (resttime + now/zone)
either negative? now/zone [ rejoin ["-" now/zone]] [ rejoin ["+" now/zone]]
]
]

time-to-unixtime: func [
  {Convert from human readable date/time to unix time}
  date [date!] "Date/time to convert"
  /local daysec
] [
  date: date
  daysec: (date - 1-Jan-1970) * 3600 * 24
  if date/time [date: date - date/zone daysec: daysec + (date/time/hour * 3600) + 
(date/time/minute * 60) + (to-integer date/time/second)]
  return daysec
]



[REBOL] digests of REBOL list messages Re:(2)

2000-08-14 Thread peoyli


This page is not really what I'm looking for.. I'm looking for a kind
of archive of messages as you (previously) got by sending an empty
mail to a specified address ([EMAIL PROTECTED]),
which returned messages in archives of a hundred at a time.

/PeO


 http://www.rebol.org/userlist/html/index.html
 
 I think that is what you are after.
 
 Brett
 
 - Original Message - 
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, August 14, 2000 9:45 AM
 Subject: [REBOL] digests of REBOL list messages
 
 
  
  Hi,
  
  Are the digests of the messages sent to this list still available ?
  




[REBOL] digests of REBOL list messages

2000-08-13 Thread peoyli


Hi,

Are the digests of the messages sent to this list still available ?

For the moment, the lists.rebol.com server seems to be non-existent
(offline or dead or something)..

I have all the messages from the start up to 2400 collected in files
of 100 messages/each, and the rest of the mails in my mail prog...

/PeO




[REBOL] official guide Re:(2)

2000-03-16 Thread peoyli


The book will NOT be available in April... according to a mail I got
from Amazon today:

Greetings from Amazon.co.uk.
Regarding your order for "Rebol : The Official Guide (Corel Press)" ,
we have contacted the publisher for an update on this item.
Unfortunately, they have informed us that the publication date has been delayed
and this book is now scheduled to be released in June 2000.
...
For your reference, here is a summary of order #026-xxx-xxx:
  0 of "Rebol : The Official Guide (Corel Press)"
Elan Goldman
 Item #: 007212279X
Order time availability: Not yet published
 Current status: (CANCELLED)

/PeO


 Hi Ryan
 
 The release date is listed as April 2000. You can read three
chapters here:
 
 http://www.pbg.mcgraw-hill.com/betabooks/feb00/goldman/index.html
 
 HTH
 
 Larry
 
 
 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, March 14, 2000 9:12 AM
 Subject: [REBOL] official guide
 
 
  Has anyone gotten their hands on the REBOL Official Guide yet?
 
  I ordered it through Barnes  Noble two weeks ago and they are
having
  trouble getting a copy.
 
  I am wondering how it is written (i.e. what level of programming
knowledge
 is
  the reader expected to have?)
 
  Also, does the book cover parse pretty well?  And how about CGI? 
Are
 there
  a lot of useful scripts on the CD-ROM?
 
  Thanks.
 
  Ryan Christiansen
  Consultant
  SEI Information Technology
 
 
 



[REBOL] hostname parse rule Re:(4)

2000-02-15 Thread peoyli

 Hi /PeO
...

These were the rules I was using...

let-char: charset[#"a" - #"z" #"A" - #"Z"]
let-digit-char: charset[#"a" - #"z" #"A" - #"Z" #"0" - #"9"]
let-digit-hyph-char: charset[#"a" - #"z" #"A" - #"Z" #"0" - #"9" #"-"]

 The problem is combining them to a working ruleset...
 
 The problem is how you formulate your specification. You say:
 ; may have any number of letters, digits and
 ; hyphens in between, but this sequence must
 ; end with a letter or digit if it exists
 
 This is too general. You need to redefine your rules so that you precisely
 state that a hyphen - if it occurs - must be followed by a letter or digit.
 I.e., I believe you have a let-digit-char rule, your let-digit-hyph-char
 rule then must be:
 
The hyphen must not be followed by a letter or a digit unless it is the
first of the two last characters.. According to the RFC "a--a" should be a
valid host name (part)... 

BNF rule was.. (not retyped from the RFC, but what I want to implement as a
parse rule)..

let-char [*[let-digit-hyph-char] let-digit-char]

with "[" and "]" marking optional parts as in BNF

That is.. valid host names begins with a letter, ends with a letter or a
digit (which could be the same as the first letter, since one-character
host names are allowed), in between there could be any number of letters,
digits and hyphens in any order.

 let-digit-hyph-char: [ "-" let-digit-char]
 
That rule will require every hyphen to be followed by a letter or a digit..

 This rule only evaluates to true if a hyphen is immediately followed by a
 character. It permits that a hyphen appear, provided that the hyphen is
 followed by a an obligatory character and thereby excludes the possibility
 of a trailing hyphen.
 
 Hope this helps
 
 
 ;- Elan  [: - )]
 
 



[REBOL] hostname parse rule Re:(2)

2000-02-13 Thread peoyli

  name-rule: [let-char [none | [[some let-digit-hyph-char] let-digit-char]]
 to end]
 
 Try:
 let-char any [let-digit-hyp=char]
 instead.
 
The problem will be that it would then accept a "-" as the last character
in a part of the hostname...

Valid names are these starting with a letter, followed by an optional part
consisting of any number of letters and "-":es, but must end with a letter
or digit...

The problem with my original rule was that the
[some let-digit-hyph-char]

part matched all the way up to the end of the string that I tried to
parse.. (some should be "any", but that didn't help)

I came up with this rule that seems to be working:

name-rule: [ let-char [[any [[let-digit-hyph-char] let-digit-char]] | none]]

 parse "a" name-rule
== true
 parse "1" name-rule
== false
 parse "a-" name-rule
== false
 parse "a-1" name-rule
== true
 parse "aaa-1" name-rule
== true

/PeO



[REBOL] REBOL IRC client.. kind of..

2000-02-13 Thread peoyli


Far from completed, but it works.. :)

http://www.algonet.se/~peoyli/RebIRC/

For now, it reloads the server command handler and console input handler
for each line it processes (slow, but useful while developing it)..

/PeO



[REBOL] hostname parse rule Re:(2)

2000-02-13 Thread peoyli

 Hello [EMAIL PROTECTED]!
 
 On 13-Feb-00, you wrote:
 
 
  p hname-rule: [name-rule some ["." name-rule]] name-rule:
  p [let-char [none | [[some let-digit-hyph-char] let-digit-char]]
  p to end]
 
  p The problem is that it returns "true" too often...
 
 This is caused by the "to end" above. It should work if you remove
 it.

Removing the "to end" did break the rule even more...

 name-rule: [let-char [none | [[some let-digit-hyph-char] let-digit-char]]]
 parse "a" name-rule   
== true
OK  a single letter hostname part is ok

 parse "a1" name-rule
== false
ERR!two chars which the first one is a letter and the last is
letter or digit is ok

 parse "a1a" name-rule
== false
ERR!should be ok

replacing "some" with "any" above caused the same error..

And.. the rule I came up with that I posted earlier...

name-rule: [ let-char [[any [[let-digit-hyph-char] let-digit-char]] | none]]

didn't work with a two character name...

If I break down the rules...

; name must start with a letter
let-char

; may have any number of letters, digits and
; hyphens in between, but this sequence must
; end with a letter or digit if it exists
0 1 [any let-digit-hyph-char let-digit-char]

The problem is combining them to a working ruleset...

parse "a" name-rule should return "true"
parse "a1" name-rule should return "true"
parse "aa" name-rule should return "true"
parse "a-" name-rule should return "false"
parse "a-1" name-rule should return "true"

/PeO



[REBOL] hostname parse rule

2000-02-12 Thread peoyli



Tried to translate BNF

 hname ::= name*["."name]
 name  ::= let[*[let-or-digit-or-hyphen]let-or-digit]

to a parse rule...

let-char: charset[#"a" - #"z" #"A" - #"Z"]
let-digit-char: charset[#"a" - #"z" #"A" - #"Z" #"0" - #"9"]
let-digit-hyph-char: charset[#"a" - #"z" #"A" - #"Z" #"0" - #"9" #"-"]

hname-rule: [name-rule some ["." name-rule]]
name-rule: [let-char [none | [[some let-digit-hyph-char] let-digit-char]] to end]

The problem is that it returns "true" too often...

 parse "a" name-rule
== true
OK  match first let-char, and none

 parse "-" name-rule
== false
OK  does not match the first required let-char

 parse "a-1" name-rule
== true
OK  match the first let-char, the allowed extra chars, and the required
letter or digit at the end

 parse "asdfg" name-rule
== true
OK  match the first let-char, and allowed extra letters digits or
hyphens, last character is a let-char, so that is ok

 parse "asdfg-" name-rule
== true
ERR!last character is not one of the allowed ones

 parse "a%$#" name-rule  
== true
ERR!none of the characters following the "a" are allowed

The result of the rule seems to be like I have written it as
any-char: complement charset[""]
name-rule: [let-char [none | [some let-digit-hyph-char]] to end]

What is wrong with the rule generating the too-many true's ?

/PeO



[REBOL] What Type Of Apps Are You Writting? Re:

2000-02-10 Thread peoyli


I'm working on a for-now text based IRC client, will eventually support the
full ctcp2 specification (does handle VERSION,TIME,PING,CLIENTINFO,ACTION
and SOURCE for now).

I will probably make a GUI for it with REBOL/View when it is available for
the Amiga.

/PeO

 What type of applications are you using REBOL for?
 
  ___
  EdGrant.Com
 
 



[REBOL] ANSI stuff..

2000-02-10 Thread peoyli


Comments, optimizations, ideas, fixes etc. welcome (actually another
set of functions for my wannabe-IRC-client)...

/PeO



REBOL [
  Title: "ANSI colors"
]

escape: func [parm [string!]][join "^(1B)[" parm]

get-scr-dims: func [
"Stores the console dimensions in screen-size block (height, width)"
/local cons
][
cons: open/binary [scheme: 'console]
prin escape "7n" parse to-string copy cons [thru "[" copy screen-size to "R"]
screen-size: parse (to-string screen-size) ";"
close cons
]

comment {
irc color   ansi color (EPIC)
 0: white   white bold
 1: black   black
 2: navyblue
 3: green   green
 4: red red
 5: maroon  yellow!
   6: purplepurple
   7: orangered bold
 8: yellow  yellow bold
   9: lime  green bold
10: tealcyan
11: aquaaqua bold
12: blueblue bold
13: fuchsia purple bold
14: greyblack bold
15: silver  white plain
}

ansi: func [
attributes [block!]
] [
bg: "4"
 fg: "3"
reset: bold_off: underline_off: reverse_off: blink_off:"0"
bold_on: bold: "1"  underline_on: underline: "4"
blink_on: blink: "5"reverse_on: reverse: "7"

black: "0"  red: "1"green: "2"  yellow: "3"
 blue: "4"
magenta: "5"purple: "5" cyan: "6"   aqua: "6"  
 white: "7"

if error? try [
return rejoin["^(1B)[" (get first attributes) (get second attributes) 
"m"]
][
return rejoin["^(1B)[" (get first attributes) "m"]
]
]

strip-ansi: func[ansitext /local strippedtext] [
strippedtext: copy ansitext
ansi-rule: [to "^(1B)[" copy ansicode thru "m" (replace strippedtext ansicode 
"")]
parse/all ansitext [some ansi-rule to end]
return strippedtext
]

ansitext: join "Normal " [ansi[underline_on] "underline" ansi[reset] ansi[fg red] " 
Red " ansi[bg white] " Red on White " ansi[reset]]
ansitext: join ansitext [ansi[bold_on] "Bold" ansi[fg blue] " Blue bold " ansi[fg 
purple] ansi[bg green] " Purple bold on green " ansi[reset]]

strippedtext: strip-ansi ansitext
print length? strip-ansi ansitext
print length? strippedtext
print strippedtext
print length? ansitext
print ansitext



[REBOL] script path..

2000-02-09 Thread peoyli


Is it possible to get a script's full path from within a script ?

I need this function to load some files to include...

test.r is stored on my local webserver at 172.16.16.1...

REBOL []
scriptpath: ; how-do-i-get-this
includefile: head insert tail :scriptpath 'include.r
do includefile
...

I want the scriptpath set to the full path of the script file, remote or
local (that's is in my case http://172.16.16.1/ for the remote location)

I have checked through the system object, but couldn't find anything useful
there...

/PeO



[REBOL] switch using word as values ? Re:(4)

2000-02-09 Thread peoyli

  I think my case sensitive switch was the clearer one (and also shorter)...
 
For further refinements, your solution is the better one. My version was
just a 2-second-needed-that-function fix :)

/PeO

 Ah, but if you were to put through more of the refinements of 'select, like
 '/any or '/part as well, which would be shorter, correct and easier to
 understand?
 



[REBOL] switch using word as values ?

2000-02-08 Thread peoyli


Just can't find out what's wrong

Two examples in the included source, the first, "checkcmd" uses words for
the switch cases, the other uses strings..

Also included is my addition to the switch function (but that itself is not
the one causing this problem)

This source does no no way reflect the current state of my IRC client (I
just wanted to make the source more readable using words instead of
strings) :)

/PeO


-- 
/* PeO - AMiGA owner since 1990, CGI, Perl, Assembly language  HTML-fanatic *\
\*   Amiga 4000TE/060-50/604e 200, 146Mb, 33.4Gb, ZIP, JAZ, CVPPC/8  */
/* IIyama VM Pro 21", CP-SW2 Subwoofer system, NEC-222   *\
\* Plextor 12-Plex, Yamaha CRW 4416S, Artec A6000C+, Stylus Color 500*/
/*Lightfax 3660, Catweazel Z-II (3*IDE, 1*PC Floppy), Minolta DImage V   *\
\*  SCSI-Tower, Seagate Tapestor 4/8GB, Ariadne Ethernet, Minolta PagePro 6  */



REBOL []

RPL_WELCOME: "001"
RPL_YOURHOST: "002"
RPL_CREATED: "003"
RPL_MYINFO: "004"
RPL_BOUNCE: "005"

switch: func [
"Selects a choice and evaluates what follows it." 
value "Value to search for." 
cases [block!] "Block of cases to search." 
/default case "Default case if no others are found."
][
either value: select cases value [do value] [
either default [do case] [none]]
]

switch2: func [
"Selects a choice and evaluates what follows it." 
value "Value to search for." 
cases [block!] "Block of cases to search." 
/default case "Default case if no others are found." 
/cs "Do a case-sensitive search"
][
either 
either cs [value: select/case cases value] [value: select cases value] [
do value
] [
either default [
do case
] [
none
]
]
]

checkcmd: func [command [string!]] [
print reform ["type? command:" type? command]
print reform ["command:" command]

switch/default command [
RPL_WELCOME [
print "welcome"
]
RPL_YOURHOST [
print "yourhost"
]
RPL_CREATED [
print "created"
]
RPL_MYINFO [
print "myinfo"
]
RPL_BOUNCE [
print "bounce"
]
][
print "other command"
]
]

checkcmd2: func [command [string!]] [
print reform ["type? command:" type? command]
print reform ["command:" command]

switch/default command [
"001" [
print "welcome"
]
"002" [
print "yourhost"
]
"003" [
print "created"
]
"004" [
print "myinfo"
]
"005" [
print "bounce"
]
][
print "other command"
]
]

print ""
print "Output from checkcmd RPL_WELCOME"
checkcmd RPL_WELCOME

print ""
print "Output from checkcmd2 RPL_WELCOME"
checkcmd2 RPL_WELCOME



[REBOL] switch using word as values ? Re:(2)

2000-02-08 Thread peoyli

 /PeO wrote:
  Just can't find out what's wrong
 
  Two examples in the included source, the first, "checkcmd" uses words for
 the switch cases, the other uses strings..
 
  Also included is my addition to the switch function (but that itself is
 not the one causing this problem)
 
 Put 'reduce before your case block.
 
 So instead of this:
 switch/default command [
 
 do this:
 switch/default command reduce [
 ; blah blah blah.

I figured that out a couple of hours ago, thanx anyway

 Also, instead of this:
 RPL_WELCOME [
 print "welcome"
 this is easier:
 print switch/default command [
 RPL_WELCOME [
 "welcome"
 

The print stuff was only for the test program, in the real program alot of
more things are done for each command.

 And, for case sensitive switch, this is clearer:
...
I think my case sensitive switch was the clearer one (and also shorter)..
The only thing that really is wrong with it is calling the case-sensitive
switch for /cs (since case was already in use by REBOL's own switch
function).. Anyway, that's a problem that is easy to correct...

/PeO



[REBOL] New Rebol Newsgroup Re:(2)

2000-02-04 Thread peoyli


Hmm.. at least someone is working on an IRC client written in REBOL.. :)

I will release it to the list at some point when I feel it is useable
enough :) (maybe someone could turn it into a protocol.. )

/PeO -- :)

 When will we get to see an IRC channel for Rebol programmers? There are
 times when I sure could use some instant help.
 
 
 Best Regards
 Stefan Falk ([EMAIL PROTECTED])
 Scandinavian Leisure Group IT Support
 Phone: +46-8-55513449
 Mobile: +46-709513449
 
 
  -Original Message-
  From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
  Sent:   Friday, February 04, 2000 3:41 AM
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Subject:[REBOL] New Rebol Newsgroup
  
  I have started a Rebol Newsgroup.  Please join in and start the posts!
  Have
  fun.  Here are the details.
  
  nntp server: private.charter-stl.com
  newsgroup: rebol.discuss
  
  I have setup the server to allow other servers to pull the newsgroups.
  
  Enjoy and let me know your recommendations.
  
  Paul Tretter
  Paul's Rebol Page (Rebol Search Engine)
  http://24.217.20.110/rebolsearch/rebol.htm
  
  
 
 

-- 
/* PeO - AMiGA owner since 1990, CGI, Perl, Assembly language  HTML-fanatic *\
\*   Amiga 4000TE/060-50/604e 200, 146Mb, 33.4Gb, ZIP, JAZ, CVPPC/8  */
/* IIyama VM Pro 21", CP-SW2 Subwoofer system, NEC-222   *\
\* Plextor 12-Plex, Yamaha CRW 4416S, Artec A6000C+, Stylus Color 500*/
/*Lightfax 3660, Catweazel Z-II (3*IDE, 1*PC Floppy), Minolta DImage V   *\
\*  SCSI-Tower, Seagate Tapestor 4/8GB, Ariadne Ethernet, Minolta PagePro 6  */



[REBOL] pdf again Re:(3)

2000-02-03 Thread peoyli


For those who wants to put together a single-pdf user's guide using htmldoc

You will have to use 'tidy' on the html files, otherwise at least the
Solaris version of htmldoc will crash.

I have also uploaded my converted docs (for A4 printing) to
http://fenris.campus.luth.se/~peoyli/rebolpdf

/PeO


 I just made .pdfs for myself and thought I would share.  I don't know 
 how to combine .pdfs, really.  I used Acrobat at work on a machine I 
 have limited access to.  Sorry I couldn't help you more.
 
 -Ryan
 
 Can you wrap this into one .pdf ragher than dozens?
 Len
 ===due to bandwidth restrictions, I have moved the rebol user 
 guide and
 dictionary to an unlimited bandwidth site at
 
 http://www.beosjournal.com/rebol/rebolpdf.zip
 
 
 
 

-- 
/* PeO - AMiGA owner since 1990, CGI, Perl, Assembly language  HTML-fanatic *\
\*   Amiga 4000TE/060-50/604e 200, 146Mb, 33.4Gb, ZIP, JAZ, CVPPC/8  */
/* IIyama VM Pro 21", CP-SW2 Subwoofer system, NEC-222   *\
\* Plextor 12-Plex, Yamaha CRW 4416S, Artec A6000C+, Stylus Color 500*/
/*Lightfax 3660, Catweazel Z-II (3*IDE, 1*PC Floppy), Minolta DImage V   *\
\*  SCSI-Tower, Seagate Tapestor 4/8GB, Ariadne Ethernet, Minolta PagePro 6  */



#HTMLDOC 1.8.4
99
users-guide/users.html
users-guide/users/opeintro.html
users-guide/users/operunning.html
users-guide/users/opesetup.html
users-guide/users/opeconsole.html
users-guide/users/opehelp.html
users-guide/users/opequit.html
users-guide/users/opeloading.html
users-guide/users/opeerrors.html
users-guide/users/opeupgrade.html
users-guide/users/expintro.html
users-guide/users/expabout.html
users-guide/users/expevaluation.html
users-guide/users/expcondition.html
users-guide/users/exprepeat.html
users-guide/users/expselection.html
users-guide/users/expwords.html
users-guide/users/expfunctions.html
users-guide/users/expobjects.html
users-guide/users/scrintro.html
users-guide/users/scrfiles.html
users-guide/users/scrstruct.html
users-guide/users/scrblocks.html
users-guide/users/scrcomments.html
users-guide/users/scrstyle.html
users-guide/users/serintro.html
users-guide/users/serabout.html
users-guide/users/sermake.html
users-guide/users/sertraverse.html
users-guide/users/sercommon.html
users-guide/users/serextract.html
users-guide/users/sersearch.html
users-guide/users/sermodify.html
users-guide/users/sercopy.html
users-guide/users/sersort.html
users-guide/users/serstrings.html
users-guide/users/serblocks.html
users-guide/users/matintro.html
users-guide/users/matbasic.html
users-guide/users/matadvanced.html
users-guide/users/matlogic.html
users-guide/users/matcompare.html
users-guide/users/matbitsets.html
users-guide/users/filintro.html
users-guide/users/filnames.html
users-guide/users/filread.html
users-guide/users/filwrite.html
users-guide/users/filconvert.html
users-guide/users/fillines.html
users-guide/users/filinfo.html
users-guide/users/fildir.html
users-guide/users/filports.html
users-guide/users/filcontrol.html
users-guide/users/netintro.html
users-guide/users/netURLs.html
users-guide/users/nethttp.html
users-guide/users/netftp.html
users-guide/users/netsmtp.html
users-guide/users/netpop.html
users-guide/users/netdns.html
users-guide/users/netdaytime.html
users-guide/users/netfinger.html
users-guide/users/netwhois.html
users-guide/users/netnntp.html
users-guide/users/netports.html
users-guide/users/parintro.html
users-guide/users/parabout.html
users-guide/users/parsimple.html
users-guide/users/parrules.html
users-guide/users/parskip.html
users-guide/users/partypes.html
users-guide/users/parrecurse.html
users-guide/users/pareval.html
users-guide/users/parspace.html
users-guide/users/parsummary.html
users-guide/users/valintro.html
users-guide/users/valabout.html
users-guide/users/valinteger.html
users-guide/users/valdecimal.html
users-guide/users/valtime.html
users-guide/users/valdate.html
users-guide/users/valmoney.html
users-guide/users/vallogic.html
users-guide/users/valchar.html
users-guide/users/valnone.html
users-guide/users/valstring.html
users-guide/users/valbinary.html
users-guide/users/valemail.html
users-guide/users/valfile.html
users-guide/users/valurl.html
users-guide/users/valissue.html
users-guide/users/valtuple.html
users-guide/users/valtag.html
users-guide/users/valblock.html
users-guide/users/valhash.html
users-guide/users/vallist.html
users-guide/users/valparen.html
users-guide/users/valpath.html
users-guide/users/valwords.html
-t pdf12 -f users-guide.pdf --webpage --no-title --size A4 --left 1.00in --right 
0.50in --top 0.50in --bottom 0.50in --header .t. --footer h.1 --tocheader .t. 
--tocfooter ..i --duplex --portrait --color --no-pscommands --compression=1 --jpeg=0 
--fontsize 11.0 --fontspacing 1.2 --headingfont Helvetica --bodyfont Times 
--headfootsize 11.0 --headfootfont Helvetica --charset 8859-1 --pagemode outlines 
--pagelayout single --firstpage toc --pageeffect none --pageduration 10 
--effectduration 1.0 --browserwidth 680



[REBOL] REBOL in HTML file Re:(2)

1999-12-23 Thread peoyli


How about this CGI-script solution to embed REBOL into HTML ?

Installation:
Put the cgi script anywhere from where you can run cgi-scripts

Usage:
http://the.server.you.are.using/script-location/rebol.cgi/full-path-to/test.rhtml

In the .rhtml file, you can give some parameters to the cgi script:
SCRIPT language="REBOL" rebolbin="/beta/rebol/rebol" temppath="/tmp"

where "rebolbin" is the full path to the REBOL executable (default is
"rebol", which the should be located in the same directory as the rebol.cgi
script)

and "temppath" is where the temporary rebol script should be stored when
running it.

/PeO


 Carlos wrote:
  The documentation of REBOL says that REBOL can be embedded into other
 types of text including HTML files.
 
  I'm trying to make the following work out but have no success because
 I see nothing printed on the browser. Do I have to first put REBOL to
 run on local machine? Do I have to address REBOL somewhere else on the
 HTML document or what?.
  Need some help, please.
 
   Unfortunately, REBOL doesn't run on browsers yet. No "plug-in" (needed
 to run languages the browser maker hasn't thought to include) has been
 announced by the REBOL crew, yet.
 
 Of course, this doesn't help you much.
 
   An alternative is use a local web server, written in REBOL (there's
 some on http://www.rebol.org), and write REBOL software to generate
 HTML so that the browser can understand it.
 
 Andrew Martin
 [EMAIL PROTECTED]
 http://members.xoom.com/AndrewMartin/
 Online @ 33,600 Baud!
 --
 
 


#!/usr/local/bin/perl

$rebolhtml_file = $ENV{'PATH_TRANSLATED'};

print "Content-type: text/html", "\n\n";

if ($rebolhtml_file =~ /\.\./ || $rebolhtml_file !~ /$.rhtml/)
{
  print "You have entered illegal characters in the filename.", "\n";
  print "Please check your specification and try again.", "\n";
}
else
{
  if (open (FILE, "" . $rebolhtml_file))
  {
$inscript = 0;
while (FILE)
{
  if (/\s*SCRIPT\s+language=\"REBOL\".*/i)
  {
$temppath = ".";
if (/\s*temppath=\"(\S*)\".*/i)
{
  $temppath = $1;
}
$tempscript = "$temppath/$$" . time();

$rebolbin = "rebol";
if (/\s*rebolbin=\"(\S*)\".*/i)
{
  $rebolbin = $1;
}
$inscript = 1;
if (! open (SCRIPT, "" . $tempscript))
{
  print "Could not open $tempscript for writingBR\n";
}
next;
  }

  elsif (/\s*\/SCRIPT/i)
  {
$inscript = 0;
close (SCRIPT);
$rebolresult = `$rebolbin -c -q $tempscript`;
print $rebolresult;
unlink($tempscript);
next;
  }

  if ($inscript == 1)
  {
print SCRIPT unless (/\s*!--$/ || /\s*\/\/--/);
  }
  else
  {
print;
  }
}

close (FILE);
  }
  else
  {
print "Could not open the specified file ($rebolhtml_file).", "\n";
  }
}

exit (0);


HTMLHEADTITLEREBOL test from within HTML/TITLE/HEAD
BODY BGCOLOR="white"
H2some REBOL code/H2

SCRIPT language="REBOL"  rebolbin="/beta/rebol/rebol" temppath="/tmp"   
!--
REBOL []
print "This output is the result from the first REBOL script...BR"
print now
//--
/SCRIPT

H2some more REBOL code/H2

SCRIPT language="REBOL"  temppath="/tmp" rebolbin="/beta/rebol/rebol"
!--
REBOL []
print "...and this comes from the second script within the test.rhtml file...BR"
print now
//--
/SCRIPT

/BODY
/HTML