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

World: r3wp

[Core] Discuss core issues

Gabriele
11-Jun-2010
[17002x4]
Oldes - "only if the string contains new line or " char" - that's 
wrong. It depends on the string length. also, mold escapes characters 
the REBOL way which you DON'T want.
>> "a long string"
== "a long string"

>> "a very long string with no newlines or quote characters, that 
still uses braces instead of quotes because it's long"

== {a very long string with no newlines or quote characters, that 
still uses braces instead of quotes because it's long}
the init function is called when the port is created from a url! 
or block! spec. eg. p: make port! ahttp://...
calling OPEN on a url! or block! spec also creates the port! first, 
so init is called.
Graham
11-Jun-2010
[17006]
So, after the port is created ..
Gabriele
11-Jun-2010
[17007]
i think the native code does some very basic initialization of the 
port! then it calls init
Graham
11-Jun-2010
[17008]
ok.  thanks.
Henrik
12-Jun-2010
[17009x2]
Is there a good method to conditionally remove a char in a string 
without having to manage the string? That is: Find char X at location 
Y and remove it if it's there, otherwise just return the string as 
is.
good method = fast method
Steeve
12-Jun-2010
[17011]
the first occurence only ?
Henrik
12-Jun-2010
[17012x2]
yes, I was thinking of the case of removing a conditional comma at 
the tail of an assembled string as quickly as possible.
first occurrence = just one occurrence
Steeve
12-Jun-2010
[17014]
something like...
head any [remove find string char string]
Henrik
12-Jun-2010
[17015]
hmm.. yes, that might work, thanks
Steeve
12-Jun-2010
[17016x2]
Parse  may be faster, though
especially within R3
Henrik
12-Jun-2010
[17018]
hmm, the string is required to be present twice, but I guess that's 
ok.
Steeve
12-Jun-2010
[17019]
Probably a little faster with R3...
also string remove find string char
Graham
12-Jun-2010
[17020]
Regarding Romano's atcp protocol, http://www.rebol.it/romano/atcp-protocol.r
 there is a little bug at the bottom of the page I think

He has 
		if find system/components 'ssl [
			net-utils/net-install 'assl self 0
			net-utils/net-install 'atsl self 0
		]

but I think he meant

		if find system/components 'ssl [
			net-utils/net-install 'assl self 0
			net-utils/net-install 'atls self 0
		]
Andreas
12-Jun-2010
[17021]
Good catch, Graham
Graham
12-Jun-2010
[17022x2]
I emailed him.... hope he has time to spare from his Java development 
to fix it :)
Gab's async protocol, the awake event takes two parameters
Romano's atcp protocol, the awake event takes one parameter ....
Anton
12-Jun-2010
[17024]
Oldes, I get braces when string length > 50
>> mold loop 51 [append "" "."]
== {{...................................................}}
Gabriele
13-Jun-2010
[17025]
Graham, though, tls:// never worked in REBOL so... :)
Graham
13-Jun-2010
[17026]
Carl keeps saying otherwise :)
Henrik
13-Jun-2010
[17027x3]
does anyone use str-enc-utils.r? I'm not sure if I have found a bug.
actually there is not just a bug, but also a hang.
>> str-enc-utils/iso-8859-15-to-utf-8 "aø"
== "" ; bad
>> str-enc-utils/iso-8859-15-to-utf-8 "ø"
== "ø" ; good
>> str-enc-utils/iso-8859-1-to-utf-8 "aø" ; hangs
Steeve
13-Jun-2010
[17030]
Link plz...
Henrik
13-Jun-2010
[17031x6]
http://www.rebol.org/view-script.r?script=str-enc-utils.r
hmm.. that one is newer. I have to test that one. one sec.
the hang is gone, but the other bug is still present.
nope, hang is not gone, just required some different letters to trigger 
it.
ascii: charset [#"^(00)" - #"^(7F)"]

ascii-rule: [
      copy transfer [ascii some ascii] ( ; <- problem
        head insert tail output-string transfer
      )
    ]


This rule does not look correct. I replaced [ascii some ascii] with 
[some ascii] and now it works.
This is present in two locations in the script, but I can't be entirely 
sure if my fix is correct.
PeterWood
13-Jun-2010
[17037]
Thanks, Henrik. Could you possibly let me know the binary of the 
strings that you saw the bug with. I suspect I am seeing something 
different in AltME.
Henrik
14-Jun-2010
[17038]
PeterWood:

#{61F8}
Graham
14-Jun-2010
[17039]
I was having problems with beer being disconnected while doing any 
significant http work, and using Gab's async http seems to have solved 
it for me.
Henrik
14-Jun-2010
[17040]
Graham, I may have a little more time to work with it soon (not sure 
yet). Can you make it working without docs?
Graham
14-Jun-2010
[17041]
Sure ... I wrote up an example
Henrik
14-Jun-2010
[17042]
cool
Graham
14-Jun-2010
[17043x2]
http://rebol.wik.is/Protocols/Test-async-http.r
uses the same ahttp with a small change ... see http://github.com/gchiu/Rebol2/blob/master/Protocols/prot-ahttp.r
Henrik
14-Jun-2010
[17045]
thanks
Graham
14-Jun-2010
[17046]
In the handler, there should be a check to see if the event is an 
error ...and then close the port
Henrik
14-Jun-2010
[17047]
seems redirects are not supported
Graham
14-Jun-2010
[17048x3]
Yes, that's correct
I don't need redirects since I'm downloading from Amazon S3 ...
What's needed to support redirects?  Grab the new url and open that 
instead?
Henrik
14-Jun-2010
[17051]
I'm not sure, but something must be returned from the server.