• 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: 45701 end: 45800]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
Graham:
9-Dec-2009
and in so much as rebol runs as a command line client, then it can 
be readily done.
Gabriele:
10-Dec-2009
when you use file! call does a to-local-file automatically, and wraps 
it in quotes.
Graham:
11-Dec-2009
Looks like Sterling's detach.r script in the library to detach attachments 
from emails has a bug.
Graham:
11-Dec-2009
the first line is redundant, and the second line can be changed to 
a parse ...


   if parse headers/content-type  [ thru "boundary=" opt {"} [ copy 
   boundary to {"} to end | copy boundary to end ]][
        ;remove back tail boundary
        print ["Boundary string:" boundary]
   ]

which I think fixes it.
Graham:
11-Dec-2009
Hmm. Boundary won't have a value if the parse fails ... so

either parse ...  [

][
	 boundary: none
]
Von:
12-Dec-2009
Hello! I'm receiving the following error when processing a cgi form 
to send an e-mail of the response.  I correctly can send from my 
laptop, Rebol/Core -- command line, with my set-net settings in user.r 
but when I do the same thing on my hosting account I get the following 
error:
Von:
12-Dec-2009
Hello!  I'm having trouble with my hosting account to send via e-mail 
a cgi form response.  I can get rebol to post the data to the page, 
I just can't get it to send the data to me via e-mail.   I'm able 
to send e-mails from my laptop but when I use the same set-net settings 
on my host account I get the following error: ** User Error: Server 
error: tcp connection failed
** Near: smtp-port: open [scheme: 'esmtp] 
either only
Von:
12-Dec-2009
Hello!  I'm having trouble with my hosting account to send via e-mail 
a cgi form response.  I can get rebol to post the data to the page, 
I just can't get it to send the data to me via e-mail.   I'm able 
to send e-mails from my laptop but when I use the same set-net settings 
on my host account I get the following error: ** User Error: Server 
error: tcp connection failed
** Near: smtp-port: open [scheme: 'esmtp] 
either only
Maxim:
12-Dec-2009
most smtp servers do ip filtering on the input.  this allows them 
to know who is sending the email to them and will only allow ips 
they serve to connect.


since your hosting account is probably on a remote server, it won't 
be allowed to send data via your home smtp server account.
Maxim:
12-Dec-2009
when you say hosting account, you mean a server on the net with its 
own dns/ip which is different than the ip being served to you by 
your access provider... yes?
Von:
12-Dec-2009
Yes, it's a shared hosting account; my provider is GoDaddy.
Von:
12-Dec-2009
SMTP Relay lets you send email messages through your email account 
using your existing email service. For example, you can continue 
to use Microsoft Outlook to compose, receive, and send email messages, 
but the actual email messages are processed through our SMTP relaying 
services. This lets you bypass ISP restrictions on your outbound 
email messages and allows you to use your professional looking "[sales-:-coolexample-:-com]" 
email address rather than a general “[sales-:-ispname]” address.
Maxim:
12-Dec-2009
so, von, if you have a godaddy mail account setup, you can connect 
to its smtp server directly. 


is your hosted machine's set-net function setup to connect to something 
like [smtp-:-godaddy] ?
Graham:
12-Dec-2009
well, doesn't it ask you for a password??
Graham:
12-Dec-2009
esmtp requires a password
Graham:
12-Dec-2009
so you need to encode the password somewhere if you're going to use 
a script
Graham:
12-Dec-2009
well, then you need to a trace/net to see where the issue is
Graham:
12-Dec-2009
do you have a shell account?
Graham:
12-Dec-2009
make it a cgi script and see what is written to %log.txt
Henrik:
13-Dec-2009
would there be instances where write/lines/append would write a quarter 
or half a line? I'm logging tests of several script instances into 
the same file and write/lines/append sometimes produces only half 
a line in the log.
Janko:
13-Dec-2009
could you create something like a trie in rebol or would you have 
to go lower level for it to be normally eficient?
Janko:
13-Dec-2009
(let's say I want to use key-value (string-int) pairs for 5M words 
.. hash tables are probably more memory consuming for such a big 
set of data?)
Maxim:
13-Dec-2009
hash tables for such a big set are the only way to go... they will 
be magnitudes faster on access.
Maxim:
13-Dec-2009
but when things are in the millions, sometimes using a disk-based 
on-demand caching algorithm is fastest... it really depends on the 
application.


cause think of it this way.  every byte used by each element becomes 
a MB  so adds up quickly.


5 million pairs of (10 byte) strings and pairs... is just about 350MB 
!

 >> b: make block! 5000010
>> m: stats
== 84172417

>> loop 5000000 [append b copy random "1234567890" append b random 
10000000]

== ["5862713409" 4765171 "2546013987" 2726704 "9528013746" 3565380 
"4591302786" ...
>>  stats - m
== 348435008
Janko:
13-Dec-2009
Maxim .. thanks a lot for your answers.. very interesting .. I know 
from distance how hashtables work internally but I don't know details.. 
should a block take roughly the same space as hashtable of the same 
block (in rebol) or factor(s) different?
Maxim:
13-Dec-2009
hum... lets see:  ;-)

a: stats
b: make block! 5000010
print stats - a
== 80001039

a: stats
b: make hash! 5000010
print stats - a
== 80005071
Janko:
13-Dec-2009
>> a: stats b: make block! 1000 repeat i 1000 [ append b random "abcdef" 
random 100000 ] print stats - a
48671

>> a: stats b: make hash! 1000 repeat i 1000 [ append b random "abcdef" 
random 100000 ] print stats - a
81454
Maxim:
13-Dec-2009
but... filled up....

b: make hash! 5000010
m: stats

loop 5000000 [append b copy random "1234567890" append b random 10000000]
print stats - m
== 188430448

here its half the space.


a ha!  depending on the string input... hash tables can actually 
be smaller...   :-)
Janko:
13-Dec-2009
stats is a cool command , with many refinements also .. I didn't 
know about it
Maxim:
13-Dec-2009
in REBOL, we're a newbie a few minutes... every day.... even after 
a decade of using it   ;-)
Janko:
13-Dec-2009
I am nevbie a little longer each day :)
Janko:
13-Dec-2009
hm.. I have a very newbie question .. do you most effectively add 
new pairs to hashtable by appending to it as a block ? can't figure 
out how to change a value .. set doesn't work that way
Maxim:
13-Dec-2009
a: make hash! [ "33" 33 "44" 44 "55" 55]
select a "33"
change find a "44" ["88" 88]
== make hash! ["33" 33 "88" 88 "55" 55]
Pavel:
14-Dec-2009
Transfering memory based hash! (map! in R3) datatype into disk based 
shema automatically keeping the hash table computation and lookup 
hidden from user gives you a RIF. Holly grail of all rebollers :) 
long long time promissed, still waiting to be done. Anyway hash tables 
are always usually unsorted, when necessary to search in usually 
some type of additional index is used (B-tree for example), for simple 
information if the key is in the set, bitmap vectors are used with 
advantage, when the set is really big (and bitmap vector doesn fit 
into memory) comressed bitmap may be used and usually bitwise operations 
on those vectors are much quicker than on uncompressed. 

