• 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: 3301 end: 3400]

world-name: r4wp

Group: Rebol School ... REBOL School [web-public]
MarcS:
12-Oct-2012
ladislav: i meant when not binding inside a block
Ladislav:
12-Oct-2012
BTW, the examples both use binding in a way
Ladislav:
12-Oct-2012
actually, you cannot use assignment "outside of a block" in REBOL
Ladislav:
12-Oct-2012
(there is always a block somewhere)
MarcS:
12-Oct-2012
i guess: assigning to a word in the global (system?) context
Ladislav:
12-Oct-2012
(the 'A word is not local)
MarcS:
12-Oct-2012
yes, but the other part was: not inside a(nother literal) block
Ladislav:
12-Oct-2012
In REBOL, there is always a block somewhere
MarcS:
12-Oct-2012
ladislav: yes, okay - i'm just saying that i understand the pitfalls 
of not copying when you're re-entering a block (be it a loop, function, 
etc. body)
Ladislav:
12-Oct-2012
for example, something like:

do "a: []"

first "converts" the string to a block
MarcS:
12-Oct-2012
but where i'm assigning to a "global" (which i understand is just 
another context) outside of an explicit (one i write myself) literal 
block, are there pitfalls in not using copy
MarcS:
12-Oct-2012
so: best practice is to consider everything to be inside a block, 
and hence copy even toplevel literals?
Ladislav:
12-Oct-2012
in the

    a: []


it is so, that if you do not "reuse" the literal block then it does 
not matter whether you copy or not
Ladislav:
12-Oct-2012
and by "keep the code" I mean "keep the code as a block", if you 
keep it as a string then it does not matter
Henrik:
12-Oct-2012
sorry, MarcS. you are right again. I better take a nap...
Ladislav:
12-Oct-2012
However, when writing something like:

a: []


into a file, you may not be totally sure that somebody does not LOAD 
your code and try to evaluate it twice....
Endo:
17-Oct-2012
Henrik: I've registered on http://hmkdesign.dkBugs database (curecode), 
I got an error when I create a new account but I think it created 
my user. Can you check it please?
My username is "endo".
Endo:
17-Oct-2012
I've setup a new Cheyenne (r179) with html-008.r included, playing 
with html dialect.
Henrik:
17-Oct-2012
now validated... also validated 3 other registrations from 2009... 
I guess they are in for a surprise email. :-)
Sunanda:
31-Oct-2012
Why can't  a button hide itself? Looks like /SHOW? is always set 
TRUE on exit from an action facet:
    view layout [b: button "hide me" [hide b print b/show?]]
   (esc)

   print b/show?   ;; expect FALSE if button clicked, but always get 
   TRUE


My ungainly work-around is to move the button well out of the visible 
area:

   view layout [b: button "hide me" [b/offset: -100x-100 - abs b/offset 
   show b]]

