[REBOL] percentiles

2000-02-26 Thread prowsef

Can any one here give me a quick piece of code to 
produce the 95th percentile from a list of valuesmy hight school math
has vanished from my brain ;)

Cheers
Francois




[REBOL] unix timestamp conversion? Re:(2)

2000-02-25 Thread prowsef

Will this script, submitted to the mailing list take into account
leap years etcor will there be a small descrepency?

Cheers

Francois


On Mon, 21 Feb 2000 [EMAIL PROTECTED] wrote:

> 
> > Anyone written a script to convert unix timestamps (is 950618412) to
> > a usable rebol date and time format. 
> > 
> > Cheers
> > 
> > Francois
> > 
> > 
> 
> Hi Francois:
> 
> Try this.
> 
> 
> REBOL [
> Title: "Convert Epoch Time to Date"
> Author: "Ralph Roberts"
> File: %epoch-to-date.r
> Date: 21-Feb-2000
> Purpose: {converts UNIX Epoch time (seconds after 1-1-1970
>   to current date and time }
> Example: {outputs "Epoch date 951142987 is 21-Feb-2000
>   14:38:52 GMT or 9:38:52 Local" }
> ]
> 
> epoch: 951142987
> 
> days: divide epoch 86400
> 
> days2: make integer! days
> 
> time: (days - days2) * 24
> hours: make integer! time
> minutes: (time - hours) * 100
> minutes2: make integer! minutes
> seconds: make integer! (minutes - minutes2) * 100
> time2: make time! hours * 60) + minutes2) * 60) + seconds)
> 
> prin ["Epoch date" epoch "is" 1-Jan-1970 + days2 time2]
> print [" GMT or" time2 + now/zone "Local"]
> 



[REBOL] unix timestamp revisited....

2000-02-25 Thread prowsef

OK I have a small script that was written by one of the users on this
list.

REBOL [
Title: "Convert Epoch Time to Date"
Author: "Ralph Roberts"
File: %epoch-to-date.r
Date: 21-Feb-2000
Purpose: {converts UNIX Epoch time (seconds after 1-1-1970
to current date and time }
Example: {outputs "Epoch date 951142987 is 21-Feb-2000
14:38:52 GMT or 9:38:52 Local" }
]

epoch: 950440200 
 
 
 
 

days: divide epoch 86400

days2: make integer! days

time: (days - days2) * 24
hours: make integer! time
minutes: (time - hours) * 100
minutes2: make integer! minutes
seconds: make integer! (minutes - minutes2) * 100
time2: make time! hours * 60) + minutes2) * 60) + seconds)