Thisi is why it should be used for bitset! datatype anyway. The number 
of byte aligned (BBC,Packbit,RLE)od word aligned (WAH) schemes exists. 
 It is used in very large datasets when index also resides in disk 
file. Once again bitwise operation may be much quickier even in memory 
on those schemes.
Pavel:
14-Dec-2009
For those interrested a Fastbit webpage is good source of docs.
Maxim:
15-Dec-2009
I will be rebuilding the callback example with a much better/simpler 
design. but they work very well, basically I have mapped the Reb_Do_String() 
and Reb_Print() functions so that they can be called from within 
any extension.
Maxim:
15-Dec-2009
I am also building little helper funcs like a REBOL datatype centric 
version of sprintf  which acts a bit like a C-side rejoin for REBOL.
Maxim:
15-Dec-2009
this way we can create rebol code directly from strings and native 
data very easily.


there is currently a size limit on executed strings, its a simple 
question of optimisation.  this means we can't use the wiredf function 
for creating large datasets via strings (for now).

but I'm already doing stuff like:


wiredf("rogl-event-handler make wr-event [new-size: %p]", win-w, 
win-h);


calls rebol's do with %p replaced by a pair, using 2 ints.  this 
is a varargs function.
Gabriele:
18-Dec-2009
i was just thinking again about the idea of IF (etc.) keeping a reference 
to the condition argument for you, that is, so that instead of writing:

    if x: select block value [do-something-with x]

you can write:

    if select block value [do-something-with it]


