• 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
r4wp106
r3wp1460
total:1566

results window for this page: [start: 701 end: 800]

world-name: r3wp

Group: Ann-Reply ... Reply to Announce group [web-public]
Maxim:
3-Apr-2005
rebol is an integrated solution.  NO OTHER LANGUAGE is soo  integrated 
a part for java, and IMHO just because its much more mature.   Managing 
databases, GUI, Image processing, drawing, doing cgi scripting, out 
of the box), working on direct tcp port in 1-2 lines of code, mails, 
and all of this in ONE no-install 500k  file!
ChristianE:
11-Jun-2005
One should be better of with the link to the "view script" cgi. Bye!
DideC:
13-Jun-2005
Pekr: Area with automatic scrolling. What do you mean ?  While selecting 
text by mouse ?

I yes, there is area-scroll-style demo in the library http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=area-scroll-style.r

It's fairly a demo because it works on most version. But it would 
be smaller for 1.3 (as there is patch in it for old versions).
DideC:
13-Jun-2005
do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=area-scroll-style.r
Sunanda:
18-Feb-2006
Simetrics: Great piece of work, Francois, and nicely documented too.

As you know, REBOL.org has been using it internally to offer alternatives 
for mistyped script names, eg:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=binladen

Joe <why not a forum here on altme ?> Forums have the advantage of 
immediacy, but they are hard to keep track of or to find again after 
a few months [Can anyone *easily* retreive info from the defunct 
REBOL and REBOL2 worlds?]

The REBOL.org script discussion feature is a little-used but useful 
way of holding a highly focussed discussion (about one script) that 
will be easy to find again in the future.

It's worth experimenting with both [Altme groups and REBOL.org discussioon] 
to find the natural home for specific discussions.
Group: I'm new ... Ask any question, and a helpful person will try to answer. [web-public]
Sunanda:
15-Jul-2006
Sorting.....Check this thread. It contains worked solutions for correct 
sorting in Hungarian. French should be similar:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlMWWJ
Sunanda:
17-Jul-2007
This adds leading zeroes to MM or DD -- you could use similar logic:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=to-iso-8601-date.r
btiffin:
18-Jul-2007
Patrick; I just looked back a little bit, your question about formatted 
time-stamps...Chris has donated an awesome date time formatter to 
the rebol.org repository.  Very close to strftime in function.  Check 
out


http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=form-date.r
Anton:
19-Jul-2007
Hmm.. 

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=csv.r

Mold-CSV just uses MOLD, so you should replace it with your own MOLD-CSV-STRING 
function, similar to the above enquote.
Group: MySQL ... [web-public]
Sunanda:
1-May-2007
I think that's a great idea, Doc!
***

RT own the domain for rebol.org (and pay all the hosting charges).

They have never vetoed any scripts .... the topic has never come 
up.


Publishing to REBOL.org leaves you with all your ownership rights 
(unlike some libraries that claim ownership on any contributions). 
All REBOL.org requires is the non-exclusive right to publish the 
script and its documentation:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/boiler.r?display=script-owner-faq
Sunanda:
1-May-2007
There's a top 250 most popular scripts -- available if you are logged 
on:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/script-popularity.r?top=250

The popularity rating is an imperfect attempt to factor out downloads 
by bots (and many other factors) and arrive at something meaningful.
Pekr:
3-Jul-2008
Guys, what do you think about Tim Johnson's ml remark? Could we help 
him somehow?

-----------------------------------

I've been using mysql-protocol (Mysql Scheme) and cgi for many years 
now. I 

really like it, but I think that /command would bring some advantages, 
if
it can directly access the "C" API for MySQL.


Example: Using the mysql scheme on a tcp/ip connection, I have to 
code

the escaping of special characters for insert and updates and code 
the
unescaping of special characters for retrieval. 


Using the C API from other scripting languages, the mysql_real_escape_string()
function handles the escaping _appropriate_ to the version, and
queries are similarly unescaped.
TomBon:
24-May-2010
amacleod, CGI, yes or use rebservice if you allowed to start a port 
and forward the sql request to doc's mysql sheme as localhost 