(the abs and -100s allow me to reverse the action to put it back 
where it was)
Henrik:
31-Oct-2012
AFAIK, it's because the action is run on mouse down, and the mouse 
up event causes a redraw, which will then show the button again.
Henrik:
31-Oct-2012
you are right. the problem is probably that the action is run before 
the redraw takes place. but it's been a few years now since I worked 
on this problem.
Maxim:
31-Oct-2012
IIRC feel/redraw does a show on a face which forces it back on.
Maxim:
31-Oct-2012
just about every time I've had to fix something with VID it was related 
to the fact that redraw is being used.  its a very bad design... 
redraw should never have been put into the feel.   its also a big 
slowdow, since it forces every face to redraw itself when you show 
a pane.
MaxV:
31-Oct-2012
A button can remove itself: lokk here:
a: layout [b: button [remove find a/pane b show a]]
view a
Sunanda:
2-Nov-2012
Another question ... I'vd like a field action facet to be triggered 
on field exit.
But I can find two cases (under windows) when it isn't:
1. ctrl+tab out of the field, rather than tab
2. right click another face, eg a button


   view layout [field 100x100 [print "field was exited"] button "click 
   me" [print 'left] [print 'right]]


Any ideas for making the field action trigger in all cases? Please!


(Right now my workaround is to do a bulk check on all fields when 
the user clicks a main action button like SAVE, but that means they 
may see multiple field-exit messages all at once, and later than 
they'd expected).
Maxim:
2-Nov-2012
that is a strange bug
Sunanda:
2-Nov-2012
Yes, it is thanks. I stumbled across a case where I had to run DEHEX 
twice because it skipped a few values the first time.

Sadly, not been able to replicate that in a one-liner, so it may 
have been something stupid I did.
Maxim:
2-Nov-2012
it is a bug in R2 2.7.8
Maxim:
2-Nov-2012
it may in fact refer to some part of the RFC which prohibits character 
0 from URLs (which I am guessing is the case, haven't read that RFC 
for a time).


 in this context, it makes sense to leave it there, but if using dehex 
 for other purposes its annoying.
Endo:
2-Nov-2012
Note, however, that the 

%00" percent-encoding (NUL) may require special handling and should 
be rejected if the application is not expecting to receive raw data 
within a component." -RFC 3986
BrianH:
2-Nov-2012
Skipping is not rejecting, and Rebol doesn't require special handling 
of NUL in a string. DEHEX made the wrong choice.
Nicolas:
2-Nov-2012
I made a program that embeds a dll to generate a cellular automaton 
image. Could someone test it for me?     http://pastebin.com/raw.php?i=67KtcSK3
Maxim:
2-Nov-2012
seems to work here  (a big triangle filled with some recursive inverse 
triangles)
Nicolas:
2-Nov-2012
I'm curious. Is there anyway to access a binary function like this 
without writing it to a dll or shared object I wonder?
Nicolas:
2-Nov-2012
The triangle is a cellular automaton. This one is a good source of 
randomness according to Stephen Wolfram.
Arnold:
5-Nov-2012
I need to save some stack space for my evaluation routine runs out 
of stack with the search-depth on 2 (I had expected this but than 
on depth 5 or so)

can unset help? Is there a method to keep track of the stack? To 
see how much you have and use up?
Sujoy:
5-Nov-2012
just saw this:
http://www.rebol.org/aga-display-posts.r?post=r3wp226x4139
trying a reboot
MaxV:
6-Nov-2012
WOW, I didn't know of the existence of Amazon Linux. 

It has a very particular configuration for cloud and not for graphic, 
so you need Xvfb.
Sujoy:
6-Nov-2012
took a while to figure out, but i found your posts on altme
NatasjaK:
6-Nov-2012
With Kaj here I've got my own private school, but I still am curious, 
so taking a look here. Goodmorning.
Sujoy:
6-Nov-2012
Kaj - i've been trying to run the ZeroMQ bindings on an Amazon Linux 
AMI (took a while to get Rebol View running!)

I have installed and built zeromq from the source, but the result 
is a 64bit build, so rebol complains:

wrong ELF class: ELFCLASS64

would you happen to have a 32bit libzmq.so i can use?
Kaj:
6-Nov-2012
They're in the MSDOS folder. The 0MQ library is a bit old, because 
newer available versions are a bit harder to unpack in Windows, but 
it's sufficient for my bindings
Kaj:
6-Nov-2012
It would be best to force a 32 bit compile on your AMI. If that's 
problematic, best install some 32 bit distro and extract them from 
there
Sujoy:
6-Nov-2012
got it working just as you said. forced a 32bit compile of zeromq
works - i can now do %ZeroMQ-binding.r2 with no issues
more anon
Ladislav:
6-Nov-2012
An unhappy Ubuntu user (seems disoriented, not even knowing how to 
create a new ML thread):


https://groups.google.com/forum/?fromgroups=#!topic/Rebol/iSgc1-dDZLs

I guess somebody can tell him what he needs to download.
JohnM:
12-Nov-2012
Hello, all.


 Back in May I was here asking for lots of help in creating a simple 
 CGI script in REBOL. Wanted to say thanks. It was most appreciated, 
 especially considering how rarely you get new people my questions 
 must have seemed so simple to the point of boring the crap out of 
 all of you hardcore experts. My regular job has insane hours and 
 months pass by in what seems like minutes. The person I was doing 
 it for suddenly had other things come up on his website and business 
 that required attention first so it fell by the wayside. I intend 
 to pick it up where I left off this week during an evening when I 
 have more time. While I had a few minutes I had to send my thanks.


 And I see REBOL might become open source... good to see it  moving 
 forward instead of stagnating.
JohnM:
14-Nov-2012
Thanks for the welcome back message.
 

 I left off asking about the mySQL driver. So I want to insert into 
 a database a random number the code already generated and associate 
 it with an email address that was provided by a CGI form. Have yet 
 to create this in the real world but for now let us assume I will 
 call the database "customers". The people who process the credit 
 card and collect the email address advised me that the address will 
 be labelled "trnEmailAddress".


 After finding the mySQL driver Here is what I figured out using placeholders 
 for things like password, etc. Would appreicate knowing if this is 
 correct.

; Loads MySQL driver
do %mysql-driver/mysql-protocol.r
; Opens connection to MySQL server
db: open mysql://[[user][:pass]@]host[:port]/database


; Send query to database server. Enters random number from above. 
customers is probably the name of the database I will create

insert db ["INSERT INTO customers VALUES (?,?)" "trnEmailAddress" 
"token"]



 Next I need to insert an existing PDF file (an e-book) into a directory 
 created by the script. The directory will be named after a random 
 number that was earlier generated by the script. I am astounded that 
 I can not find the command to copy a file. So the variable assigned 
 to this random number is called "token".

 So I have the following.

make-dir %token/


 How do I copy a file into this new directory? Also, is that the corecct 
 way to make a directory?
Andreas:
16-Nov-2012
Basically, you create an HTML file and put it on your webserver. 
Let's call it "form.html":


<form action="form.cgi"><input type="text" name="word"><input type="submit"></form>


Then you create a REBOL CGI matching the "action" used above, so 
"form.cgi", and also put it on your webserver:

#!/usr/local/bin/rebol278 -cs
REBOL []
cgi-values: construct decode-cgi system/options/cgi/query-string


;; Now you can access the "word" value submitted via the HTML form
;; as cgi-values/word.

;; Let's echo the value back to the user, as an example:
print rejoin [
  "Content-type: text/html" crlf
  crlf
  cgi-values/word
]
Andreas:
16-Nov-2012
Instead of echoing the value back to the user, you can do whatever 
you want in the CGI. Such as inserting the value in a database.
Endo:
22-Nov-2012
Where to use throw-on-error function? How differ from DOing a block?
Endo:
23-Nov-2012
Got it. Thanks a lot.
afsanehsamim:
23-Nov-2012
result is like:[
    ["c" none]
]
[
    ["a" none]
]
[
    ["t" none]
]
[
    ["a" none]
]
[
    ["e" "e"]
]
[
    ["r" none]
]
[
    ["o" "o"]
]
[
    ["a" "a"]
]
Ladislav:
23-Nov-2012
then you may need some formatting like:

print "<table>"
foreach row result [print "tr" foreach cell row [print "td" ...

, i.e. print out a HTML table specification
afsanehsamim:
23-Nov-2012
i could get results on web page but there is a problem...in each 
row of table i can see both values(correct and user value )...i want 
use if condition which shows only  the correct result
Ladislav:
23-Nov-2012
Example:

    print either a < 0 ["a is small"] ["a is big"]
Ladislav:
23-Nov-2012
or just

    if a < 0 [print "a is small"]
Ladislav:
23-Nov-2012
you mean like this?

    if a =  0 [print "a is zero"]
Ladislav:
23-Nov-2012
ALERT is not meant for CGI, it is a GUI function.
Ladislav:
23-Nov-2012
So, no, if you are creating a CGI script, don't use ALERT
afsanehsamim:
23-Nov-2012
okay...anyway tnx a lot for helping me.
GrahamC:
11-Dec-2012
Header expects a block
Endo:
11-Dec-2012
Thanks a lot!! Tomorrow I'll try with salesforce, I hope this is 
the only problem.
GrahamC:
11-Dec-2012
from my page "NB: Rebol2's existing prot-http currently supports 
this undocumented method using a 'header keyword"  :)
Endo:
11-Dec-2012
That's right. I read your page now. Thanks a lot, it will save my 
day.
Maxim:
11-Dec-2012
Endo,  a lot of stuff in rebol is learned by scanning the source 
code... and probing or using help on system and its members.


you can probe all the port handlers to see how they work, I still 
do this all the time... most of the very skilled Rebolers know , 
above all else, how to browse the rebol source included in the interpreter 
itself.
Endo:
12-Dec-2012
Finally I got it work with Salesforce, when I complete my work, I'll 
write a document for it, so I can save someone's hours.
Maxim:
12-Dec-2012
thanks, I might need to connect to salesforce myself in a few weeks. 
 :-)
Geomol:
20-Dec-2012
graphics in GCam.

The start of a button is:
Geomol:
20-Dec-2012
I'm not a graphical artist, and I have never used applications like 
Adobe Illustrator or similar. But I found, I can create ok graphics 
by programming it in e.g. DRAW and be very careful with the details. 
I do use GIMP for some tasks.
Henrik:
20-Dec-2012
There are still a few last bits in DRAW that are missing. I wonder 
if these are possible to add now? Something like making a gradient 
on a line would be very useful.
Bo:
20-Dec-2012
Geomol, thanks for the tutorial.  That was great.

Here's a logo I produced entirely using Rebol draw:

http://respectech.com/respectech.jpg
Bo:
20-Dec-2012
But it was all done in a 'layout block. :-)
Geomol:
21-Dec-2012
Looks good! DRAW is a strong tool.
Gabriele:
21-Dec-2012
Kaj, I think I remember the draw crash being a linux bug (or at least 
a non-windows one).
Arnold:
21-Dec-2012
Steeve, I copied and pasted this on the Mac, but I only see a black 
box in a grey window with title "NEON"
Kaj:
24-Dec-2012
2.7.8 Works better for me, but Neon gives a black window
Endo:
3-Jan-2013
Isn't that interesting?
>> ? #a
#a is an issue

>> copy/part next #aaaa 2
== #aa ;<-- issue!

>> pick #aaa 2
== #"a"  ;<-- char!

Why the last one is not an issue?
Jerry:
3-Jan-2013
in R3, you cannot COPY and PICK a issue!, because it's not string 
any more.
BrianH:
3-Jan-2013
(Pardon the level-up in the lesson.)

That's not necessarily the case for R3, it's just the case *now*. 
COPY and PICK are just actions, which could easily be defined for 
the issue! type. You could get most of the R2-like behavior for issues 
in R3 by emulating the way tuples pretend to be series when they're 
really not.


The type classes in Rebol aren't like base classes in OOP languages, 
they are more like behavioral conventions, and those conventions 
are more like Go interfaces than anything OOP. Something is series-like 
to the extent that it behaves like a series is supposed to behave. 
But the acrions that are defined for series types are in some cases 
also defined for other types as well, and the corresponding behavior 
for those types can be similar enough to that of series to allow 
both series and, say, tuples, to be operated on by the same code. 
All that matters is how it seems to act from the outside, not what 
it really is.
BrianH:
3-Jan-2013
We've been making this even more the case in R3 and R2 lately, such 
as when we allowed SELECT to be used on objects (and maps in R3), 
since that is a function that is used to make series act like objects. 
Or when we allowed APPEND to work on objects and maps in R3, since 
there was a corresponding behavior that could be defined for those 
types, but didn't do the same for INSERT because its positional return 
value has no corresponding concept for object-like types.
BrianH:
3-Jan-2013
For issues, we could have COPY return another issue of the same spelling, 
COPY/part return another issue spelled like that portion of the original 
(only integer part values, not offset positions because words don't 
have positions), and PICK return a character just as if the issue 
was a character container like strings are. We would have to avoid 
the positional functions, and the modifying functions could retern 
a different version the way that they do for the similarly immutable 
tuples, but the rest could be emulated as-is.
caelum:
31-Jan-2013
So I have a block
	account: make object! [
	  name: "James"
	  balance: $100
	  ss-number: #1234-XX-4321
	  deposit:  func [amount] [balance: balance + amount]
	  withdraw: func [amount] [balance: balance - amount]
	]

and I save it

	save %account-object account

then I read it back in

	new-account: load %account-object

account is an object, whilst new-account is a block.


My question is, how do I load the object into new-account as an object? 
So I end up with another object, not a block
Endo:
1-Feb-2013
you can also use SAVE/ALL to save in serialized form:
>> o: context [a: 1] save/all %file.r o p: load %file.r type? p
== object!
Maxim:
1-Feb-2013
the most secure method is to SAVE/ALL AND CONSTRUCT.


also, btw, using MOLD/ALL can save a lot of ram because things like 
hash! and objects! do not get double allocated.  on big datasets 
like I'm  using it means saving 100MB RAM on app startup . :-)


just be carefull with save/all & mold/all   they can corrupt some 
data types just like when /ALL  isn't used.  it does allow much more, 
but it still can create some un-reloadable issues... always test 
it with your current data structures before blindly adopting it.
Endo:
1-Feb-2013
Yes, here is an example:
>> save/all %file.txt o context [a: self]
>> load %file.txt
** Syntax Error: Missing ] at end-of-script

file.txt file is:
#[object! [
    a: #[object! [...]   ;<---
]]
BrianH:
1-Feb-2013
Caelum, SAVE/all and MOLD/all will have trouble saving your example 
object in a restorable state. The problem is those functions defined 
in the object, and bound to its fields. Those bindings won't be restored. 
For data that has to be saved and restored safely you're better off 
with having functions that operate on objects, rather than objects 
with functions in them. The "safely" part actually refers to not 
executing code, and you have to execute code to create functions. 
It's better to put your code in one file which you can protect, and 
your data in another file which you can be more wary of.
BrianH:
1-Feb-2013
In this case, you keep your code and data separate because code is 
best saved with MOLD and reconstructed with DO, but data of types 
that don't have a normal literal form (but aren't affected by binding) 
are often better saved with MOLD/all and restored with LOAD. The 
main thing is that we don't have a literal syntax to declare word 
bindings; instead, we have a way to construct them with code. Same 
goes for cyclic or DAG structures that aren't strictly nested. So, 
if you need to create such things, you need to run code. And you 
need to keep your untrustworthy data that you can't safely DO separate 
from that code.
caelum:
2-Feb-2013
Thanks BrianH. I am aware of the need to "keep your untrustworthy 
data that you can't safely DO separate from that code."