The reason people say it's not worth it is usually that of having 
to bind/copy the block - you don't want that in every IF call and 
probably not even in the ones where it would be useful (and, there's 
really no other name you could use for the function).
BrianH:
18-Dec-2009
IT could be a function that returns the thread-local top of the stack 
of implied subject values. IF would then push a value on that stack, 
and pop the value off when it returns. Might be tricky to make error-throw-safe, 
but easy to make thread-safe :)
BrianH:
18-Dec-2009
A *lot* of code uses the trick of having IF or UNLESS return none 
when the condition is not met, so your other suggestion is unlikely.
Steeve:
18-Dec-2009
A *lot* ?
somewhat exaggerated :-)
Steeve:
18-Dec-2009
For complex control flow rules, i rather prefer CASE.

Most of the time, combitations of ALL ANY, can be replaced by a CASE 
structure (which is faster and more readable)
BrianH:
18-Dec-2009
Gabriele, it occurs to me that if IT was native it could look up 
the stack to get its value. I'll try writing a (security hole) REBOL 
version of the function later today - it would require debug privileges 
to run so that it can call the STACK function.
Steeve:
18-Dec-2009
a sort of native POP function
Steeve:
18-Dec-2009
I don't know how the values evaluated are stacked by the VM. But 
i see the advantage of having a POP function.
We could easly create postfix functions.
e.g:
CONCAT: func [v][join pop v]

>> "a" concat "b"
=="ab"

All sort of new operators would be easy to construct
BrianH:
18-Dec-2009
Steeve, R3 evaluation doesn't work that way - it's not a stack machine.
Gregg:
18-Dec-2009
I have an old IF-IT function, which just does a bind/copy. I used 
it a bit when I first wrote it, but it hasn't become a part of my 
daily life.
Gabriele:
19-Dec-2009
Brian: a lot of code uses IF returning none, agreed, on UNLESS i'm 
not really sure, it's quite new. besides, it's not like R2 scripts 
run unchanged on R3; but anyway i was just thinking out loud, not 
really proposing anything.
Paul:
19-Dec-2009
This function returns a copy of everything until it finds the value 
specified and then it breaks.
Henrik:
19-Dec-2009
a: [b c d]
copy/part a find a 'd
== [b c]
Steeve:
19-Dec-2009
Brian, even if the Rebol's VM  is not a true stack machine. It has 
a data stack, so that, the POP function could be emulated in some 
way.

A forth kernel, is nothing else than that. To simulate a stack machine 
on a processor that is not designed that way initially.
However, your response suggests that the cost would be high.
BrianH:
19-Dec-2009
The reason Steeve's proposal doesn't work is because the result of 
the prior expression is thrown away, not pushed on a stack.
BrianH:
19-Dec-2009
Sorry Bolek, I should have been more specific. I meant Steeve's POP 
proposal and the CONCAT example wouldn't work (for reason's stated 
above). Gabriele's IT proposal and Steeve's sample implementation 
of it would work a little, but would need modification.
Sunanda:
20-Dec-2009
There are 45 scripts on FREBOL.org that appear to use UNLESS (there 
may be a few false positives in this -- if, say, the word UNLESS 
has been reused):
   http://www.rebol.org/search.r?find=unless+[b]
Rebolek:
3-Jan-2010
I was reading http://www.chalicegames.com/swym/SwymWebIntro.html
and some concepts were interesting to me(especially ETC), so I made 
REBOL equivalents:

http://box.lebeda.ws/~rebolek/rebol/swyv.r


There's a documentation in the script, so just few examples of what 
it can do:

SERIE:


>> serie [etc 1 2 4 .. 20 cycle [1 2 3] length 5 iterate [x: x + 
10] from 10 5]

== [1 2 4 8 16 1 2 3 1 2 10 20 30 40 50]

COMPARE:

a: [1 2 3 4 5 6 7 8 9]
b: [2 4 6]
>> compare a b [some a > every b]

== true


>> compare a b [one a > every b] 

== false

FILTER:

>> filter serie [iterate [x: x + 1] 10 ] [[x > 2] [x < 5]]

== [3 4]

>> filter etc [3 6 9] 100 [x > 250]

== [252 255 258 261 264 267 270 273 276 279 282 285 288 291 294 297 
300]

