r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Gabriele
3-Mar-2007
[7359x2]
i think base 64 uses /
henrik: the detective only updates the interpreter if it is needed; 
when it is needed, it downloades the new version as update.exe, and 
runs it, then quits. update.exe overwrites the main executable with 
itself then launchs it and quits. there is no other way on windows 
that i know of.
Henrik
3-Mar-2007
[7361]
gabriele, so you can rename a file while it runs?
Gabriele
3-Mar-2007
[7362x3]
not that i know of.
nren.exe downloads a new file, update.exe; it runs it; update.exe 
overwrites nren.exe with itself, then runs it; nren.exe deletes update.exe
normal updates do not require this, it's only needed when you are 
for eg upgrading rebol itself.
Henrik
3-Mar-2007
[7365]
thanks, I could get rid of DOS that way
Graham
5-Apr-2007
[7366x2]
daytime is just read daytime://ip.address isn't it?
I get failures on all the ntp servers I've tried so far.
JaimeVargas
5-Apr-2007
[7368x2]
daytime doesn't use the ntp protocol IIRC
You need a daytime server
Graham
5-Apr-2007
[7370x3]
http://www.rebol.com/docs/core23/rebolcore-13.html#section-7
So, looking for a daytime server ...
just finding restaurants looking for waiters!
JaimeVargas
5-Apr-2007
[7373]
Maybe related to this but no 100% sure. http://www.openbsd.org/cgi-bin/man.cgi?query=timed&apropos=0&sektion=8&manpath=OpenBSD+Current&arch=i386&format=html
Ladislav
6-Apr-2007
[7374x6]
Don't trust Jaime, his clock are famous for being imprecise :-)
Rebol [
	Title: "NIST clock"
	File: "nistclock.r"
	Author: "Ladislav Mecir"
	Date: 25-Mar-2007/23:43:24+2:00
]

get-nist-correction: func [/local nist-time cpu-time mjd hms] [
	nist-time: read daytime://time-a.nist.gov
	cpu-time: now

 parse/all nist-time [skip copy mjd 5 skip 2 thru " " copy hms 8 skip]
	nist-time: 18/Nov/1858 + to integer! mjd
	nist-time/time: to time! hms
	nist-correction: difference cpu-time nist-time
]
get-nist-correction

view/new layout [
	banner 140x32 rate 1 with [data: 0:0:0] feel [
		engage: func [face action event] [
			current-time: now + nist-correction
			face/text: current-time/time
			show face
		]
	]
]
do-events
http://tf.nist.gov/service/its.htm
(don't use the GET-NIST-CORRECTION function more often than once 
in 4 seconds)
My apologies to Jaime and everyone, I deserve what happened. Posting 
a correction:
Rebol [
	Title: "NIST clock"
	File: "nistclock.r"
	Author: "Ladislav Mecir"
	Date: 6-Apr-2007/8:32:57+2:00
]

get-nist-correction: func [
	{Never use this function more often than once in four seconds!}
	/local nist-time cpu-time mjd hms
] [
	nist-time: read daytime://time-a.nist.gov
	cpu-time: now

 parse/all nist-time [skip copy mjd 5 skip 2 thru " " copy hms 8 skip]
	nist-time: 18/Nov/1858 + to integer! mjd
	nist-time/time: to time! hms
	difference nist-time cpu-time
]

correction-interval: 181
seconds-to-correction: 1

view/new layout [
	banner 140x32 rate 1 with [data: 0:0:0] feel [
		engage: func [face action event] [
			seconds-to-correction: seconds-to-correction - 1
			if zero? seconds-to-correction [
				nist-correction: get-nist-correction
				seconds-to-correction: correction-interval
			]
			current-time: now + nist-correction
			face/text: current-time/time
			show face
		]
	]
]
do-events
BrianH
6-Apr-2007
[7380x2]
Quick dumb question: I have to post some data to a web site that 
requires authentication. How do I specify the username and password? 
I forget...
The password in question is incompatible with url! syntax.
btiffin
6-Apr-2007
[7382x2]
system/schemes/http/user: "user"    system/schemes/http/pass:  "pass" 
  ??
a: read/custom [site: "www.site.com" scheme: 'http user: "user" pass: 
"pass"] [post  "stuff"]
BrianH
6-Apr-2007
[7384]
First didn't work, second gave invalid port spec error.
btiffin
6-Apr-2007
[7385x2]
Umm, is it https?  Need rebcmd for that I think.  or add port: 80 
 maybe...
Sorry, I get it wrong everytime.  It's host:  not site:
BrianH
6-Apr-2007
[7387]
If it matters, I am accessing an Outlook Web Access site, https scheme, 
with /Command.
btiffin
6-Apr-2007
[7388]
Try  host: "..."  scheme: 'https ...    my mistake.
BrianH
6-Apr-2007
[7389]
That worked, but now I'm getting a "Method not allowed" error from 
the server. I'm trying to enable junk email folders on an Exchange 
server and apparently the only way to do so is with a 100+ line VBScript 
that translates to a one-line REBOL script, but neither seem to work 
with this server.
btiffin
6-Apr-2007
[7390]
try  [url: "www.site.com/prog.cgi" ...]  instead of host::
BrianH
6-Apr-2007
[7391]
I tried host and path and that builds the url properly, but now I 
get a different server error that REBOL doesn't print all of so I 
can't see it. I can't seem to trap the error so I can print the whole 
thing.
btiffin
6-Apr-2007
[7392x2]
Or maybe  [host: "www.site.com" url: "prog.cgi"]
Can you prepend the read with print to get the rest of the message?
Izkata
6-Apr-2007
[7394x2]
>> probe decode-url http://www.junk.net/path/to/index.html
make object! [
    user: none
    pass: none
    host: "www.junk.net"
    port-id: none
    path: "path/to/"
    target: "index.html"
]
try with those...
BrianH
6-Apr-2007
[7396]
It never gets to the read - it fails on open. When I tried TRACE/NET 
ON I saw the error: HTTP/1.1 440 Login Timeout
What's that?
btiffin
6-Apr-2007
[7397]
https authentication.  No experience.  Sorry.
Graham
6-Apr-2007
[7398]
what type of authentication is it?
BrianH
6-Apr-2007
[7399]
It's Basic authentication.
Graham
6-Apr-2007
[7400x2]
is it simple authentication ?
ok.
BrianH
6-Apr-2007
[7402x3]
AFAICT
Authorization: Basic Q0NFU1xBZG1pbmlzdHJhdG9yOiFNVFVTQSYqKA==
Is that digest?
Graham
6-Apr-2007
[7405x2]
read/custom http://user:[password-:-somewere-:-com] [ post ... ] doesn't 
work?
because the password has some funny characters in it??
BrianH
6-Apr-2007
[7407]
It does.
Graham
6-Apr-2007
[7408]
Ok, you can change the parse rule to allow the @ or whatever