or switch to a virtual server with linode or slicehost for full control.
TomBon:
24-May-2010
amacleod, CGI, yes or use rebservice if you allowed to start a port 
and forward the sql request to doc's mysql sheme as localhost 

or switch to a virtual server with linode or slicehost for full control.
amacleod:
24-May-2010
I think I will need to convert my app over to a cgi based access 
for mysql as I may want to access them from non-rebol based clients 
(smart phones).


Does anyone know what is the standard method for say iphones to access 
data from servers? CGI? or is there other prefered method?
amacleod:
24-Aug-2010
Is the Mysal server on your local machine? or on a hosted machine? 
Sometimes the host company will not allow you to directly acess the 
server from remote locations. You would need to access it via CGI.
caelum:
24-Aug-2010
I pinged the server just fine. Here is the code:

REBOL []
#include do %mysql-protocol.r

results: read rejoin [mysql://mysqluser:[mypassword-:-mysite-:-com]:22/mydatabase 
["SELECT * FROM tablename"]


The MySQL server is on a hosted machine. In cpanel I added my IP 
address to the 'Remote MySQL' Remote Database Access Hosts list. 
I think you are right that I will need to access the database from 
the cgi because the hosting company will not allow direct access, 
even though its suppossedly allowed in cpanel.

Thanks for your help.


Are there any examples of accessing a MySQL database via CGI in Rebol? 
I just googled and found nothing.
amacleod:
24-Aug-2010
Here is a simple example but basically you just create a script that 
reads from the DB locally and prints. Your remote app reads the printout 
when it reads from the page:

#!/user/cgi-bin/REBOL -cs
REBOL [Title: "Get Roster"]

do %mysql-protocol.r

db_ip: mysql://user:[password-:-localhost]:3306/bighouse

db: open db_ip
insert db "SELECT * FROM roster"
		dat: copy db
close db

print dat
amacleod:
24-Aug-2010
Place this file in your cgi-bin and have your remote client 'read' 
the url to that file.  


Don't forget to place mysql-protocol.r somewhere on the server an 
'do' it.


you could 'encript' the output with encloak using a simple key if 
some security of the data is needed. Just decloak at the remote client 
with same key.
amacleod:
26-Aug-2010
Caelum, instead of 'read' use 'load' when your remote client accesses 
teh cgi script. That will give you your data back in rebol blocks 
intead of text.
Group: Web ... Everything web development related [web-public]
Pekr:
4-Feb-2005
just need to find out, how to handle it in rebol cgi script ....
Pekr:
4-Feb-2005
I now need to solve that redirection issue. I really don't know what 
should I put into rebol cgi script to return in above source, so 
that I could use <FRAME SRC="/cgi-bin/shop-redir.cgi">
Pekr:
4-Feb-2005
I want that url to be returned internally by rebol cgi script, so 
that displaying source of main site will not reveal target site ...
Pekr:
4-Feb-2005
now the only problem for me is, that in above code, I want to call 
cgi, so that looking at frame source target site is not easily revealed 
....
Anton:
8-Feb-2005
I would like to fix path-thru so it can handle query strings, as 
links to rebol.org scripts have. eg. http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=slim.r
Anton:
8-Feb-2005
>> path-thru http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=slim.r

== %/D/Anton/Dev/Rebol/View/public/www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r%3Fscript-name=slim.r

>> load-thru http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=slim.r
connecting to: www.rebol.org
connecting to: www.rebol.org
== [
    SLiM: make object! [
        id: 1
        slim-path: what-dir
        libs: []
        paths: []
        linked-libs:...

>> exists-thru? http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=slim.r

== %/D/Anton/Dev/Rebol/View/public/www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r%3Fscript-name=slim.r
Tim:
18-Feb-2005
Any CGI gurus here? I've just started setting for CGI on windows 
after years on Linux. I can't figure out how to get the proper registry 
entries so that I can work with apache as the server on windows XP. 
Anyone have any experience with that? Or point me to correct forum 
is this is the wrong one... thanks.
Tim:
21-Feb-2005
Sunanda: I quote you from another forum: Tim: A general purpose uploader 
would be very useful. I'll drop you some notes privately on some 
ideas for what it should/could do.....Looking forward to it! My idea 
is of a cgi upload script that for any cgi script, first checks a 
web site and compares timedate stamps, checking to make sure that 
dependencies are current and if not, makes them also available for 
upload. BTW: Some time ago on the rebol ML,

there was reference to an enhanced FTP module. Does that ring a bell? 
<grin> or was that you?
Sunanda:
22-Feb-2005
I think that was probbaly Romano and his FTP patches:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlDKCQ


I'm convinved that an FTP program alone isn't enough.  You need an 
intelligent program at at each of the pipe......Sounds like you are 
thinking the same way.
Graham:
29-Mar-2005
There was discussion way back in 1991 http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlXQTK
about Curl, and the 30Mb download required.
Allen:
27-May-2005
This may be the problem. http://www.rebol.net/cgi-bin/rambo.r?id=3532&
Tomc:
17-Jun-2005
that was not an anominizer but a cgi debugging aid
MikeJ:
24-Jun-2005
Is there any easy way to create an app using a View front-end, but 
manipulate data on a webserver backend?  Would a normal method be 
to write the View frontend, then use cgi for the backend?
Graham:
24-Jun-2005
rugby offers advantages over cgi.
MikeJ:
24-Jun-2005
Rebol kills me.  The deeper you look, the more you find.  You wonder 
why more people aren't aware of it.  After playing with Rugby a bit, 
I don't think I'll write another personal cgi app again.
Alek_K:
14-Jul-2005
Is there any sense to run rebol cgi scripts via php with readfile("http://server.com/cgi-bin/myscript.r")?
Better option for "nice" url's?
Alek_K:
14-Jul-2005
OK - got it - virtual() sends request to server - so:
virtual("cgi-bin/myscript.r");
François:
8-Sep-2005
And you can switch from FastCGI to CGI but modifying the flag mod-fastcgi 
in the file fmagic.r
François:
8-Sep-2005
You can also add custom tag by extending the engine: 'm-execute. 
This is how I added <rebol:xxx> tags, because I want to avaide my 
html page to look like plain cgi scripts...
François:
8-Sep-2005
Pekr, I agree with you with pure cgi. Coding like that is from old 
days. But I think that Magic! (and FastMagic!) is a kind of mix between 
tamplate and rebol code. You can achieve good interaction with your 
web designer: have a look at the code of Rebol Directory: All rhtml 
pages starts with rebol codes, and then come the html. In the html 
section , there is not a single piece of application logic, except 
those specific for presentation (<rebol:if...>, etc...) So the idea 
is: your web designer provides you with the html and you just add 
the pure rebol code, without polluting the html sections. The design 
might change, but not the content, therfore, you web designer can 
modifier the rhtml, and the rebol codeur has nothing to do.
DideC:
8-Sep-2005
Magic! is CGI
FastMagic! is FastCGI
François:
21-Sep-2005
Kaj, FastMagic! does not require SQL database. But it does require 
Rebol/Command and Linux. Indeed, FastCGI in CGI compatibility mode 
needs a POSIX environment. Nevertheless, you can use FastMagic! in 
normal CGI mode, by setting the flag mod-fastcgi to false (in the 
fmagic.r file). Actually, i develop under windows in CGI mode and 
deply under Linux in FastCGI mode, and it workds well. I tried to 
be as much compatible as possible with the original Magic!. Again, 
the application code for Rebol Directory is definitly the best way 
to learn how to develop with (Fast)Magic! You can download it at 
www.rebolgique.org
Volker:
7-Oct-2005
running locally? I like Cals, some peoples have post-problems with 
it. I have read about  one or two others with cgi (library?), and 
uniserve of course.
Graham:
7-Oct-2005
Looks like Cal's webserv was too complicated for my purposes as well, 
and I've ended up using a variation on the micro web server at

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=webserver.r
Volker:
8-Oct-2005
You need no cgi, only "static page"?
Graham:
8-Oct-2005
No cgi required yet .. but good to keep it as an option.
Volker:
19-Nov-2005
;copy exe somewhere, make it executable, write a cgi:
#!/where/is/rebol -cs
rebol[]
print "content-type: text/plain^/^/"
print "Hello cgi"
Volker:
19-Nov-2005
typicla problems: line-endings with windows->linux. upload as acsii. 
forgetting to make something executable, both exe and cgi must be. 
(its linux/apache)
Izkata:
4-Dec-2005
Hmm.. for <form name="def" id="def" action=planet.cgi?1213&adr method=POST 
autocomplete=off>, the server doesn't seem to like   read/custom 
http://www.territories3069.com/3.x/planet.cgi?1213&adr[POST {ddr=1212}]

It gives a 405 error (Method not allowed)
Joe:
10-Feb-2006
The approach I have is that  every session has a cookie and disk 
storage associated to the cookie. When I define a web form, the action 
method gets a continuation id as a cgi parameter, so if at that point 
you clone the browser window, you as a user have to continuation 
ids
Joe:
10-Feb-2006
When the user posts a form ,  the form cgi stores the continuation 
id and a rebol block with name-value pairs
Joe:
10-Feb-2006
So basically the continuations are ensured by using both the cookie 
and associated storage and the continuation id that is added to the 
links as a cgi get parameter
Sunanda:
13-Feb-2006
Having REBOL formatted output is / can be a good idea: REBOL.org 
will supply its RSS that way if you ask it nicely:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/rss-get-feed.r?format=rebol

But *automatically* supplying a different version to a bot than that 
you would show to a human is called cloaking and the search engines 
don't like it at all.

If they spot what you are doing, they may ban you from their indexes 
completely.
Sunanda:
13-Feb-2006
As I said, the RSS feed is explicitly intended to feed data to other 
programs for formatting, so it doesn't (perhaps can't) look nice.

All the info is available in human friendly ways elsewhere on the 
site, eg:

script library changes: http://www.rebol.org/cgi-bin/cgiwrap/rebol/script-index.r
james_nak:
5-Apr-2006
I thought I've seen a cgi script somewhere.
Oldes:
5-Apr-2006
I don't need cgi, I need it from console to make the upload
james_nak:
5-Apr-2006
Perhaps this: http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-topic-detail.r?l=h&topic={A847190510F1A1BC08D2FB1C08792C6E613BA025}
Oldes:
5-Apr-2006
I think, it would be nice to use like:

read/custom http://127.0.0.1:85/cgi-bin/probecgi.r [files [%test.r] 
post "name=test"]
Sunanda:
28-May-2006
<pre> literally means "as written" -- if there are no line breaks 
in the text, then there will be none on the page.
***

Some lines in <pre> tags can be accidently enormously long, and need 
to be wrapped by hand.

That's one reason REBOL.org offers you a user-setting for the point 
at which you want Mailing list messages to be forcibly wrapped:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/cpt-update-profile.r

(See Appearance and settings / Point at which Mailing List Archive 
messages will start to wrap.)
MikeL:
19-Sep-2006
Sorry about the CRLF ..... you don't want to be checking the timestamps 
on the server with a slow connection. Just hold the last updated 
value locally and if it changes then transfer the file.  Same for 
deleting ... else you spend all of your time checking on the server 
over a slow connection.    You could check the timestamps or hash 
the local value ... then if  the hash value of the source changes, 
transfer the updated version.     There's some code to do some of 
this in build-sie.r  http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=build-site.r
 but it's a rebol-ish task.
Sunanda:
20-Sep-2006
Louis -- a couple of pointers about uploading files to a server using 
a slow FTP connection:

(I do it myself with REBOL.org -- most of the development takes place 
on my machine and is uploaded to RO via a 56K modem, so this is based 
on real experience.)

-- If you are uploading a large live file, that file will be available 
and/or "broken" during the course of the upload. Best to upload with 
a temporary file name, and then rename when uploaded.

-- That won't work with CGI scripts under Apache/UNIX as the rename 
won't leave them with the right file permissions to execute. But 
it will work for all other files, including scripts that are DOne 
by your CGIs.

-- We have a checksums file that the uploader uses.  Before uploading 
a file, it checks the file's upload checksum. That way, we only ever 
upload new or changed files.
Janeks:
23-Oct-2006
Actualy problem is in function read-post data - script hangs on read-io.
Why it is problem for MS IIS and how to solve them? 

read-post-data: func [
    {Reads the HTTP entity body}
    /safe "Disables evaluation of content-length header."
    /local len data tmp
] [

    len: load any [ all [safe "65536"] system/options/cgi/content-length 
    "0" ]

    data: make string! len
    tmp: make string! len
    while [ 0 < read-io system/ports/input tmp len ] [
        insert tail data tmp
        clear tmp
    ]

    data
]
Pekr:
6-Nov-2006
hmm, it might not be ideal for CGI, to do 20KB script with each invocation 
...
Gabriele:
6-Nov-2006
Yes, session handling is not hard. REBOL does not have it built in 
because it was not designed to be mainly a CGI language; so you need 
to add that yourself.
Gabriele:
7-Nov-2006
temple.cgi does basically this.
Gabriele:
7-Nov-2006
temple.cgi uses cookies. there is no problem in handling multiple 
cookies on the server side, and the bug with multiple cookies on 
the client side has long been fixed.
Gabriele:
7-Nov-2006
you just need to parse system/options/cgi/other-headers iirc. see 
temple.cgi, it shouldn't have problems with that. (but if you have 
session handling you only need one cookie in the end).
Group: Announce ... Announcements only - use Ann-reply to chat [web-public]
shadwolf:
2-Feb-2005
MULTITHREAD DEMO for REBOL (you can esyly transform this to a lib-thread 
by puting scheduler and Rthread object and related data to a lib-thread.r 
file) I think this could be very interresting if it would be added 
into REBOL VM. Work have been make by François Jouen  you can download 
it hrere: http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=threaddemo.r
Coccinelle:
11-Mar-2005
I updated the sql-protocol script. It's always on the script library 
here http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=sql-protocol.r