>> filter serie [1 .. 10] [[x > 5][zero? x // 2]]
== [6 8 10]


It's written in R3 but should also work in R2 (not tested). It's 
not optimized so if you're interested in it, feel free to do whatever 
you want to improve it (more patterns that ETC can recognize...).
Dockimbel:
3-Jan-2010
Rebolek: thanks for the link, lots of good food for thought here. 
That would be great to support it at native level (using a R3 extension). 
I also wonder how much of it could be implemented efficiently using 
'map-each and 'apply. Anyway, this could be a really great addition 
to R3 (or even R2). Keep up the good work.
Steeve:
3-Jan-2010
Well it's interesting as a study dialect. But to be honest guys, 
i don't see the interest  to have them in Rebol.

Because we can do much of the use cases rebolek showed us  with one 
or two lines of rebol code.

And i don't need to say that it will got lightning speed by comparison

But anyway, It's lot of fun to do such things with Rebol.
Anton:
4-Jan-2010
Bolek, that's very interesting for me because I was searching for 
just such a declarative dialect for sound generation and music composition.
Rebolek:
4-Jan-2010
Pekr, vectors are really great. But they need few improvements and 
 bugfixes here and there. I wrote a document what doesn't work and 
should some time ago (has been two years already? I think so). I 
haven't looked at them recently, so maybe they're improved already. 
I should check my R3 AIFF/WAV loaders/savers wheter they work as 
they have been the best test for vectors I had.
james_nak:
5-Jan-2010
Smart guys. This may seem elementary but I need to check if certain 
ports are open on a windows machine. For example, port 8881. I use 
something like error? try [close open to-url "tcp://:8881"]  (building 
these strings with various port numbers). My problem is I don't know 
how to check if it is working. I turn on the firewall and it doesn't 
seem to make a difference. Perhaps my thinking is all wrong and all 
I am doing is checking within the firewall. Any thoughts?
Graham:
5-Jan-2010
all that does is trying to open a server port
Graham:
5-Jan-2010
if you want to check if there is a server port listening then you 
can do

open tcp://localhost:8881


and if you want to see if that port is open to the outside, then 
you need to use another PC to probe that port address
james_nak:
5-Jan-2010
Thanks Graham and Sqlab. One step further if you please. What would 
you suggest the steps would be to test the code. Right now when I 
run the test I get no opened ports. I've turned the firewall off 
and on but the results are the same. 

I've been studying the nettools.r code and thinking that maybe I'm 
not thinking this right. What I want to know is if a certain port 
will allow it to be open so that this particular application has 
can use.it. What is happening is customers are installing the app 
and having trouble because these certain ports are unavailable. What 
I wanted to create was a quick and easy pre-install test to verify 
these ports were open. This partly due to the fact that they way 
the software was written it doesn't tell you that a closed port is 
the problem. It simply stops worting. 
I appreciate the feedback you have given.
Graham:
5-Jan-2010
what the code checks for is if anyone is listening at a certain port 
...not whether the firewall is open or closed.
Graham:
5-Jan-2010
If the firewall is off, but no one is listening ... then you'll get 
a closed port
same as if the firewall is on, and someone is listening...
Claude:
5-Jan-2010
what about R3 status ? make uptodate  R2 is very fine but i would 
prefer a R3 version with GUI and ODBC or MYSQL ..................;
BrianH:
5-Jan-2010
some miracle

 in this case meaning a community member with the time volunteering 
 to do the work.
Claude:
5-Jan-2010
do you have a plan for the beta realase ?  one week, month,
BrianH:
5-Jan-2010
It's a little flexible - outside circumstances have affected the 
timing already.
Claude:
5-Jan-2010
i am just like an end user on R3.  and for me i am not a guru like 
you and others !!!!!
BrianH:
5-Jan-2010
There will be no miracle that will bring the GUI or database to the 
first R3 release - they just aren't done yet, and can't be done with 
the level of community involvement that the alpha releases have engendered. 
Too many critical people are waiting for a beta or full release before 
they will even start to get involved. Fortunately we are on the rapid 
release model, so there is no such thing as a "final" or "full" feature 
set, just the feature set of a particular release.
BrianH:
5-Jan-2010
If non-gurus can't use the GUI, it's a design flaw that needs to 
be fixed.
Graham:
5-Jan-2010
Ok, let's create a new r3 group ...
Graham:
5-Jan-2010
anyone got a code color rinser for R source?
Rebolek:
6-Jan-2010
>> a: [1 2]                 
== [1 2]


>> reduce [a swap a next a]

== [[2 1] [2 1]]

Why it doesn't return [[1 2] [2 1]] ?
Rebolek:
6-Jan-2010
This works as I expected:
>> a: [1 2] 
== [1 2]
>> compose/deep [[(a)] [(swap a next a)]]

== [[1 2] [2 1]]
Rebolek:
6-Jan-2010
Hm, I understand that now:

>> a: [1]

== [1]


>> reduce [a append a [1]]
== [[1 1] [1 1]]

Interesting. I never knew that.
Dockimbel:
8-Jan-2010
Regarding capturing of globally defined words in a local context, 
as Gabriele likes to say : "for every code you would write that would 
work for you, I can write an example code that will break it" ;-)
Henrik:
8-Jan-2010
setting no global words: use a context
Janko:
8-Jan-2010
I imagine when you now set some word in some function it looks at 
/local words and it it's there it creates a local word, if not it 
just sets a word (globaly).. let's say that there is funcstrinct 
that in second case just throws an error (probably something like 
that could be made in rebol itself)
Janko:
8-Jan-2010
Henrik: but I don't want to make each function a context (probably:) 
) .. I have to admit I don't know much about contexts .. only that 
it's like object
Janko:
8-Jan-2010
I am changing to using a context now for all words that are defined 
outside functions on rps pages to make them local to that pageload
Dockimbel:
8-Jan-2010
Just remembered about querying system/words, that would give you 
a mean to detect new global words.
Dockimbel:
8-Jan-2010
>> query/clear system/words

== [end! unset! error! datatype! context! native! action! routine! 
op! function! object! struct
! library! port! any-type! any-word!...
>> context [set 'a 5]
>> query system/words
== [a]
Janko:
8-Jan-2010
Doc .. thanks a lot for that query word ... it' awesome to see on 
a page what all got set in the process.. this will help me the to 
make code more strong A LOT!


Doc.. how does the runtime binding to function local words work? 
func is probably not a  mezzaine or something where we could peek 
into what it does with /local words ?


Henrik: I need to learn more about them and how to use them .. are 
there any good docs to read about what contexts are used for maybe?
Dockimbel:
8-Jan-2010
Janko, a function is a context! value like objects. You can use the 
following mental analogy to see how it is related :

foo: func ["for demo" a [integer!] /local b][...]


would be *roughly* equivalent to constructing an object like that 
:

foo-def: make object! [
	hidden-ctx: make object! [a: none local: none b: none]
	body: [...]
	spec: ["for demo" a [integer!] /local b]
]


The body is bound to the 'hidden-ctx context at function creation. 
When calling 'foo, the interpreter will set the 'hidden-ctx object 
words values according to passed arguments and refinements and then 
DO 'body.


There's no differences on how REBOL treats "arguments" and "local 
words", it's part of the illusion. The /local refinement is used 
by *convention* only, to set "local words", you could just decide 
to use any other refinement for the same job. Here's an example :

>> a: func [/local b][print b]
>> a/local 5
5


Additionnaly, when you apply the ordinal natives on a function! value, 
you get :

>> first :foo
== [a /local b]		;=> the hidden context words

>> second :foo
== [...]			;=> the function body block

>> third :foo
== ["for demo" a [integer!] /local b]	;=> the original spec block
Henrik:
8-Jan-2010
trying:

source context

might be a revelation too.
Janko:
8-Jan-2010
ok .. query/clear will find me seek out leaking globals so this problem 
has got a solution in a way
Dockimbel:
8-Jan-2010
Object! and function! have different creation and usage semantics, 
AFAIU, they share a common internal parent datatype, context!. So, 
context! (which is not directly accessible) should be "cheaper". 
Objects and functions have different purposes, so this might be like 
comparing apples and oranges...in a closed blackbox.
Dockimbel:
8-Jan-2010
BIND on a block! does a full recursive traversal of the block! and 
for each word! found, does a fast lookup in the target context (probably 
hashed). So the cost is directly proportional to the size and depth 
of the argument block!.
Henrik:
8-Jan-2010
well, how else would you do it? I guess you need kind of an escape 
sequence to evaluate a word or something.
Steeve:
8-Jan-2010
Terry, show use case you think is cumbersome and we'll show you a 
simpler way (i hope)
Terry:
8-Jan-2010
<<< is a here-doc in php
Terry:
8-Jan-2010
so.. the result is a button that alerts.. 

\'hello\'s {Worlds \';

...and prints...

 'and {so "on';

after the button
Gregg:
8-Jan-2010
There has been talk in the past of including a substituion function, 
REWORD being the R3 func for it. In R2 we have build-markup, which 
shouldn't be hard to hack, but I don't know of a version that anyone 
has done for a given substitution syntax.
Gregg:
8-Jan-2010
Now, that's norribly naive, and doesn't work because of that. e.g. 
it needs a space before the $ marker, so a var at the beginning of 
the text gets missed.
Steeve:
8-Jan-2010
yes seems a little messy Greg ;-)
Gregg:
8-Jan-2010
Needs a different name too, as Ladislav has a nice BUILD func that 
works on blocks.
Gregg:
8-Jan-2010
I need a spec first. ;-)
45701 / 6460812345...456457[458] 459460...643644645646647