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

World: r3wp

[Core] Discuss core issues

Oldes
27-Feb-2007
[7346x2]
it's stupid behaviuor. I really don't know what it can be good for, 
as I can always do:
>> as-binary next mold #ff0000
== #{666630303030}
ech, I know why it's molded as string - issue can hold any value... 
:( so my Rambo wish is pretty stupid now:-)
Ladislav
27-Feb-2007
[7348x2]
issue-to-binary: func[clr] [debase/base as-string clr 16]
issue-to-binary: func[clr] [debase/base clr 16]
Oldes
27-Feb-2007
[7350]
YES :-) that's much more better, thanks.
Gabriele
28-Feb-2007
[7351]
oldes, do you want me to delete that ticket or should i keep it?
Oldes
28-Feb-2007
[7352x2]
yes please
delete it as it's a nonsense
Gabriele
1-Mar-2007
[7354]
done
Maxim
1-Mar-2007
[7355]
(Oldes, just so you know, in english "more better" makes no sense. 
 better implies more.  ( I'm saying this just cause I've seen you 
write it a few times ;-)
Henrik
2-Mar-2007
[7356x2]
continuing from AltME: of course now that I think of it, launch/quit 
will always restart the app rather than run the script I made. :-/
using enbase 64 isn't safe for filenames is it?
Sunanda
2-Mar-2007
[7358]
Do you mean using it to generate file names that will be acceptable 
on any platform that REBOL runs on?
If so, I don't know, but I wouldn't take the risk.....

....I use checksum/secure and remove #{} part -- gets me a file name 
that is just letters (a-f) and digits.
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...