• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp5907
r3wp58701
total:64608

results window for this page: [start: 37601 end: 37700]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
Maxim:
11-Feb-2007
hum... I'll try my inspector... maybe it can help me a bit...
Maxim:
11-Feb-2007
wrt lit-word vs word... find is reacting as expected.... select is 
numb like a frog on ice
Maxim:
11-Feb-2007
well, protect, only helps within the global context... which is why 
I wish there was /HARD mode which protected ANY setup of a specific 
word.
Maxim:
11-Feb-2007
probably also can protect word within a context... but at that point, 
the damage is usually done.
Maxim:
11-Feb-2007
I've discoverd another way to discover where a set occurs... within 
objects, you look at the first... and the natural order of words, 
is a telling clue...
Maxim:
11-Feb-2007
well found it... and its a biggie  :-(   deep within glayout... well... 
its actually pretty easy for fix there, though.
Maxim:
12-Feb-2007
the issue is that as it is a commonly used feature, although easy 
to fix within glayout... many references to in my apps will break... 
ahh...
Maxim:
12-Feb-2007
how the hell did I not realise I was overiding such a core word? 
 sometimes the obvious just slips by...  when you're looking the 
other way   ' :-/
Maxim:
12-Feb-2007
yes anton, which is why I discovered where it was being set... after 
a func called 'layout (this one voluntarily being an override)
Maxim:
12-Feb-2007
binding would then have to replace any object-local bindings of select 
to the global context and raise an error if it doesn't exist, as 
it would if you had tried to define a new object with select undefined 
in any place.
Maxim:
12-Feb-2007
if you inadvertently typo , then you create a new member!  talk about 
hard to debug errors!!
Henrik:
14-Feb-2007
If I'm calling a function with many different refinements and the 
function has to work recursively and all refinements must be maintained 
throughout recursion, is there an easy way to get the function call 
with all refinements?

I'm using:


>> f: func [/a /b] [to-path remove-each p reduce ['f all [a 'a] all 
[b 'b]] [none? p]]

>> f
== f
>> f/a
== f/a
>> f/b/a
== f/a/b ; lose refinement order
Anton:
14-Feb-2007
I'm not sure if this helps but I sometimes make a wrapper function 
which calls the actual recursive function. The wrapper could take 
the refinements and set some flags in a context shared by all calls 
to the inner recursion function.
Anton:
14-Feb-2007
Oh hang on, your question indicates that your example code above 
is currently working, but you are looking for a better way. Is that 
correct ?
Anton:
14-Feb-2007
A "how was this function called ?" function. I don't think there 
is a way. (although in recent discussion on BIND?....)
Anton:
14-Feb-2007
How about this:
>> f: func [/a /b][print mold second bind? 'a]
>> f/a/b
[true true]
:)
Henrik:
14-Feb-2007
well, that only brings up a block and the refinement order is still 
off, which would be a problem if your refinements have arguments
Anton:
14-Feb-2007
I think you must pass in the code which is used to launch the function 
as a function argument :)
Henrik:
14-Feb-2007
I wonder how hard this would be to implement in a single function. 
Probably very hard if functions internally are unaware of refinement 
order
Anton:
14-Feb-2007
Well, given a function
f: func [code /a /b][print mold second bind? 'a]
do append/only copy code: [f/b] code
--->  [[f/b] none true]
Henrik:
14-Feb-2007
it's a file packing function. refinements are used to determine which 
files should be skipped and which files should be processed with 
other external functions
Ladislav:
14-Feb-2007
I think you must pass in the code which is used to launch the function 
as a function argument :)
 no need, pass-args can handle everything
Ladislav:
14-Feb-2007
, but a native APPLY handling refinements transparently would definitely 
help
Gabriele:
14-Feb-2007
Henrik: why is the refinement order important to you? (since there's 
no way to know it from inside a function)
Gabriele:
14-Feb-2007
if you have control over the function, write a (recursive) function 
without refinements and a wrapper with refinements that calls it. 
(this is the best solution)
Gabriele:
14-Feb-2007
a native APPLY would solve all of this elegantly... hopefully we'll 
get one :)
Rebolek:
19-Feb-2007
in immortal words of Kurt Cobain "who knows? not me."
and this probably won't help very much:
>> ?? a
a: make object! [
    b: 1
]
>> path a 'b
>> ?? a
a: make object! [
    b: end
]
Rebolek:
19-Feb-2007
I don't know. let's continue with the example:
>> type? a/b
== unset!
Oldes:
19-Feb-2007
Don't know what PATH does...
>> x: first [a/b/c/d]
== a/b/c/d
>> y: path x 'b
** Script Error: y needs a value
** Near: y: path x 'b
>> ?? x
x: a/b
Robert:
19-Feb-2007
Can this routine (http://www.rebol.net/article/0281.html) for copying 
large files be used to transfer a file over a network as well?
Robert:
19-Feb-2007
Sounds good. What do I need to change? I'm really not a network expert 
nor a port expert.
Anton:
19-Feb-2007
Sorry, my first comment above "resumes from most FTP sites" should 
be "HTTP sites". I've not widely tested it with FTP, only with a 
few FTP files Graham was using for his EMR project.
Robert:
19-Feb-2007
PATH: Looks like a simplyfied find & copy combination to me.

>> ? path
USAGE:
    PATH value selector

DESCRIPTION:
     Path selection.
     PATH is an action value.

ARGUMENTS:
     value -- (Type: any)
     selector -- (Type: any)
>> a: [1 2 3 4 5]
== [1 2 3 4 5]
>> path a 3
>> a
== [1 2]
>> path a 3
>> a
== [1 2]
>> a
== [1 2]
>> head? a
== true
>> head a
== [1 2]
>> a
== [1 2]
>> tail a
== []
>> a
== [1 2]
>> a: [1 a 2 b 3 c 4 d 5 e]
== [1 a 2 b 3 c 4 d 5 e]
>> path a 'd
>> a
== [1 a 2 b 3 c 4 d]
>> a: [1 a 2 b 3 d c 4 d 5 e]
== [1 a 2 b 3 d c 4 d 5 e]
>> path a 'd
>> a
== [1 a 2 b 3 d]
>> a: [1 a 2 b 3 d c 4 d 5 e]
== [1 a 2 b 3 d c 4 d 5 e]
>> path a 't
** Script Error: Invalid path value: t
** Near: path a 't
>> a: [1 a 2 b 3 [d] c 4 d 5 e]
== [1 a 2 b 3 [d] c 4 d 5 e]
>> path a 'd
>> a
== [1 a 2 b 3 [d] c 4 d]
>> path a [d]
>> a
== [1 a 2 b 3 [d]]
>> a: [1 a 2 b 3 [d] c: 4 d 5 e]
== [1 a 2 b 3 [d] c: 4 d 5 e]
>> path a to-set-word 'c
>> a
== [1 a 2 b 3 [d] c:]
>>
Oldes:
19-Feb-2007
I don't thing it's correct behaviour:
>> a: [1 2 3 4 5]
== [1 2 3 4 5]
>> path a 3
>> a
== [1 2]
>> a/3
>> a/4
== 4
>> a/5
== 5
>> length? a
== 5
>> a
== [1 2]
Oldes:
19-Feb-2007
>> type? a/3
== unset!
Izkata:
19-Feb-2007
Huh.  Looks like it's marking the end of the block without actually 
removing elements, so that they're still accessible if really needed.

>> A: [a b c d e]
== [a b c d e]
>> path A 3      
>> ? A
A is a block of value: [a b]
>> A/2
== b
>> A/3
>> A/4
== d
>> mold A        
== "[a b]"
>> back tail A
== [e]
>> back back tail A
== [d e]
>> back back back tail A
== []
>> back back back back tail A
== [b]


I can see myself using this...  And I think I'd actually had a problem 
a while back where it would have been helpful.
CharlesS:
19-Feb-2007
Im iterating over a lines in a file , with this line in a foreach 
body
Steeve:
19-Feb-2007
so, in realty , you do a find templine true
CharlesS:
19-Feb-2007
thx for your help -- the manual desperately needs a search function
Rebolek:
20-Feb-2007
maybe R3 is little bit delayed because 3D Realms addopted it as a 
main programming language for Duke Nukem Forever? ;P
Maxim:
20-Feb-2007
I think R3 is not really delayed... I think the plan has simply changed, 
and this time Carl is finally working at delivering what he promised 
at devcon 2004.  He might have realised that its a little bit more 
work to make something so open... you can't hide the ugly things, 
so I'm pretty sure he is doing a lot of cleaning up...  and we have 
been hearing about the fact that this time, view isnt' being left 
behind...
Maxim:
20-Feb-2007
pad can also be used to left, center, or right justify strings ... 
my fill (pad) functions allows all variations on string! & number... 
a zfill is just a preset using the "0" char as the pad.  it even 
has a truncate refinement when you need the output to be *exactly* 
the specified length, even if it would be larger than what you ask.
Maxim:
20-Feb-2007
the scientific notation is a side-effect of window's use of IEEE 
floating point libs.  for some reason, on windows, the output is 
automatically converted this way... I have seen this in other apps 
on windows too.  converting to/from a nice decimal would probably 
take too much time.
Maxim:
20-Feb-2007
and henrik and anton would be asking to not convert it  ;-) 


 I always thought to-string should cleanup the decimal! datatype...


what do you think ladislav?  its not load or mold, its specifically 
asking for a string version of a decimal... and in any case the normal 
notation of  0.000004  is still a valid decimal, so I see little 
problems...
Anton:
20-Feb-2007
Seems a good suggestion - and it appears this formatting issue is 
not in the RAMBO database yet.
Henrik:
23-Feb-2007
Does anyone miss a function that tells with true/false if a variable 
can be converted to a different datatype? I find myself doing lots 
of test on input from text fields with attempt blocks.

something like:

to-integer? 'test
== false
Henrik:
23-Feb-2007
>> a: "6"
>> to-integer a
== 6
>> a: "u"
>> to-integer a ; script fails here so we need to handle it
** Script Error: Invalid argument: u
** Where: to-integer
** Near: to integer! :value

>> attempt [to-integer a]  ; useful, but less clear what fails. Is 
'a not a value or can it not be converted to integer?
== none

>> to-integer? a ; 'a definitely exists, but can't be converted to 
integer.
== false
Oldes:
23-Feb-2007
>> to-integer?: func[a][ not error? try [to-integer a]]
>> to-integer? "1"
== true
>> to-integer? "a"
== false
Oldes:
23-Feb-2007
to-integer?: func[a][ not error? try [to integer! a]]
Oldes:
23-Feb-2007
And I must say it again... I use ATTEMPT only in cases where I do 
not expect error. Many people use it just a shortcut for error? try 
which I don't lik. As I understand attempt as higher function for 
reporting not wanted errors (for example on server). If you use it 
in cases, where like attempt [to-integer "a"] it's not good as it 
would report many errors (in some bigger context)
Henrik:
23-Feb-2007
Oldes, probably not, though this is just one case. A more complex 
datatype like date! requires more complex checking schemes.
Oldes:
23-Feb-2007
And I would not use it, as I usually use something like this:
if error? try [a: to integer! a][a: 0]
Henrik:
23-Feb-2007
And date! does not behave like integer!:

>> a: 1
== 1
>> b: "2"
== "2"
>> c: "u"
== "u"
>> to-date reduce [a b c]
** Script Error: Invalid argument: 2
** Where: to-date
** Near: to date! :value
Henrik:
23-Feb-2007
This is probably a dumb case since endusers don't determine the types 
themselves.
Oldes:
23-Feb-2007
and if I would use it, I would probably use it like:
to-date?: func[a][ not error? try [a: to date! a]]
CharlesS:
23-Feb-2007
can the to function translate to user defined structures / objects 
? if  so how, is there a special method name in the object you want 
to convert to ?
Sunanda:
23-Feb-2007
If I understand your question, Charles, you may be looking for construct/with......It's 
a way of using an existing object as a template for a new one, eg:
 my-obj1: make object! [a: 99 b: 2 c: "string"]
my-obj2: construct/with  [b: 9999] my-obj
Henrik:
24-Feb-2007
hmm... is it possible to find () elements in a block? they don't 
have a specific datatype.

find [a b c (code) d] ?? ; what type?
Sunanda:
24-Feb-2007
Is this a start?
 find [a b c (code) d] paren!
Henrik:
24-Feb-2007
ah, precisely, thanks. didn't know there was a type for them
Robert:
25-Feb-2007
Is there a way to find out if a loaded file is encrypted with CLOAK?
Sunanda:
25-Feb-2007
As far as I know, an encloaked string is just a jumbled up, binary 
version of the original string: it carries no prefix signature so 
you can't tell at a glance it is an encloaked string rather than 
another bit of binary.

So, yes, as far as I knoww, you'll have to read and attempt decloaking. 
 Or, if you have control over the writing, ensure some sort of identifiable 
prefix is added)
Henrik:
25-Feb-2007
>> do to-path reduce ['now 'none]   
** Script Error: now/none has no refinement called none
** Near: do to-path reduce ['now 'none]
>> do to-path reduce ['now none] 
== 25-Feb-2007/20:40:18+1:00
>> do probe to-path reduce ['now none]
now/none
== 25-Feb-2007/20:40:28+1:00
>> now/none
** Script Error: now has no refinement called none
** Near: now/none


I guess the difference is between 'none and none!, but I thought 
it was curious that the none! is accepted as a refinement.
Gabriele:
26-Feb-2007
functions just ignore anything that is not a word in the path.
Robert:
26-Feb-2007
DECLOAK: I have the problem that a random char is added as the first 
char to a decloaked string. Is this a known problem?
Gregg:
26-Feb-2007
I've never had a problem with encloak/decloak, but I would also avoid 
string ops that might translate the binary data somehow.
Maxim:
27-Feb-2007
or is initial issue a decimal type integer?
Maxim:
27-Feb-2007
for going to-from hex... I don't have a solution.
Oldes:
28-Feb-2007
delete it as it's a nonsense
Maxim:
1-Mar-2007
(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 ;-)
Sunanda:
2-Mar-2007
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.
Henrik:
3-Mar-2007
gabriele, so you can rename a file while it runs?
Gabriele:
3-Mar-2007
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
JaimeVargas:
5-Apr-2007
You need a daytime server
Graham:
5-Apr-2007
So, looking for a daytime server ...
Ladislav:
6-Apr-2007
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
Ladislav:
6-Apr-2007
My apologies to Jaime and everyone, I deserve what happened. Posting 
a correction:
Ladislav:
6-Apr-2007
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
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...
btiffin:
6-Apr-2007
a: read/custom [site: "www.site.com" scheme: 'http user: "user" pass: 
"pass"] [post  "stuff"]
BrianH:
6-Apr-2007
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.
BrianH:
6-Apr-2007
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
The command docs mention something about initiating ssl connections 
  with  port: open/direct  ssl://url:portnum  then a   set-modes 
port [secure: true]  to initiate authentication...
BrianH:
6-Apr-2007
Brian,

    read/custom [scheme: 'https host: "server" path: "path/to/stuff" 
    user: "username" pass: "password"]

works. I don't need to recreate the port scheme, as it does that 
secure: true in its code. I get the same error with Microsoft's VBScript 
fix. I think it's something server-side. Thanks for the help with 
the syntax though - it's been a while.
btiffin:
6-Apr-2007
There is a system/schemes/http/timeout field    probably the same 
for https
BrianH:
6-Apr-2007
Timeout is ignored. Must be a server misconfiguration (just a guess 
based on how messed up this server is).
BrianH:
6-Apr-2007
According to MS's blogs, the only way to enable Exchange's server-side 
junk mail folders is to do so through Outlook Web Access on a per-user 
basis. The only way they suggest to do so for all users is to post:

cmd=options
junkemailstate=1
cmd=savejunkemailrule


to every user, logging in as a domain administrator. They provide 
a 100+ line VBScript to do this for a list of names in a file. When 
that failed, I figured that I could do the same in 1 or 2 lines of 
REBOL, and I was correct: I get the same exact failure the VBScript 
gets in 1 line of REBOL :(
btiffin:
6-Apr-2007
Yippee...if you can disable FBA long term...

There may be a more permanent solution...I didn't read all of it.

http://www.chicagotech.net/exchange/owa440.htm
Henrik:
8-Apr-2007
doh! I'd been hunting a bug in LIST-VIEW all day and it turns out 
that Ladislav's BUILD function does funny stuff to paths:

>> build [append/only [] []]
== [append/unset [] []]
Gregg:
8-Apr-2007
Gotta watch those advanced libs. :-) The tricky stuff, like REBOL 
itself, often has a few things you have to trip over a couple times 
before setting a flag in your brain.
ChristianE:
8-Apr-2007
If [APPEND/ONLY [] []] is what you were looking for to recieve with 
the help of BUILD, Henrik, BUILD/WITH [APPEND/ONLY [] []] [] works, 
too, and to me it seems to be a bit more intuitive.
ChristianE:
8-Apr-2007
But since BUILD [A/B [] []] gives [A/B [] []] as one would expect, 
I'd say this is a real bug in BUILD. You probably should let Ladislav 
know.
Gabriele:
9-Apr-2007
a path! is a kind of block!. so i guess BUILD is just recursing into 
paths. it's a bug but... it seems a cool feature to me instead. you 
can build paths ;)
ChristianE:
9-Apr-2007
No, I'd say it's a bug, due to inconsistent behaviour:

>> build [append/only [] []]
== [append/unset [] []]

vs.

>> build [append/anything-other-than-only [] []]
== [append/anything-other-than-only [] []]
Robert:
9-Apr-2007
I need to read out a possible proxy config.
Robert:
9-Apr-2007
Hm... in my version these functions are unset. I use REBFACE to start 
a script.
Robert:
9-Apr-2007
Hmm... ok. I drop him a note and see what happens. Otherwise I have 
to use registry.r from rebol.org
Gabriele:
9-Apr-2007
Christian, that's because "only" is a keyword for build. [append/only 
[] []] is for build the same as [[append only] [] []]. I agree it's 
a bug, however I'd be tempted to leave it as-is ;)
Ladislav:
9-Apr-2007
maybe I should use a less usual word instead of 'only ? 'ins seems 
to be less conflicting, since nobody uses it for "normal" purposes
Ladislav:
9-Apr-2007
is there a request to leave something out?
37601 / 6460812345...375376[377] 378379...643644645646647