However I am not convinced this works properlyhere is a perl version
of the same thing that produces different results. I urgently need some
help with this as it is required to analysis and presentation by monday :(

#!/usr/bin/perl -w

my $ts;


while (<>) {

chop;

#my ($day, $month, $year, $hour, $min, $sec) = 
#   (localtime ($))[3,4,5,0,1,2];

#$year+=1900;
#$month++;

$ts = localtime ($_);
print ("$ts\n");
}


Any help appreciated...!!!

Cheers

-- 
Francois Prowse
Network Engineer

UUNET   Tel: +32 70 233 560
Culliganlaan 2, H   Fax: +32 70 233 559
B-1831 Diegem   Email: [EMAIL PROTECTED]
Belgium http://www.be.uu.net




[REBOL] Reading a file line by line Re:(2)

2000-02-24 Thread prowsef

I have been reading really large files using this setup;

file: read/lines %filename

foreach line file [do stuff]

This seems to work well, however what is the limitation. What are the 
limitations on such a read, does the entire file get read into memory
when issuing the read/lines command?

Seems to work for me anyhow

Francois



On Thu, 24 Feb 2000 [EMAIL PROTECTED] wrote:

> 
> > I need to read a BIG text file line by line but I
> > don't know exactly how to do.
> >
> > As I understand the following will read the entire
> > file to a list of lines and that is not what I want.
> >
> > lines: read/lines %textfile
> >
> > I want to read one line, process it before reading
> > the next line and so on.
> >
> 
> Hi Peter:
> 
> It's relatively easy to act on files larger than memory, one line at a time.
> I believe BO at REBOL came up with the technique originally. I've adapted it
> and use it for manipulating large log files on my internet servers.
> 
> Here it is, enjoy:
> 
>   hugefile: open/direct/read/lines %huge_file
> 
>   while [ ( line: pick hugefile 1 ) <> none ] [
>   ;;do stuff to each line;; ]
> 
>   close hugefile
> 
> 
> --Ralph Roberts
> 



[REBOL] unix timestamp conversion?

2000-02-21 Thread prowsef

Anyone written a script to convert unix timestamps (is 950618412) to
a usable rebol date and time format. 

Cheers

Francois




[REBOL] unique entry

2000-02-17 Thread prowsef

I have the following list of data..actually alot of it...

950783356 13564 348 13564 348 
950783099 10631 343 10631 343 
950782800 16909 354 20544 361 
950782500 19584 343 20544 361 
950782200 16041 342 19060 347 
950781900 12396 409 14217 442 
950781600 11183 435 11444 442
950781300 8332 407  535 
950781000 11308 471 14224 535 
950780700 14224 331 14224 331 
950780400 14405 451 14500 514 
950780100 18492 389 19707 514
950779800 15180 345 19707 352 
950779500 12726 382 12909 399 
950779200 12329 365 12909 399 
950778900 16787 356 18903 361 
950778600 16636 371 18903 378 
950778300 18704 388 21082 395 
950778000 25992 380 29089 395
95000 26748 316 29089 372
950777400 34714 375 39972 428 

I need to take each of the 1st, 2nd, 3rd and 4th column and place it into
a block database...(incrementing some totals) simple engough..however I
need to ensure that the time stamp (the first column) us unique before
adding to the database. 

Any simple rebol function to aproach this?

For those of you curious the data is from MRTG

Cheers

Francois




[REBOL] database revisited....

2000-02-09 Thread prowsef


OK this is a revision of a quesion I posted yesterdaycan I create a
series as follows

routers: [

router1 [  domain {}
   filepath {   }
   confpath {   }
   interfaces [
["serial1" "up" 1 {description}]
["ethernet1" "down" 2 {description}]
  ]
]

router2 [  domain { }
   filepath {   }
   confpath {   }
   interfaces [
["ethernet1" "up" 1 {description}]
["hssi1" "down" 2 {description}]
  ]
] 
  ]

Will this work.

How can I build a foreach loop around this to print each router name and
its interfaces. Also, could I incorporate a find statement to show each
router and is "up" interfaces...?

Any help appreciated.

Francois



[REBOL] database

2000-02-08 Thread prowsef

Guys, I need to convert a large flatfile with our router list into a rebol
block database so I can eaisly manipulate and update data.
 
router1;serial1;description;up;speed
router1;serial2;description;down;speed
router2;serial1;description;up;speed router2;serial2;description;up;speed
router2;serial3;description;down;speed
 
What is the best way to achieve this for the best flexibility...should it
look like this;
 
router1 [
[serial1 desctiption up speed]
[serial2 description down speed]
...  

Any help appreciated...

Cheers

Francois



[REBOL] Forwarded mail....

2000-02-08 Thread prowsef



-- 
Francois Prowse
Network Engineer

UUNET   Tel: +32 70 233 560
Culliganlaan 2, H   Fax: +32 70 233 559
B-1831 Diegem   Email: [EMAIL PROTECTED]
Belgium http://www.be.uu.net


-- Forwarded message --
Date: Tue, 8 Feb 2000 14:47:06 +0100 (CET)
From: Francois Prowse <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]


Guys, I need to convert a large flatfile with our router list into 
a rebol block database so I can eaisly manipulate and update data. 

router1;serial1;description;up;speed
router1;serial2;description;down;speed
router2;serial1;description;up;speed
router2;serial2;description;up;speed
router2;serial3;description;down;speed

What is the best way to achieve this for the best flexibility...should it 
look like this;

router1 [
[serial1 desctiption up speed]
[serial2 description down speed]
...

etc

Any ideas

Francois




[REBOL] parse upto a number

2000-02-04 Thread prowsef

OK - how can I parse a line up until it strikes a number

iebill123

and return bill

??

Francois





[REBOL] Me Too Re:(2)

2000-01-31 Thread prowsef

ME TOO :)



-- 
Francois Prowse
Network Engineer

UUNET   Tel: +32 70 233 560
Culliganlaan 2, H   Fax: +32 70 233 559
B-1831 Diegem   Email: [EMAIL PROTECTED]
Belgium http://www.be.uu.net


On Mon, 31 Jan 2000 [EMAIL PROTECTED] wrote:

> Me Too
> 
> or is it too late ;-)
> 
> Atentamente, Javier Delgado
> -- 
> Paralax Multimedia S.A.   Mexico D.F.
> http://www.paralax.com.mx
> 
> Producción de Video, Video3d, animacion 3d  kioskos
> tel/fax <5>373 36 20 , Calzada de las Armas16 Naucalpan
> --
> Personal  http://www.paralax.com.mx/Javier   
> Kalimanhttp://www.kaliman.org.mx
> icq :   40740225  JavierD
> 
> 



[REBOL] no Palm support

2000-01-25 Thread prowsef

I just looked at the download page to see if there was any further
progress with the Psion implementation, somthing I have been waiting for,
for a long time now :) However I noticed that a Palm entry has been
removed?

How is the Psion version comming along anyhow..

Francois