The only change is related to the sql dialect for the FROM clause. 
Now the following syntaxes are possible:
   FROM table table ... (existing syntax)
   FROM [table alias] [table alias] (existing syntax)
   FROM table AS alias table AS alias (new syntax like SQL)
   FROM alias: table alias: table (new syntax more "rebolish")


What do you prefer, something very near to SQL or something more 
in the spirit of REBOL.

Your feedback is welcome, I prefer by mail ([marco-:-ladyreb-:-org])
Volker:
26-Mar-2005
My little spellchecker moved to rebol.org and takes its dictionary 
from there: http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=spellck.r
Volker:
11-Apr-2005
finally got an editor with find/replace/plugins working (at least 
for me ;) http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=install-edit-tools.r
ChristianE:
8-Jun-2005
Pre-alpha preview relase of a somewhat skinnable menu system to be 
found at http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=menu-system-demo.r

Full mouse and keyboard support, multi selection of menu items and 
exspecially easy VID-like menu set-up dialect and menu handling functions. 
Other important things (not to many) are missing, but I'd really 
appreciate early comments on that, since still some design decisions 
have to be made.
ChristianE:
12-Jun-2005
Graham, Brock and Sunanda pointed me to have posted a wrong URL pointing 
to old versions of the files.
So here are the working ones:


 http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=menu-system.r

 http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=menu-system-demo.r


These really should point to the most recent files in version 0.1.8 
now. Sorry, Graham and Brock (and potentially others, too) for the 
confusion I caused.
Coccinelle:
5-Feb-2006
New version of SQL-PROTOCOL is published on http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=sql-protocol.r


This new version is a first attempt of standard SQL string parsing. 
It's limited yet to SELECT clause. INSERT, UPDATE and DELETE will 
be done soon. Previously, sql-protocol was only able to process SQL 
like dialect, the road to a better compatibility with SQL is now 
a reality. I will make it compatible with MySQL as much as possible.
Vincent:
6-Apr-2006
crc-32.r script updated to work on big files:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=crc32.r

One can either uses the /direct mode (crc-32/direct %file buffer-size) 
or 

the /continue refinement to calculate a checksum part by part (new-crc: 
crc-32/continue next-data old-crc)

- rebcode version for 1.3.61 included (as fast as the 'checksum native)
Sunanda:
12-Jun-2006
Mailing List Archive tagging project has reached a major milestone:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlWJKC
Brett:
17-Jun-2006
Get a parse tree result from Parse


http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?script=load-parse-tree.r


For fans of REBOL's Parse function, it could be particularly useful 
used with Gabriele's Rewrite function.
Rebolek:
23-Jun-2006
First public beta version of Sintezar PM-101, The Digital Phase Distortion 
Synthesizer has been released. See http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=pm-101.r
(please reply to Sound group, thanks).
Gabriele:
23-Aug-2006
Client side QML Editor released: http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=qml-ed.r
Coccinelle:
10-Sep-2006
A UPnP pilot is on the library here : http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=upnp-igd.r


Run it and you will discover all your UPnP device on your lan if 
any (lan printer, internet gateway and other lan equipement). It 
will also list your port mapping on your internet gatway if any. 
To run it, if needed, open your firewall for UPnP connection.


The objective is to help anyone how wants to develope and run server 
on their PC with an automatic port mapping for incomming connection.


For example, if  AltMe embed this tool, running a world on my PC 
would be more simple as no more NAT configuration is needed to route 
incoming connnection.
Oldes:
28-Sep-2006
maybe you should change name as there is already script with such 
a name in the library http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=http-tools.r
Group: SDK ... [web-public]
Gabriele:
21-Sep-2006
Maxim, no, you need /output to capture the output; /console sends 
the output to the console, but there is no console if you use the 
cgi option, so probably this does not work correctly.
Maxim:
28-Sep-2006
so, basically you should always do:


print " " to make sure you have a rebol console window up (or print 
to stdout if using cgi option in view or SDK) otherwise, call hangs 
indefinitely, occupying 100% of your cpu!
Maxim:
8-Nov-2006
for all SDK experts..   why is this not actually dumping the print 
to the CMD.EXE command shell?

this is encapped using enpro.exe:

rebol [
	Encap: [cgi]
]

print "-----"
Maxim:
8-Nov-2006
I meant to say, isn't using the CGI option supposed to display the 
prints on the cmd.exe command line directly?
Maxim:
8-Nov-2006
Quoting Gabriele: "Maxim, the Detective uses the cgi option, and 
prints to the dos command prompt if you call it from there (try running 
"nren help"). It does not use call though, but async-call, but i 
don't remember problems with call + cgi options."
Gregg:
8-Nov-2006
I thought the API approach would at least work, but I don't know 
if doing it inside a process that has already opened the console 
in a non-shared mode would cause the issues I saw or not. And I would 
think that CGI mode would work too.
Group: !RebGUI ... A lightweight alternative to VID [web-public]
Graham:
4-Jun-2005
not related to this leak is it .. http://www.rebol.net/cgi-bin/rambo.r?id=3593&
 which is apparently fixed in the latest releases ( according to 
Gab )
Graham:
4-Jun-2005
though I still see it as per  this http://www.rebol.net/cgi-bin/rambo.r?id=3557&
Group: rebcode ... Rebcode discussion [web-public]
Oldes:
3-Dec-2005
Added to Rambo (with bug in the example:( http://www.rebol.net/cgi-bin/rambo.r?id=-505&
Maxim:
20-Feb-2007
I'm not an expert only that I know by having many 3d cgi scripts 
that many apis have a mix and match of rad and degres... but it seems 
you looked at that too...
Coccinelle:
20-Feb-2007
I put the script here : http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=psg-ay-3-8910-study.r
Coccinelle:
20-Feb-2007
There is another script of the PSG AY-3-8910 from Guest2, it's here 
http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=demo-ay.r

His script was my inspiration and is much more nice than mine. But 
I wanted to understand by myself.
Group: !REBOL3-OLD1 ... [web-public]
Sunanda:
12-Apr-2006
gabriele: luckily, Brett had a copy:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlLNJK
Otherwise the trail could have ended here:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlXSDC
PeterWood:
12-Apr-2006
It was easy to find Gabriele's eval script through the topic index 
at Rebol.org. It's at http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlXWHS
Gregg:
14-Apr-2006
The current library interface is servicable, but could be improved.

For example, char arrays in C structs are a real pain to deal with,

there is redundancy if you're importing a number of routines, from 

the same library, and extra work is required to deal with pointers
to values.

The biggest issue for me seems to be that I have to use COMPOSE 

heavily to get the results I want, or there's a lot of duplication
in struct and routine defs.

--- Easier Routine Declarations

The only thing I've addressed in my lib interface dialect is
making it easier to declare routines. I posted it to REBOl.org
for discussion:


http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=lib-dialect.r

--- Pointers


This is maybe a bit of an extreme example, but I had to do it, so 
it's not purely theoretical.

    LPINT-def: [value [integer!]] none

    LPINT: make struct! LPINT-def none

This struct shows where a nested struct is needed.

    _FAX_JOB_PARAM-def: compose/deep/only [

        SizeOfStruct    [integer!]      ; DWORD structure size, in bytes

        RecipientNumber [string!]       ; LPCTSTR   pointer to recipient's 
        fax number

        RecipientName   [string!]       ; LPCTSTR   pointer to recipient's 
        name

        Tsid            [string!]       ; LPCTSTR   pointer to transmitting 
        station identifier

        SenderName      [string!]       ; LPCTSTR   pointer to sender's name

        ;SenderName      [struct! [value [string!]]]       ; LPCTSTR   pointer 
        to sender's name

        SenderCompany   [string!]       ; LPCTSTR   pointer to sender's company

        SenderDept      [string!]       ; LPCTSTR   pointer to sender's department

        BillingCode     [string!]       ; LPCTSTR   pointer to billing code

        ScheduleAction  [integer!]      ; DWORD job scheduling action code

        ;ScheduleTime    [struct! (SYSTEMTIME-def)]        ; SYSTEMTIME  
          time to send fax
            wYear       [short]
            wMonth      [short]
            wDayOfWeek  [short]
            wDay        [short]
            wHour       [short]
            wMinute     [short]
            wSecond     [short]
            wMilliseconds [short]

        DeliveryReportType  [integer!]      ; DWORD e-mail delivery report 
        type

        DeliveryReportAddress [string!]     ; LPCTSTR   pointer to e-mail 
        address

        DocumentName        [string!]       ; LPCTSTR   pointer to document 
        name to display
        CallHandle          [integer!]      ; HCALL reserved
        ;_PTR   Reserved[3]  [integer!]      ; DWORD must be zero
        _PTR-0  [integer!]      ; DWORD must be zero
        _PTR-1  [integer!]      ; DWORD must be zero
        _PTR-2  [integer!]      ; DWORD must be zero
        _PTR-3  [integer!]      ; DWORD must be zero
    ]
    _FAX_JOB_PARAM: make struct! _FAX_JOB_PARAM-def none
    _FAX_JOB_PARAM/SizeOfStruct: length? third _FAX_JOB_PARAM

    fax-complete-job-params: make routine! compose/deep/only [

        JobParams     [struct! (LPINT-def)] ; ptr to job information struct

        CoverPageInfo [struct! (LPINT-def)] ; ptr to cover page struct
        return:       [integer!]
    ] winfax.dll "FaxCompleteJobParamsA"

So, the API call returns pointers to structs containing the 
data we want; to get it we need to dereference the pointers
after the call.

    complete-job-params: func [
        /local
            params-ptr cover-ptr    ; API return pointers

            params cover            ; REBOL structs with data from API
    ][
        ; allocate return pointer structs for API call
        params-ptr: make-LPINT
        cover-ptr: make-LPINT

        ; make the API call

        reduce either 0 <> fax-complete-job-params params-ptr cover-ptr [

            ; get data from pointers returned by the API

            params: get-dereferenced-data params-ptr _FAX_JOB_PARAM-def

            cover:  get-dereferenced-data cover-ptr  _FAX_COVERPAGE_INFO-def
        ...



Getting the de-ref'd data is the real pain, and seems like it might
be unsafe in the way I did it, though it worked.

    get-dereferenced-data: func [

        {Given a pointer to memory, copy the target data into a REBOL struct.}

        pointer [struct!]   "LPINT structure whose /value is the data pointer"

        struct-def [block!] "The struct you want returned with data"
        /local struct data orig-pointer result
    ] [

        struct: make struct! compose/deep/only [ ; make wrapper struct
            sub [struct! (struct-def)]
        ] none

        orig-pointer: third struct              ; store original inner pointer

        change third struct third pointer       ; change inner pointer to 
        ref'd data

        data: copy third struct/sub             ; copy data from the inner 
        struct

        change third struct orig-pointer        ; restore inner pointer

        result: make struct! struct-def none    ; make result struct

        change third result data                ; change data in result struct
        struct: data: orig-pointer: none
        result
    ]


--- char arrays in structs, or as routine parameters

You can't just declare a fixed size block or string to do this, 
you have to (AFAIK), have individual elements for each item.
That's a huge pain if you have a 128 element array, so I end
up generating them dynamically. I think that was Cyphre's idea
originally, but I don't have notes on it.

    make-elements: func [name count type /local result][
        if not word? type [type: type?/word type]
        result: copy "^/"
        repeat i count [
            append result join name [i " [" type "]" newline]
        ]
        to block! result
    ]

    GUID: make struct! GUID-def: compose [
        Data1   [integer!]  ; unsigned long
        Data2   [short]     ; unsigned short
        Data3   [short]     ; unsigned short
        (make-elements 'Data4 8 #"@")  ; unsigned char
    ] none


--- MAKE-ing structs

How do other people make structs from prototypes? 

    make-struct: func [prototype /copy /with data] [
        make struct! prototype either copy
            [second prototype]
            [either with [reduce [data]][none]]
    ]


--- BSTR type

I've only needed it for one project, but it might be worth 
finding out if it would be worth adding BSTR support for
Windows, as a routine datatype.
Sunanda:
20-Apr-2006
Redefining system words:  It's an annoying problem. Geomol, and none 
of us is immune.

(I once debugged a CGI written by Carl. He'd used the info? mezzanine, 
but accidentally redefined the query word that it depends on. The 
results were wierd).
Namespaces should help.

I try to *not* clash with any words by always encapsulating code 
into objects -- so it's not 'query as global word, it's 'utilities/query
Meanwhile; the best we have is protect system.
Volker:
20-Apr-2006
cgi-servers can handle this to some extend, but cgi is cgi and not 
chat-speed.
Sunanda:
20-Apr-2006
Volker. That's true (and I've said it myself too: http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlMGVC
)
But we need to protect "my" library against your loader too.
That's a separate problem.
Sunanda:
20-Apr-2006
Script to implement a sandbox:

http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlDGDS
No idea if it works ot how easy it is to cirumvent.
But maybe it could be used to prototype modules.
701 / 15661234567[8] 910111213141516