I am creating a small Rebol server capable of communicating with 
clients, using RSA key exchange and the blowfish algorithm, both 
of which work to reasonably high encryption levels in Rebol, 4096 
for RSA and 512 for Blowfish (yes I know the effective upper limit 
for Blowfish is 448 bits, but that is good enough for my purposes).


I want to save the RSA key as a block so it can be loaded back into 
the program and used again, hence my question. It will be encrypted, 
wherever it gets saved, so there will be no chance of it being messed 
with.


Actually, I am writing a much simpler version of Rebol Services, 
since I could not get that to work and my ability to code in Rebol 
was not sufficiently developed yet to see how to get it working.


I am in a steep learning curve right now with Rebol and the time 
I am investing is starting to pay off. Thanks for the information 
about keeping code and data separate. It's always good to be reminded 
of 'obvious' truths.
Reichart:
2-Feb-2013
Francis, if you search through the Qtask source, you will find a 
448 encryptor writte in JS that runs in the browser, you might enjoy 
how we did it.
caelum:
23-Feb-2013
So I have a question about RSA encryption. When I run the following 
code:

  rsa-key: rsa-make-key
  rsa-generate-key rsa-key 1024 3

  crypt-key: copy/part checksum/secure mold now/precise 16
  print crypt-key

  crypt-key: rsa-encrypt rsa-key crypt-key
  print crypt-key

  crypt-key: rsa-encrypt/private/decrypt rsa-key crypt-key
  print crypt-key


