More REBOL IOS questions.
[1/10] from: edanaii:cox at: 12-May-2002 10:06
I manage a team of Oracle Developers. Our primary function is to deploy
changes to the many Oracle DB's that we support at our company.
As part of that effort, we keep our database scripts in a central,
highly structured, directory accessible to all. Because of this, there
is a risk that someone might obliterate another person's work.
To mitigate that problem, we use M$ SourceSafe to prevent possible
collision among team members. The problem is, this is a manual process,
prone to human error, as often occurs in a shop like ours where
everything is #1 priority and has to be done yesterday.
For that reason, I'm considering REBOL IOS as a possible tool to manage
the issue. Since it does automatic version control and archiving, this
makes it very tempting, and since REBOL IOS is extensible, the
temptation becomes even stronger.
We would basically take IOS as it is now, and build in a few more
features to help us do our work. I've played with IOS a little bit, and
like what I see. But there are still a few more things I don't that make
me curious.
Does REBOL View, for example, support a drag & drop interface? I have
seen no evidence of this, but admit that the time I've spent looking at
it is probably no more than two hours.
Can REBOL call external applications? I know it can connect to Oracle
through ODBC and I assume it can through TNS Names, but can it call
other applications (at least through OS calls) and execute them with the
appropriate parameters? Case in point: can it call SQL*Plus, pass the
User and Password and script to be run?
I know IOS can detect file changes. Can it intercept those changes
programmatically? Can we use it to create a log of files that have been
changed?
As always, thanks in advance for any and all responses.
--
Sincerely, | Tell me, tell me, where I'm going; I don't know
Ed Dana | where I've been. Tell me, tell me. Oh won't you
Software Developer | tell me, and then tell me again! My body's aching,
1Ghz Athlon Amiga | my heart is breaking and I don't know where to go!
| So tell me, tell me, why don't you tell me? I just
| gotta know! - Styx, Crystal Ball
[2/10] from: greggirwin::mindspring::com at: 13-May-2002 16:23
Hi Ed,
<< Does REBOL View, for example, support a drag & drop interface? I have
seen no evidence of this, but admit that the time I've spent looking at
it is probably no more than two hours. >>
Allen Kamp has done some really nice demos of D&D inside View apps. Getting
D&D events from Windows is another matter. I haven't tried catching
WM_DropFiles, though it may be possible. The new SYSTEM port may allow
catching WM_ messages but I haven't tried it.
<< Can REBOL call external applications? I know it can connect to Oracle
through ODBC and I assume it can through TNS Names, but can it call
other applications (at least through OS calls) and execute them with the
appropriate parameters? Case in point: can it call SQL*Plus, pass the
User and Password and script to be run? >>
View/Pro and Command can. The Link client still can't AFAIK. We have a
script on our IOS server that doesn't run under Link, because we need to do
that. No problem running that way if you don't mind doing it.
<< I know IOS can detect file changes. Can it intercept those changes
programmatically? Can we use it to create a log of files that have been
changed?
Not sure exactly what you mean, but probably yes. If you're going through
IOS, you will see items published and, if you're writing your own post-func
for your reblets, you can act on that. You could also have a daemon-type
process that polls for things if that will work for you. Callbacks might be
possible with the new system port as well, but I haven't tried it so I don't
know, under Windows, if you can use the file-change notification APIs.
--Gregg
[3/10] from: ammon:rcslv at: 12-May-2002 13:54
Hi,
Welcome to the IOS fold we will try to show you around a bit and perhaps you
will find it enjoyable enough to stay!
REBOL does support drag and drop, but you will find that the controls are
very different than those in other languages. Here is a quick and simple
example
view layout [
size 240x240
style dragbox box 40x40 font-size 11 feel [
engage: func [face action event] [
if action = 'down [
face/data: event/offset
remove find face/parent-face/pane face
append face/parent-face/pane face
]
if find [over away] action [
face/offset: face/offset + event/offset - face/data
]
show face
]
]
dragbox "Box 1" navy
dragbox "Box 2" teal
dragbox "Box 3" maroon
dragbox "Box 4" gold
]
It should be fairly simple to determine if you are dragging on top of another
item (hint: check the offset and the size) As Gregg mentioned I don't know
about the WM_DropFiles, but hey who knows what is possible.
HTH
Ammon
A short time ago, Ed Dana, sent an email stating:
[4/10] from: edanaii:cox at: 13-May-2002 18:32
Gregg Irwin wrote:
> Hi Ed,
> << Does REBOL View, for example, support a drag & drop interface? I have
<<quoted lines omitted: 4>>
> WM_DropFiles, though it may be possible. The new SYSTEM port may allow
> catching WM_ messages but I haven't tried it.
In what little testing I've done, it looks like, if I have to publish
multiple scripts, I have to do it once for each one. Our development
scripts are structured in a psuedo-object-oriented fashion. It would be
convenient then to take a directory, or a group of files and publish
them to IOS all at once.
> << Can REBOL call external applications? I know it can connect to Oracle
> through ODBC and I assume it can through TNS Names, but can it call
<<quoted lines omitted: 4>>
> script on our IOS server that doesn't run under Link, because we need to do
> that. No problem running that way if you don't mind doing it.
But Link is extensible through REBOL, correct? So if REBOL can, I assume
we can create an app in Link to do so.
> << I know IOS can detect file changes. Can it intercept those changes
> programmatically? Can we use it to create a log of files that have been
<<quoted lines omitted: 5>>
> possible with the new system port as well, but I haven't tried it so I don't
> know, under Windows, if you can use the file-change notification APIs.
I mean, within Link, using REBOL, can I intercept a change in a file and
us it to fire of an action. It is functionality that we could use to
help us manage our scripting process.
--
Sincerely, | Cold Hearted Orb, that rules the night. Removes
Ed Dana | the colours from our sight! Red is gray and
Software Developer | yellow white! But we decide which is right...
1Ghz Athlon Amiga | And which is an illusion!
| -- The Moody Blues, Late Lament.
[5/10] from: edanaii:cox at: 13-May-2002 18:41
Very nice, I tried it and it works well.
The drag & drop, I was referring to however was in regards to
interfacing with Windows, or any other OS. Since we deal with a large
amount of small files, it would be good to be able to publish multiple
files in a single pass.
Ammon Johnson wrote:
> Hi,
> Welcome to the IOS fold we will try to show you around a bit and perhaps you
<<quoted lines omitted: 27>>
> HTH
> Ammon
--
Sincerely, | Cold Hearted Orb, that rules the night. Removes
Ed Dana | the colours from our sight! Red is gray and
Software Developer | yellow white! But we decide which is right...
1Ghz Athlon Amiga | And which is an illusion!
| -- The Moody Blues, Late Lament.
[6/10] from: gerardcote:sympatico:ca at: 13-May-2002 22:29
Hello Ed,
fortunately enough I just found some article of interest for one of your
question, at least I think it could be useful in regard with what I
understand of the many points you expressed below :
1 - > In what little testing I've done, it looks like, if I have to publish
> multiple scripts, I have to do it once for each one. Our development
> scripts are structured in a psuedo-object-oriented fashion. It would be
> convenient then to take a directory, or a group of files and publish
> them to IOS all at once.
>
2 - Case in point: can it call SQL*Plus, pass the
> > User and Password and script to be run? >>
> >
> >
3 - > I know IOS can detect file changes. Can it intercept those changes
programmatically? Can we use it to create a log of files that have been
changed?
> >
> I mean, within Link, using REBOL, can I intercept a change in a file and
> us it to fire of an action. It is functionality that we could use to
> help us manage our scripting process.
>
Here is the extract taken from the http://www.rebol.com/docs/rebolintro.html
page Carl Sassenrath wrote in july of 2001.
I just began to read it this afternoon. I really think it adresses the 3
points above in some way.
Hope this helps you as much as it is helping me in my new learning quest of
REBOL,
Gerard
8<---------------
To write a line that reads an image file and uploads it to an Internet
server, you can write:
write/binary ftp://user:[pass--example--com]/pub/link.jpg
read/binary %link.jpg
Notice that you must provide the username and password as part of the URL.
Do you want to upload an entire directory of files? This script does the
job:
site: ftp://user:[pass--example--com]/pub/
foreach file read %thefiles/ [
write/binary site/:file read/binary file
]
Notice there is another refinement being used on the site word. When a
refinement is used on a URL, it combines the URL with the file name that is
provided. The colon in front of file says "get the filename". Add a print to
the loop to see the result:
print site/:file
Perhaps you want to upload only the JPEG files from that directory. Check
the file names using find as was shown in the previous section:
foreach file read %thefiles/ [
if find file ".jpg" [
write/binary site/:file read/binary file
]
]
To upload all the GIF and JPEG files you can write:
foreach file read %thefiles/ [
if any [
find file ".jpg"
find file ".gif"
] [
write/binary site/:file read/binary file
]
]
Now, let's say you want to upload only the files that have changed in the
last two days:
date: now - 2
foreach file read %thefiles/ [
if (modified? file) > date [
write/binary site/:file read/binary file
]
]
The date variable is set by getting the current date and time, then
subtracting two days from it. This is compared to the date on the file,
which is obtained with the modified? function.
You could just as easily have written the loop to transfer files that were
smaller than a certain size replacing the comparison line with:
if (size? file) < 100000 [
Or, you could avoid subdirectories with:
if not dir? file [
These functions also work with URLs. You can check the remote file size
with:
print size? ftp://user:[pass--example--com]/pub/image.jpg
and you can check the file modification date with:
print modified? ftp://user:[pass--example--com]/pub/image.jpg
This level of Internet integration allows you to easily use network
resources throughout your programs.
[7/10] from: greggirwin:mindspring at: 13-May-2002 22:08
Hi Ed,
<< In what little testing I've done, it looks like, if I have to publish
multiple scripts, I have to do it once for each one. Our development
scripts are structured in a psuedo-object-oriented fashion. It would be
convenient then to take a directory, or a group of files and publish
them to IOS all at once. >>
Two options OTTOMH. 1) the up-file utility that comes with IOS might be all
you need. 2) write a custom reblet that works exactly how you want.
I can't over-emphasize how important this (#2) kind of thinking has become
to me. The bar is so low that it's almost always worth writing little
scripts for tasks you might only do a few times. Anything beyond that is
gravy. I find that many reblets have common traits of some kind and, while I
had largely weaned myself away from cut-and-paste code reuse, I'm doing it
again with REBOL and it's working really well so far. I know that just
sounds wrong, and I haven't built a large system this way, but having a
completely self-contained script is really nice. When I find that I'm using
something more than twice, I start thinking about putting in my general
purpose library. The other big difference with REBOL is the code/data
duality. Lots of stuff I would have considered code before, is now data. For
example, rather than coding directory names that might change into your
scripts, build a data file that you just LOAD or DO, and your other scripts
can use that.
<< But Link is extensible through REBOL, correct? So if REBOL can, I assume
we can create an app in Link to do so. >>
Sorry for the confusion. Link is basically View with some extra pieces for
talking to IOS servers. The CALL function and external library access are
not enabled in the current releases of Link, and there's no easy way around
that. Cal Dixon, I think, figured out a way to do it with some extra effort,
but I'd have to look for it if you're interested. For me, I'll just keep
asking RT to enable CALL in Link and I'll use View/Pro or Command for those
pieces in the meantime.
<< I mean, within Link, using REBOL, can I intercept a change in a file and
us it to fire of an action. It is functionality that we could use to
help us manage our scripting process. >>
OK, it's the 'can I *intercept* a change in a file' part that I'm not clear
on.
Let's say a file is changed, and saved back to disk. You can monitor
timestamps, with a polling daemon of some kind with pure REBOL. If you want
Windows to use the file change notification callback, that I don't know
about. I'm not a *nix guy, so maybe there's a file-change-interception
mechanism you're referring to that I'm not familiar with.
--Gregg
[8/10] from: rebol:optushome:au at: 14-May-2002 18:51
----- Original Message -----
From: "Gregg Irwin" <[greggirwin--mindspring--com]>
To: <[rebol-list--rebol--com]>
Sent: Tuesday, May 14, 2002 2:08 PM
Subject: [REBOL] Re: More REBOL IOS questions.
> Hi Ed,
>
> << In what little testing I've done, it looks like, if I have to publish
> multiple scripts, I have to do it once for each one. Our development
> scripts are structured in a psuedo-object-oriented fashion. It would be
> convenient then to take a directory, or a group of files and publish
> them to IOS all at once. >>
You can upload mulitple files in one go. Just select mutiple files in file
requestor (CTRL+Click). IOS will upload them all. (Not sure if recursive
directory upload
is in the current version for upload from the desktop, though)
You can also write short install scripts to do large syncronising or
complicated directory structures, including limiting who gets what files.
Cheers,
Allen K
[9/10] from: edanaii:cox at: 14-May-2002 18:23
Gregg Irwin wrote:
> Hi Ed,
> Two options OTTOMH. 1) the up-file utility that comes with IOS might be all
<<quoted lines omitted: 13>>
> scripts, build a data file that you just LOAD or DO, and your other scripts
> can use that.
Option #2 is definitely not lost on me, Gregg. :) In fact, it is one of
the main reasons why I'm focusing on it as a solution.
But I need to make the sale that REBOL will be able to everything
SourceSafe does for us, only better. At first glance, however, REBOL and
SourceSafe appear to be Apples and Oranges.
SourceSafe has a "check-in" "check-out" process. REBOL has a "publish"
process. SourceSafe allows me to check in multiple files and even whole
directories all at once, as long as REBOL allows me to do this, I can
use that to support the idea that it make the version control and
archiving processes even better.
I need it to do this out of the box. But as I said, the fact that I can extend its functionality
makes the that much better because I can use that process to build our master-scripts,
tie them to our change control process, and even use them to support our Meta-data database.
> Sorry for the confusion. Link is basically View with some extra pieces for
> talking to IOS servers. The CALL function and external library access are
<<quoted lines omitted: 3>>
> asking RT to enable CALL in Link and I'll use View/Pro or Command for those
> pieces in the meantime.
That's pretty much what I expected about Link. That it disables this
functionality is not a big deal, but being able to use it, would be an
even bigger deal. :)
> OK, it's the 'can I *intercept* a change in a file' part that I'm not clear
> on.
<<quoted lines omitted: 3>>
> about. I'm not a *nix guy, so maybe there's a file-change-interception
> mechanism you're referring to that I'm not familiar with.
If it can be done through a daemon that is just as well, but it would be
nice that, when a file changes, a script fires up and executes a number
of processes.
Again, this is not required, but would be nice to have.
--
Sincerely, |
Ed Dana | Courage is fear holding on a minute longer.
Software Developer | -- General George S. Patton
1Ghz Athlon Amiga |
[10/10] from: greggirwin:mindspring at: 15-May-2002 9:46
Hi Ed,
<< SourceSafe has a "check-in" "check-out" process. REBOL has a "publish"
process. SourceSafe allows me to check in multiple files and even whole
directories all at once, as long as REBOL allows me to do this, I can
use that to support the idea that it make the version control and
archiving processes even better. >>
I know someone has a basic DIFF implementation working in REBOL but it
hasn't yet been integrated into IOS in any way, nor has a complete VCS been
built around it.
--Gregg
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted