Re: tree

2001-03-22 Thread H. Chaudet


--- MESSAGE metacard.v004.n246.10 ---

From: digifilm [EMAIL PROTECTED]
Subject: tree
Date: Wed, 21 Mar 2001 18:07:45 -0800
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
References: [EMAIL PROTECTED]
In-Reply-To: [EMAIL PROTECTED]

Howdy,

Is there a good example of a nice way to build a tree structure in
hyper/super/metacard.

Thanks

Debdoot


--- END metacard.v004.n246 ---

B-tree with associative arrays. You just need to encode the first son and
the first sibling with the address of the cells in the associative array.
You can either use 2 arrays : one for the tree nodes and one for the links
(two items by cell), or only one array, with line 1 for the links. Don't
forget the counter for the cell names.

H. Chaudet


-
Herve Chaudet  e-mail : [EMAIL PROTECTED]
  mobile : 33-(0)-608-05-98-09
 Unit UPRES EA 2672
  Faculte de Medecine - 27, Bd Jean Moulin - 13385 Marseille cedex 5 - France
  Tel 33-(0)-491-79-19-10 ; Fax 33-(0)-491-79-40-13
 Service de l'Information Medicale
  Hopital Nord - Chemin des Bourrelly - 13326 Marseille cedex 15 - France
  Tel 33-(0)-491-96-80-20
-

w



Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: A little unrelated

2001-03-22 Thread michael kann


--- digifilm [EMAIL PROTECTED] wrote:

Does anyone know of a cgi that does this:

1. user clicks on weblink to download a file
2. weblink sends a string to cgi on server
3. cgi checks webserver's ip and if authenticated
looks
up the file related to the string and starts the
download


-
Can I rephrase your post a bit?

1. User clicks on a link in their browser to download
a file (let's call the browser the client)
2. The client sends in a password along with its IP
address to the server. On the server side a CGI script
uses the password and IP address to send back the
appropriate file.

I'm assuming that by "file" you mean an HTML file that
the browser will display. If you mean another type of
file that will be downloaded to the harddrive, then
that would use a different mechanism.
---
The punch line:

If you know what platform and server you'll be using
then we can look up a way to get it done. 




__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




socket to http

2001-03-22 Thread LiangTyan Fui

This might be re-inventing the wheel of exiting "put url" and "load url"
commands but here goes:

I was trying to query web site with the "put url" command, but this command
lock the process when the internet link was less than perfect (I am on
dialup most of the time).

So I changed the query method to "load url x with message y" -- helps a
little, but still hog from time to time when the connection was real poor.
The "load url" pause for few seconds (occasionally to a minute)

So I took the trouble to write my own method by using socket, and opened up
a Pandora box.

A typical http session returns something as follow:

HTTP/1.1 200 OK
Server: MetaCard/2.3 ID/11222
MIME-Version: 1.0
Content-type: text/html
Content-Length: 102

And follow by the content of the file.
However, not many http server returns the "Content-Length" header in many
cases (special CGI generated result). So I have problem to determine how
many bytes to read with:
read from socket x for y chars

Anyone out there has better idea of how can I deal with it?

###
Anyone would like a copy of the code may email me privately.


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: socket to http

2001-03-22 Thread andu


This might be re-inventing the wheel of exiting "put url" and "load url"
commands but here goes:

I was trying to query web site with the "put url" command, but this command
lock the process when the internet link was less than perfect (I am on
dialup most of the time).

So I changed the query method to "load url x with message y" -- helps a
little, but still hog from time to time when the connection was real poor.
The "load url" pause for few seconds (occasionally to a minute)

So I took the trouble to write my own method by using socket, and opened up
a Pandora box.

A typical http session returns something as follow:

HTTP/1.1 200 OK
Server: MetaCard/2.3 ID/11222
MIME-Version: 1.0
Content-type: text/html
Content-Length: 102

And follow by the content of the file.
However, not many http server returns the "Content-Length" header in many
cases (special CGI generated result). So I have problem to determine how
many bytes to read with:
read from socket x for y chars

Anyone out there has better idea of how can I deal with it?

One wonders why bother writing standards... 
 Anyway, I also noticed that replies without content length close the connection right 
away
(no keep-alive) so I use the "socketClosed()" message to stop reading and spit out the
data. 
You'll also notice that errors behave the same with some servers.



Regards, Andu 
___
[EMAIL PROTECTED]

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Sockets info

2001-03-22 Thread PEChumbley

I've been seeing a lot of references to sockets on the list.  This is one topic (among 
many) that I am completely ignorant of.  Can someone point me to a book or site where 
I could read up on then and how to use them?

Philip

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: socket to http

2001-03-22 Thread LiangTyan Fui

On 3/23/01 12:53 AM, Dave Cragg wrote:

snipped

 Hi
 
 In the cases where no "Content-Length" is returned, is the data
 returned in "chunked" style. I've never worked on such data, but I
 think you can check for a "transfer-coding = chunked" line in the
 header. If so, the length of each "chunk" is contained within the
 chunk itself, I think. (Check the HTTP 1.1 RFC for details).

Will pay attention to this ... but haven't come across with
"Transfer-coding" by far.

 In my own endeavors, I haven't come across any servers that don't
 return a "Content-Length" field, but I'm working with a limited
 number of servers.

WebSTAR for instant, and some of my own CGI result ;-)

 Cheers
 Dave Cragg

Regards,
LiangTyan Fui


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: socket to http

2001-03-22 Thread LiangTyan Fui

On 3/22/01 11:46 PM, andu wrote:

snipped

 One wonders why bother writing standards...

If "load url" doesn't pause... I've this on the Mac and NT4. Haven't tested
it on Linux.

 Anyway, I also noticed that replies without content length close the
 connection right away
 (no keep-alive) so I use the "socketClosed()" message to stop reading and spit
 out the data. 

I don't find this message in MetaCard help... so all we need is to trap the
socketClose to wrap up the session?

 You'll also notice that errors behave the same with some servers.

You are referring to socketError?

Regards,
LiangTyan Fui

 Regards, Andu 
 ___
 [EMAIL PROTECTED]
 
 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.
 
 


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Sockets info

2001-03-22 Thread andu


I've been seeing a lot of references to sockets on the list.  This is one topic (among
many) that I am completely ignorant of.  Can someone point me to a book or site where I
could read up on then and how to use them?

Unfortunately "sockets" hardly describes what it actually is and does in this context.
Generally speaking opening, reading/writing and closing sockets are the basic
operations which allow for transmitting/receiving data between 2 computers (local
network or internet). 
You open a socket to an address (say, http://www.metacard.com on port 80) and you
write a request for a file (say, index.html). The computer at the other end "listens" 
for
requests on port 80 and when "index.html" comes in it writes the file (index.html) to 
the
socket you opened. Next, you read from the socket the other computer's reply and
optionally close the socket. Then you do whatever you want with the data received.


Philip


Regards, Andu 
___
[EMAIL PROTECTED]

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: socket to http

2001-03-22 Thread andu


On 3/22/01 11:46 PM, andu wrote:

snipped

 One wonders why bother writing standards...

If "load url" doesn't pause... I've this on the Mac and NT4. Haven't tested
it on Linux.

 Anyway, I also noticed that replies without content length close the
 connection right away
 (no keep-alive) so I use the "socketClosed()" message to stop reading and spit
 out the data. 

I don't find this message in MetaCard help... 

The more interesting ones are kept secret;-)

so all we need is to trap the
socketClose to wrap up the session?

Yes, something like:
on socketClosed x
#if x is the one in case do stuff with the data you have received
end socketClosed


 You'll also notice that errors behave the same with some servers.

You are referring to socketError?

No I was referring to server error messages like 404 or 401. Most servers send back
some error message in html and close the socket.


Regards,
LiangTyan Fui

 Regards, Andu 
 ___
 [EMAIL PROTECTED]
 
 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
 Info: http://www.xworlds.com/metacard/mailinglist.htm
 Please send bug reports to [EMAIL PROTECTED], not this list.
 
 


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.

.


Regards, Andu 
___
[EMAIL PROTECTED]

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Sockets info

2001-03-22 Thread LiangTyan Fui

On 3/23/01 2:18 AM, [EMAIL PROTECTED] wrote:

 I've been seeing a lot of references to sockets on the list.  This is one
 topic (among many) that I am completely ignorant of.  Can someone point me to
 a book or site where I could read up on then and how to use them?

Socket discussions appear more frequently nowadays, but the actual persons
involved on the discussions are rather few (and andu is the most active
person on this topic of all ;-)
Writing socket might be too complicated for xTalk developer - but it is
getting more and more important for sure.
I wish there is a dedicated site for socket discussions and code exchange
but I've doubted how many of us will benefit for it.
The best way to start is to perform an autopsy on andu's httpd stack, but
again even I have written a similar stack, I was having problem to
understand the stack by first glance.

Good luck!

 Philip

Regards,
LiangTyan Fui


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.




Re: Sockets info

2001-03-22 Thread andu


On 3/23/01 2:18 AM, [EMAIL PROTECTED] wrote:

 I've been seeing a lot of references to sockets on the list.  This is one
 topic (among many) that I am completely ignorant of.  Can someone point me to
 a book or site where I could read up on then and how to use them?

Socket discussions appear more frequently nowadays, but the actual persons
involved on the discussions are rather few (and andu is the most active
person on this topic of all ;-)
Writing socket might be too complicated for xTalk developer - but it is
getting more and more important for sure.

It shouldn't be complicated specially with the few examples that exist.
The more time consuming and frustrating task is getting a grip on different protocols 
and
dealing with the way some developers "chose" to implement them.
I think the reluctance people have in dealing with sockets comes rather from the 
opacity of
MacOS and Windows to such matters where all you have to do is fill out some fields in a
control panel and go. This is perfectly fine for most people but developers and 
authors ought to
make the effort to know a little more.


I wish there is a dedicated site for socket discussions and code exchange
but I've doubted how many of us will benefit for it.

Simon Lord started something... and I do think it could've helped a lot: some sample 
scripts,
the more important RFCs at hand, experiments with new protocols, etc..

The best way to start is to perform an autopsy on andu's httpd stack, but
again even I have written a similar stack, I was having problem to
understand the stack by first glance.

Unfortunately I took the good habit of commenting my scripts only recently so I am to 
be
blamed for not making things easier for others.


Good luck!

 Philip

Regards,
LiangTyan Fui


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.

.


Regards, Andu 
___
[EMAIL PROTECTED]

Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.