Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Help!

 [1/23] from: sharriff::aina::med-iq::de at: 23-Oct-2000 10:26


Here is a simplified snippet of a sort of user validation that Im coding: challenge: make object! [ log-name: "sharriff" password: "gong" ] temp-logname: to-word challenge/log-name temp-password: challenge/password validname: select temp-db temp-logname validpass: find temp-db temp-password either found? validname [either found? validpass [print "go"][print nogo ]] [ print "wrong password"] The problem is, the outer "Either" never evalutes if "validname" is true, can someone tell me what Ive overlooked? Regards Sharriff Aina med.iq information & quality in healthcare AG

 [2/23] from: al:bri:xtra at: 23-Oct-2000 23:01


Sharriff wrote:
> Here is a simplified snippet of a sort of user validation that Im
coding:
> challenge: make object! [ log-name: "sharriff" password: "gong" ] > temp-logname: to-word challenge/log-name
<<quoted lines omitted: 4>>
> "nogo"]] [ print "wrong password"] > The problem is, the outer "Either" never evalutes if "validname" is true,
can someone tell me what Ive overlooked? I'd be reluctant to do this:
> temp-logname: to-word challenge/log-name
what if challenge/log-name _isn't_ valid Rebol word? Like: Andrew.1 Also, for this line: validpass: find temp-db temp-password I think you might mean: validpass: find temp-db VALIDNAME but I'm uncertain of your intent. Have you thought about using an Associative array? Then, for putting passwords in, you could write: Associate Passwords-Block "sharriff" "gong" Associate Passwords-Block "Andrew.1" "%#2" Then you could retrieve the passwords by writing: Associate? Passwords-Block "Andrew.1" == "%#2" Associate? Passwords-Block ask "What's your User name:" ask "What's your Password:" and you could check for bad passwords, like this: Associate? Passwords-Block "J. Random Hacker" == none I thought this approach would be a lot cleaner. The code for Associate and Associate? is below my .sig. I hope that helps! Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/ -><- [ Associate!: make object! [ Find: function [Block [block!] Key] [Index] [ Index: Block until [ Index: system/words/find/only Index Key if not found? Index [return none] either odd? offset? Block Index [ Index: next Index false ][ true ] ] Index ] set 'Associate? function [Block [block!] Key] [Index] [ either found? Index: Find Block Key [ first second Index ][ none ] ] set 'Associate function [Block [block!] Key Value] [Index] [ Index: Find Block Key either none? Value [ if found? Index [ remove/part Index 2 ] ][ Value: reduce [Value] either found? Index [ change/only next Index Value ][ append Block reduce [Key Value] ] ] Block ] ] ]

 [3/23] from: sharriff:aina:med-iq at: 23-Oct-2000 11:25


Thanks Andrew! I meant "validpass" to take of the case that a user types in the right name (validname) but not the right password (validpass). These 2 values read from a HTML form over CGI are the to be validated against a text file loaded as a block I simplified it so I could quickly test things on the REBOL command console. The HTML form should actually write a new HTML with content after proper validation.
>Andrew.1 >Also, for this line: > ** validpass: find temp-db temp-password > I think you might mean: > ** validpass: find temp-db VALIDNAME >but I'm uncertain of your intent.
Sharriff Aina med.iq information & quality in healthcare AG Gutenbergstr. 42

 [4/23] from: sharriff:aina:med-iq at: 23-Oct-2000 11:38


>I thought this approach would be a lot cleaner. The code for Associate and >Associate? is below my .sig. I hope that helps!
I plan to store other vales like Department, email e.t.c. thats the reason why I opted to store and read these values from a text file. How do I pass a block fo information pertaining to one user (email name, login-name e.t.c.) to "Associate" ? I noticed it takes a block, but Ill like to store everything centrally fro other uses other that validation is there a way to index the arrays with log-names of the users? so I could still use the " Associate?" function? best regards Sharriff Aina med.iq information & quality in healthcare AG Gutenbergstr. 42

 [5/23] from: al:bri:xtra at: 24-Oct-2000 9:08


Sharriff wrote:
> I plan to store other vales like Department, email e.t.c. that's the reason why I opted to store and read these values from a text file. How do I pass a block of information pertaining to one user (email name, login-name e.t.c.) to "Associate"?
Like this: Associate Users-Block "Andrew Martin" [ "My Neat Pass ## Word" [Al--Bri--xtra--co--nz] "Other thing" http://members.nbci.com/AndrewMartin/ ; My home page. ; etc ]
> I noticed it takes a block, but Ill like to store everything centrally from other uses other that validation Is there a way to index the arrays with log-names of the users? So I could still use the "Associate?" function?
Just associate a block of your data with each log-name. I hope that helps! Andrew Martin Playing hooky...

 [6/23] from: rebol:techscribe at: 26-Oct-2000 19:25


Hi Sharriff, I managed to kidnap a few minutes to review the latest 200 messages on the list and found your question. If I understand you correctly then the expression
>> valid-name: select temp-db temp-logname
does not succeed in retrieving the value associated with temp-logname in the temp-db block, even when you know that the value of temp-logname is for sure contained in the block. temp-db It is not really possible to answer your question without seeing the contents of temp-db. What does the block temp-db look like? Elan [Sharriff--Aina--med-iq--de] wrote:

 [7/23] from: sharriff:aina:med-iq at: 27-Oct-2000 8:35


Hi Elan! iis extremly nice of you to try to help out! Ive actually solved the problem with this code: (See attached file: prototype-logger.r) and the "temp-db" looks like this: (See attached file: medintouch-users-db.shdb)( just a text file with a renamed extension) I know its not high-level Rebol programming, but it works, maybe I could use a tip or two from you. Andrew als sent me his "Associate array function" also as a solution to this problem. Much thanks Sharriff Aina med.iq information & quality in healthcare AG Elan <[rebol--techsc] An: [rebol-list--rebol--com] ribe.com> Kopie: Gesendet von: Thema: [REBOL] Re: Help! [elan--loop--com] 27.10.00 03:25 Bitte antworten an rebol-list Hi Sharriff, I managed to kidnap a few minutes to review the latest 200 messages on the list and found your question. If I understand you correctly then the expression
>> valid-name: select temp-db temp-logname
does not succeed in retrieving the value associated with temp-logname in the temp-db block, even when you know that the value of temp-logname is for sure contained in the block. temp-db It is not really possible to answer your question without seeing the contents of temp-db. What does the block temp-db look like? Elan [Sharriff--Aina--med-iq--de] wrote:
> Here is a simplified snippet of a sort of user validation that Im
coding:
> challenge: make object! [ log-name: "sharriff" password: "gong" ] > temp-logname: to-word challenge/log-name
<<quoted lines omitted: 4>>
> "nogo"]] [ print "wrong password"] > The problem is, the outer "Either" never evalutes if "validname" is
true,
> can someone tell me what Ive overlooked? > Regards
<<quoted lines omitted: 4>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- To unsubscribe from this list, please send an email to [rebol-request--rebol--com] with "unsubscribe" in the subject, without the quotes. -- Binary/unsupported file stripped by Listar -- -- Type: application/octet-stream -- File: =?iso-8859-1?Q?prototype-logger.r? -- Binary/unsupported file stripped by Listar -- -- Type: application/octet-stream -- File: =?iso-8859-1?Q?medintouch-users-db.shdb?=

 [8/23] from: sharriff:aina:med-iq at: 27-Oct-2000 7:52


oops, no attachments allowed, here are the files in text Elan! temp-db [ sharriff [ logname "sharriff" name "Sharriff Aina" password "gong" email [sharriff--aina--med-iq--de] dept "Administration" view "yes" edit "yes" modify "yes" publish "yes" ] test [ logname "test" name "Test Testman" password "unfold" email [test--testman--med-iq--de] dept "Entwicklung" view "yes" edit "no" modify "no" publish "no" ] admin [ logname "admin" name "Administrator" password "medintouch" email [admin--med-iq--de] dept "Development" view "yes" edit "yes" modify "yes" publish "yes" ] ] My code: #!c:\rebol\rebol.exe -cs REBOL[] Print "Content-Type: text/html ^/^/" temp-db: load %medintouch-users-db.shdb challenge: make object! decode-cgi system/options/cgi/query-string temp-logname: to-word challenge/login-name temp-password: challenge/password sub-db: select temp-db temp-logname either found? sub-db [ either temp-password = sub-db/password [print {right password!}][ print {wrong password!}]] [ print {wrong login name!} ] simplified, beacuse it sends a lot of XHTML to the client... Best regards Sharriff Aina med.iq information & quality in healthcare AG

 [9/23] from: sharriff:aina:med-iq at: 27-Oct-2000 8:04


Can anyone tell me why the values in my HTML checkboxes in forms are not passed to REBOL per CGI? Im using a GET method. Sharriff Aina med.iq information & quality in healthcare AG

 [10/23] from: rebol:techscribe at: 27-Oct-2000 1:44