it runs perfectly, encrypts the crypt-key and then decrypts it sucessfully.


As you probably know, the purpose of the RSA algorithm is to allow 
someone else to encrypt data that only you can decrypt using your 
private key. I tried this with a different public key using the following 
code:

  rsa-key1: rsa-make-key
  rsa-generate-key rsa-key1 1024 3

  rsa-key2: rsa-make-key
  rsa-key2/n: rsa-key1/n

  crypt-key: copy/part checksum/secure mold now/precise 16
  print crypt-key

  crypt-key: rsa-encrypt rsa-key2 crypt-key
  print crypt-key

  crypt-key: rsa-encrypt/private/decrypt rsa-key2 crypt-key
  print crypt-key


So I put the public key from rsa-key1 into another object, rsa-key2 
and tried using it to encrypt the data and get the following error.

	#{DD44AC1810E9A7020FAD72A7CFA54100}
	Segmentation fault


How do I get the public key from the first object into the second 
object so that it can be used to encrypt data?
caelum:
27-Feb-2013
Another question. On linux (linux mint debian) these segments of 
code are part of a larger program. I separated them out because they 
are causing trouble when I try to 'enface' them.


    set-net [[me-:-mydomain-:-net] mail.mydomain.net pop.mydomain.net none 
    none none "[me-:-mydomain-:-net]" "PASSWORD"]


    open [scheme: 'pop user: "[me-:-mydomain-:-net]" pass: "PASSWORD" host: 
    "mail.mydomain.net"]


The code encapsulates without errors, but when I run the program 
after 'enface' it gives the following errors:

    Set-Net not provided.

    ** Access Error: Invalid port spec: scheme pop user [me-:-mydomain-:-net] 
    pass PASSWORD host mail.mydomain.net

    ** Near: open [scheme: 'pop user: "[me-:-mydomain-:-net]" pass: "PASSWORD" 
    host: "mail.mydomain.net"]


I would like to be able to 'enface' these code snippets. Any suggestions 
as to how to fix this would be most welcome?
caelum:
27-Feb-2013
I was wrong. Simple programs like (print "Hello World") compile and 
execute, but programs with a lot of code compile but produce a series 
of errors when executed. I noticed a pattern. Wherever a word is 
not followed by ':' causes errors, examples below. Perhaps it's just 
this linux version of enface?

    stylize [
        fld80: field 80x28 font-size 17 white ivory center
        .......
    ]

produces the error:

    ** Script Error: stylize has no value
    ** Near: new-styles: stylize [
        fld80: field 80x28 font-size 17 white ivory center 
        fld400: field 400x28 font-size 17 whit...

I'll try this on windows when I have the opportunity.
GrahamC:
28-Feb-2013
If you did a grep on your source directory you'll find it ... in 
prot-setnet.r
NickA:
10-Mar-2013
What's the proper (fast) way to do this?

    REBOL [title: "Anagram List"]
    a: copy []
    mix: func [str prev] [   
        repeat i length? str [
            picked: pick str i
            rest: head remove at copy str i
            append a rejoin [prev picked rest]
            mix rest join prev picked
        ]
    ]
    mix input: ask "Text:  " ""
    editor unique a
MaxV:
11-Mar-2013
Just use math:
a: copy []

mix: func [ myword /local n t] [
	n:  length? myword
	t: 1
	loop n [ 
		t: n * t 
		n: n - 1
		]	
	while [(length? a) < t] [
		append a random myword	
		unique a
	
		]
	a	
	]
mix "test"

editor a
Steeve:
11-Mar-2013
/me pouring a glass of whisky
NickA:
11-Mar-2013
REBOL [title: "Anagram List"]


a:[]m: func[s p][repeat i length? s[append a rejoin[p k: s/:i r: 
head remove at copy s i]m r join p k]]m ask""""editor unique a probe 
length? a


a:[]m: func[s /local i][if 1 = i: length? s[append a copy head s 
exit]loop i[append s s/1 m next remove s]]m ask""editor a probe length? 
a

halt
Steeve:
11-Mar-2013
can you give a test case where mine is faling ?
Steeve:
11-Mar-2013
For a 5 letters word, the number of combinations should be 5! (factorial 
5) which gives 120.
3301 / 6460812345...3233[34] 3536...643644645646647