Hi Sharriff, Two requests: 1. Are the following lines (including the surrounding block brackets) literally the contents of the file %medintouch-users-db.shdb? Or are they what temp-db evaluates to after the file has been LOADed?
> [ > sharriff [
<<quoted lines omitted: 31>>
> ] > ]
2. Can you send me (feel free to do it offlist directly to me) the result of evaluating the following cgi file:
> #!c:\rebol\rebol.exe -cs > > REBOL[] > > Print [ > "Content-Type: text/html ^/^/" > > mold make object! decode-cgi system/options/cgi/query-string > ]
quit ;- End Of Script TIA, Elan

 [11/23] from: rebol:techscribe at: 27-Oct-2000 1:45


[Sharriff--Aina--med-iq--de] wrote:
> Can anyone tell me why the values in my HTML checkboxes in forms are not > passed to REBOL per CGI? Im using a GET method.
<<quoted lines omitted: 4>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
Hi Sharriff, they are. Send me the Webpage ;-). (Off list directly to me). Take Care, Elan

 [12/23] from: sharriff:aina:med-iq at: 30-Oct-2000 13:05


Hi Elan! Did you receive the files I sent in regard of the Checkboxes? Cheers Sharriff Aina med.iq information & quality in healthcare AG

 [13/23] from: warp:reboot:ch at: 24-Nov-2000 17:45


Hello 8) Could someone point me to some docs which explain why:
>> make file! 44
== %
>> to-file 44
== %44
>>
Thank you Will Arp [warp--reboot--ch]

 [14/23] from: timewarp:sirius at: 24-Nov-2000 9:48


That looks like a bug, Will. Think this would be your explanation. Cheerfulness, -----EAT Will Arp wrote:

 [15/23] from: lmecir:mbox:vol:cz at: 24-Nov-2000 19:29


In Rebol dictionary you can find: Make: ---------------------------------------------------------------------------- ---- The TYPE argument indicates the datatype to create. The form of the constructor is determined by the datatype. For most series datatypes, a number indicates the size of the initial allocation. As long, as files are series, it means, that the number is used by Make to allocate enough space for the expected filename. Regards Ladislav

 [16/23] from: warp:reboot:ch at: 24-Nov-2000 20:06


Thank you 8) It is now assimilated Will Arp [warp--reboot--ch]

 [17/23] from: timewarp:sirius at: 24-Nov-2000 12:20


I still think it's a bug. Cheerfulness, -----EAT Will Arp wrote:

 [18/23] from: marekw:tpg:au at: 26-Nov-2000 2:11


I cannot explain that, but looking at it, I found another strange thing.
> f: make file "test" > %test > > f/1 > %test/1 > > f/666 > %test/666 ; spooky (don't believe it!!)
What that means?

 [19/23] from: whip:cs:unm at: 26-Nov-2000 13:54


What Ladislav says is correct, and this is _NOT_ a bug. This is a pretty fundamental aspect of how REBOL datatypes work. MAKE creates a new datatype and TO converts a datatye. MAKE file! 44 creates a new file! with room for 44 characters, which is very much like: MAKE string! 44 whereas... TO-FILE 44 converts the integer 44 into a file!, which is very much like: TO-STRING 44 The standard way that datatypes are converted to series is that they are FORMed. -jeff

 [20/23] from: timewarp:sirius at: 26-Nov-2000 13:00


Seems like it should work differently where files are concerned. I mean, when would it be neccessary to allocate space for a file name when REBOL already does it internally? When would a file name ever be "that" long? Anyway, those are my thoughts. Cheerfulness, ----EAT nop wrote:

 [21/23] from: jeff:rebol at: 26-Nov-2000 12:42


The concept involved is "orthogonality". -jeff
> Seems like it should work differently where files are > concerned. I mean, when would it be neccessary to allocate
<<quoted lines omitted: 8>>
> > bug. This is a pretty fundamental aspect of how REBOL > > datatypes work.
. . .

 [22/23] from: timewarp:sirius at: 26-Nov-2000 16:59


Orthogonality: A measure of how accurately a system's axes maintain a 90 degrees relationship among them Help me out here... Cheerfulness, ----EAT [jeff--rebol--net] wrote:

 [23/23] from: jeff:rebol at: 26-Nov-2000 17:08


In computing terms: 'Mutually independent; well separated; sometimes, irrelevant to. Used in a generalisation of its mathematical meaning to describe sets of primitives or capabilities that, like a vector basis in geometry, span the entire "capability space" of the system and are in some sense non-overlapping or mutually independent.' From: http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?orthogonal MAKING a series and supplying a number to indicate its storage allocation is orthogonal to converting a number TO a series. Orthogonally, Jeff

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted