Re: Packages

2007-12-10 Thread Kay C Lan
On Dec 9, 2007 9:59 PM, Chipp Walters <[EMAIL PROTECTED]> wrote:

Here's one example: I've got a product that resizes graphics, but I
> don't want them to 'go into' a package and find and resize the
> graphics there. How to know if you're in a 'package' or 'bundle'?
>
>
Sorry, been out of the loop for a couple of days, but here's my suggested
starting point;

put this in a do statement:

tell application "AppleScript"
  files of folder "Disc:folderA:folder1"
end tell

reports only Apple recognised files in the provided location

tell application "AppleScript"
  folders of folder "Disc:folderB:folder2"
end tell

reports only Apple recognised folders in the provided locations

tell application "AppleScript"
  packages of folder "Disc:folderC:folder3"
end tell

reports only Apple recognised packages in that location.

For added convenience, but slightly confusing depending on which side of the
fence you're on, the packages are reported as either 'application files'
which are of course folders that are applications, and 'document files'
which are of course folders that look like files (.band,.rtfd,.key)

One simple test I did, was that packages are the only folders that seem to
have a '.suffix', I've never thought anyone else would actually name a
folder with a .suffix, so I did, and the above correctly identified "test
folder.test" as a simple folder.

Sorry I haven't got around to producing the desired function, I'm a little
busy with my day job right know, but given time  I think I'd be able to come
up with something.

As someone else has said, for me I've only ever needed to delve into
packages that I've created so I know where I am and where I want things to
go. I've never really had a need to delve inside someone else's package, but
for those that do, I hope the above gets you on your way.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Packages

2007-12-10 Thread Kay C Lan
On Dec 10, 2007 4:25 PM, Kay C Lan <[EMAIL PROTECTED]> wrote:

>
> tell application "AppleScript"
>

it would help if I read what I wrote:-

they should all say:

tell application "Finder"
   etc


sorry for the confusion, just far too busy right now :-((
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Extracting a column

2007-12-10 Thread Éric Miclo

Hello,

Does somebody know if there is a "quick" way to extract a column from  
a tab limited list (in a field or a variable)?
By "quick" I mean I'm not obliged to cycle through all the lines of my  
var because it can be quite long.


I've tried to use array but the transpose function doesn't work if the  
number of columns is not the same as the number of lines.

Or can I do something else with an array to achieve that goal?

Thanks, best,

ÉrIC

-- My NeXT computer will Be a Mac too! --


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting a column

2007-12-10 Thread Klaus Major

Bonjour Éric,


Hello,

Does somebody know if there is a "quick" way to extract a column  
from a tab limited list (in a field or a variable)?
By "quick" I mean I'm not obliged to cycle through all the lines of  
my var because it can be quite long.


I've tried to use array but the transpose function doesn't work if  
the number of columns is not the same as the number of lines.

Or can I do something else with an array to achieve that goal?


use the new "split" command!
...
put "your data here" into myvar
put 2 into my_column
## The number of column you want to extract
split myvar by column
## turns your data into an array!
put myvar[my_column] into my_column_data
...

Done :-)


Thanks, best,

ÉrIC


Regards

Klaus Major
[EMAIL PROTECTED]
http://www.major-k.de


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting a column

2007-12-10 Thread Ian Wood


On 10 Dec 2007, at 07:21, Éric Miclo wrote:

Does somebody know if there is a "quick" way to extract a column  
from a tab limited list (in a field or a variable)?
By "quick" I mean I'm not obliged to cycle through all the lines of  
my var because it can be quite long.


I think you're stuck with looping through and getting 'item 2 of line  
x'.


Out of interest, how big are your variables? On a 2GHz MBP Rev loops  
through around five lines per millisecond in the test I just did.


Ian___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting a column

2007-12-10 Thread Ian Wood


On 10 Dec 2007, at 10:30, Klaus Major wrote:


use the new "split" command!


Hmm. Just a *tiny* bit faster...

Ian
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Packages

2007-12-10 Thread Mark Smith
This is great! I couldn't find this anywhere. So here's a function  
that uses it - maybe someone has better code for converting the path   
to applescript.


function thePackages pFolder
set the itemdelimiter to "/"
if item 2 of pFolder is "Volumes" then
delete item 1 to 2 of pFolder
else
put line 1 of the volumes before pFolder
end if
replace "/" with ":" in pFolder

put "tell application" && quote & "Finder" & quote & cr &  
"packages of folder" && quote \

& pFolder & quote & cr & "end tell" into tScr
do tScr as applescript
put the result into tList
replace comma with cr in tList

repeat for each line L in tList
get wordoffset("file", L)
put word it + 1 of L & cr after tPackages
end repeat
replace quote with empty in tPackages
return char 1 to -2 of tPackages
end thePackages
On 10 Dec 2007, at 08:25, Kay C Lan wrote:


On Dec 9, 2007 9:59 PM, Chipp Walters <[EMAIL PROTECTED]> wrote:

Here's one example: I've got a product that resizes graphics, but I

don't want them to 'go into' a package and find and resize the
graphics there. How to know if you're in a 'package' or 'bundle'?


Sorry, been out of the loop for a couple of days, but here's my  
suggested

starting point;

put this in a do statement:

tell application "AppleScript"
  files of folder "Disc:folderA:folder1"
end tell

reports only Apple recognised files in the provided location

tell application "AppleScript"
  folders of folder "Disc:folderB:folder2"
end tell

reports only Apple recognised folders in the provided locations

tell application "AppleScript"
  packages of folder "Disc:folderC:folder3"
end tell

reports only Apple recognised packages in that location.

For added convenience, but slightly confusing depending on which  
side of the
fence you're on, the packages are reported as either 'application  
files'
which are of course folders that are applications, and 'document  
files'

which are of course folders that look like files (.band,.rtfd,.key)

One simple test I did, was that packages are the only folders that  
seem to

have a '.suffix', I've never thought anyone else would actually name a
folder with a .suffix, so I did, and the above correctly identified  
"test

folder.test" as a simple folder.

Sorry I haven't got around to producing the desired function, I'm a  
little
busy with my day job right know, but given time  I think I'd be  
able to come

up with something.

As someone else has said, for me I've only ever needed to delve into
packages that I've created so I know where I am and where I want  
things to
go. I've never really had a need to delve inside someone else's  
package, but

for those that do, I hope the above gets you on your way.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Packages

2007-12-10 Thread Kay C Lan
On Dec 10, 2007 7:31 PM, Mark Smith <[EMAIL PROTECTED]> wrote:

> This is great! I couldn't find this anywhere. So here's a function
> that uses it


Man, that was quick.


> maybe someone has better code for converting the path
> to applescript.
>

That I can do

>
> function thePackages pFolder



>

-- Automatically converts Rev paths to applescript paths
 put revMacFromUnixPath(pFolder) into pFolder


put "tell application" && quote & "Finder" & quote & cr &
> "packages of folder" && quote \
> & pFolder & quote & cr & "end tell" into tScr
> do tScr as applescript
> put the result into tList
> replace comma with cr in tList
>
> repeat for each line L in tList
> get wordoffset("file", L)
> put word it + 1 of L & cr after tPackages
> end repeat
> replace quote with empty in tPackages
> return char 1 to -2 of tPackages
> end thePackages
>

Thanks
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Packages

2007-12-10 Thread Mark Smith

Thanks for that. It didn't occur to me to even look for it...

Best,

Mark

On 10 Dec 2007, at 13:44, Kay C Lan wrote:


put revMacFromUnixPath(pFolder) into pFolder


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


using mySQL to communicate between PHP and Rev CGI Deamon

2007-12-10 Thread David Beck


Has anybody tried to use a database backend such as mySQL as an 
intermediary between a frontend like php and a Rev application running 
as a backend deamon? The idea would be to have a php script insert 
"requests" into a mySQL database, and then have the Rev deamon 
constantly querying that database and processing any requests, placing 
the output for any request processed back in the database. The php 
script would wait for the results from the Rev deamon to "appear" in the 
database, and then would display those results to the user.


Does this sound like a viable model? Has anybody had experience trying 
this out?


Thanks!

David


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: using mySQL to communicate between PHP and Rev CGI Deamon

2007-12-10 Thread Alex Shaw

Hi David

I would recommend checking out:
http://www2.sahores-conseil.com/insead/index_en.html

And of course:
http://www.andregarzia.com/RevOnRockets/index.html

I've had great success running rev daemons on in-house and on public 
webhosts from using a combination of the above methods.


regards
alex


David Beck wrote:


Has anybody tried to use a database backend such as mySQL as an 
intermediary between a frontend like php and a Rev application running 
as a backend deamon? The idea would be to have a php script insert 
"requests" into a mySQL database, and then have the Rev deamon 
constantly querying that database and processing any requests, placing 
the output for any request processed back in the database. The php 
script would wait for the results from the Rev deamon to "appear" in the 
database, and then would display those results to the user.


Does this sound like a viable model? Has anybody had experience trying 
this out?



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Menubar on Windows???

2007-12-10 Thread Dave

Hi All,

I'm trying to get the Menubar to work on Windows, it works fine on  
Mac OS X.


In the preOpenStack hander I execute:

  set the menubar of this stack to myMenuBarGroupLongName

Which Displays the Menu Bar on Mac and I expected it to display the  
Menubar in the stack that is being executed in windows, but instead  
nothing seems to happen, e.g. the Window is the same as before the  
"set the menubar" code was executed.


So how do I get the menubar displayed under Windows???

Thanks a lot

All the Best
Dave



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Accents etc

2007-12-10 Thread Devin Asay


On Dec 9, 2007, at 9:15 AM, Ton Cardona wrote:


Thanks, Devin, it is certainly a bug but will it ever be fixed?


I hope so. RunRev's comment on the bug report indicates that it  
should be a simple fix. I'll post a comment to the bug report asking  
if there is a proposed fix target.


devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Menubar on Windows???

2007-12-10 Thread Ian Wood
If you look at the docs for 'menubar' you'll see that it is a Mac- 
specific property. This is because the menubar is the bar appearing at  
the top of the screen (not the top of each window), which doesn't  
exist on Windows or Linux.


If the stack's menubar property isn't set to the group it should be  
visible at the top of the window, normal for Windows.


Ian

On 10 Dec 2007, at 15:37, Dave wrote:


Hi All,

I'm trying to get the Menubar to work on Windows, it works fine on  
Mac OS X.


In the preOpenStack hander I execute:

 set the menubar of this stack to myMenuBarGroupLongName

Which Displays the Menu Bar on Mac and I expected it to display the  
Menubar in the stack that is being executed in windows, but instead  
nothing seems to happen, e.g. the Window is the same as before the  
"set the menubar" code was executed.


So how do I get the menubar displayed under Windows???

Thanks a lot

All the Best
Dave



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting a column

2007-12-10 Thread Richard Gaskin

Klaus Major wrote:

Does somebody know if there is a "quick" way to extract a column  
from a tab limited list (in a field or a variable)?
By "quick" I mean I'm not obliged to cycle through all the lines of  
my var because it can be quite long.


I've tried to use array but the transpose function doesn't work if  
the number of columns is not the same as the number of lines.

Or can I do something else with an array to achieve that goal?


use the new "split" command!
...
put "your data here" into myvar
put 2 into my_column
## The number of column you want to extract
split myvar by column
## turns your data into an array!
put myvar[my_column] into my_column_data
...


Well done, Klaus.  I'd forgotten that the "split" command has been 
extended with the "column" token, and since I have a data management 
library that I use in a number of apps I decided to test this against 
the "repeat for each line" method I'm currently using.


It seems that even with the convenience of the new form of "split", the 
"repeat for each line" method is still faster - here are the results of 
this morning's test:


  Split: 1101 ms (490.46 lines/ms)
  Repeat: 499 ms (1082.16 lines/ms)
  Same results?: true

(MacBook Pro 2.16GHz, OS X 10.4.11)

While the relative benchmarks favor "repeat for each", in absolute terms 
being able to extract a column from half a million lines per second 
isn't bad. :)



Here's the code - please let me know if I've missed something here which 
may be skewing the results:


on mouseUp
  set cursor to watch
  --
  -- Number of times to run the test:
  put 1000 into n
  --
  -- "src" contains a tab-delimited list of 540 lines:
  put fld  "src" into tData
  --
  -- TEST 1: split
  put the millisecs into t
  repeat n
put GetCol1(tData, 2) into tmp1
  end repeat
  put the millisecs - t into t1
  --
  -- TEST 2: repeat for each:
  put the millisecs into t
  repeat n
put GetCol2(tData, 2) into tmp2
  end repeat
  put the millisecs - t into t2
  --
  -- Display results:
  put tmp1 into fld "r1"
  put tmp2 into fld "r2"
  --
  -- Display times and verify that the
  -- results are the same:
  put N * the number of lines of tData into x
  set the numberformat to "0.##"
  put "Split: "&t1 &" ms ("& x/t1 &" lines/ms)"& \
  cr& "Repeat: "&t2 &" ms ("& x/t2 &" lines/ms)"&\
  cr&"Same results?: "&(tmp1 = tmp2)
end mouseUp

--
--  TEST 1: split
--
function GetCol1 pData, pCol
  split pData by column
  return pData[pCol]
end GetCol1

--
-- TEST 2: repeat for each
--
function GetCol2 pData, pCol
  put empty into tVal
  set the itemdel to tab
  repeat for each line tLine in pData
put item pCol of tLine &cr after tVal
  end repeat
  delete last char of tVal
  return tVal
end GetCol2



My test stack with a 540-line source field is at:

   go url "http://fourthworldlabs.com/getcol_test.rev";


--
 Richard Gaskin
 Managing Editor, revJournal
 ___
 Rev tips, tutorials and more: http://www.revJournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting a column

2007-12-10 Thread Jim Ault
On 12/10/07 8:24 AM, "Richard Gaskin" <[EMAIL PROTECTED]> wrote:
> While the relative benchmarks favor "repeat for each", in absolute terms
> being able to extract a column from half a million lines per second
> isn't bad. :)
> 
> Here's the code - please let me know if I've missed something here which
> may be skewing the results:

The type of file you are parsing could be one of the determining factors.
Try generating a specific file structure

put empty in tData
put 4 into tCol  
--  run trials with tCol = 44, 444
put "A" into item tCol of tTemp
--  run trials with a sentence as item 1

repeat 10
put tTemp & cr after tData
end repeat

--number of cols, and the length of the content before the column for
extracting could be the biggest factor.  Col 2 extract could be a lot faster
than col 9.  In most cases, knowing which column(s) you wish to extract will
mean you adjust your file format to put these closest to the first item.  If
you inherit the data or don't have a choice... c'est la guerre.

Jim  Ault
Las Vegas


On 12/10/07 8:24 AM, "Richard Gaskin" <[EMAIL PROTECTED]> wrote:

> Klaus Major wrote:
> 
>>> Does somebody know if there is a "quick" way to extract a column
>>> from a tab limited list (in a field or a variable)?
>>> By "quick" I mean I'm not obliged to cycle through all the lines of
>>> my var because it can be quite long.
>>> 
>>> I've tried to use array but the transpose function doesn't work if
>>> the number of columns is not the same as the number of lines.
>>> Or can I do something else with an array to achieve that goal?
>> 
>> use the new "split" command!
>> ...
>> put "your data here" into myvar
>> put 2 into my_column
>> ## The number of column you want to extract
>> split myvar by column
>> ## turns your data into an array!
>> put myvar[my_column] into my_column_data
>> ...
> 
> Well done, Klaus.  I'd forgotten that the "split" command has been
> extended with the "column" token, and since I have a data management
> library that I use in a number of apps I decided to test this against
> the "repeat for each line" method I'm currently using.
> 
> It seems that even with the convenience of the new form of "split", the
> "repeat for each line" method is still faster - here are the results of
> this morning's test:
> 
>Split: 1101 ms (490.46 lines/ms)
>Repeat: 499 ms (1082.16 lines/ms)
>Same results?: true
> 
> (MacBook Pro 2.16GHz, OS X 10.4.11)
> 
> While the relative benchmarks favor "repeat for each", in absolute terms
> being able to extract a column from half a million lines per second
> isn't bad. :)
> 
> 
> Here's the code - please let me know if I've missed something here which
> may be skewing the results:
> 
> on mouseUp
>set cursor to watch
>--
>-- Number of times to run the test:
>put 1000 into n
>--
>-- "src" contains a tab-delimited list of 540 lines:
>put fld  "src" into tData
>--
>-- TEST 1: split
>put the millisecs into t
>repeat n
>  put GetCol1(tData, 2) into tmp1
>end repeat
>put the millisecs - t into t1
>--
>-- TEST 2: repeat for each:
>put the millisecs into t
>repeat n
>  put GetCol2(tData, 2) into tmp2
>end repeat
>put the millisecs - t into t2
>--
>-- Display results:
>put tmp1 into fld "r1"
>put tmp2 into fld "r2"
>--
>-- Display times and verify that the
>-- results are the same:
>put N * the number of lines of tData into x
>set the numberformat to "0.##"
>put "Split: "&t1 &" ms ("& x/t1 &" lines/ms)"& \
>cr& "Repeat: "&t2 &" ms ("& x/t2 &" lines/ms)"&\
>cr&"Same results?: "&(tmp1 = tmp2)
> end mouseUp
> 
> --
> --  TEST 1: split
> --
> function GetCol1 pData, pCol
>split pData by column
>return pData[pCol]
> end GetCol1
> 
> --
> -- TEST 2: repeat for each
> --
> function GetCol2 pData, pCol
>put empty into tVal
>set the itemdel to tab
>repeat for each line tLine in pData
>  put item pCol of tLine &cr after tVal
>end repeat
>delete last char of tVal
>return tVal
> end GetCol2
> 
> 
> 
> My test stack with a 540-line source field is at:
> 
> go url "http://fourthworldlabs.com/getcol_test.rev";
> 


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Field of Card of Stack

2007-12-10 Thread Francis Nugent Dixon

Hi from Paris,

I include the following field/button/script mechanism
in ALL my stacks as I create them. I can display a list
of fields in any card of the stack, at any time. It helps
me to ensure that I don't have two fields with the same
name (so easy to do with the "duplicate" function), and
also that I strictly adhere to my own field naming system.
It doesn't solve all problems, but helps for clean living.
Create a large field called "MySystemFieldList" in card 1
Create a button (label Showfields) on ALL cards, with this
script :

on mouseUp
  --
  -- ShowField/HideField - V01 - 2006/03/31 - 16:00 - Creation
  --
  -- This script displays the field names declared on
  -- this card in a field "MySystemFieldList". This field
  -- is filled and shown when the button is clicked, and
  -- is hidden when the button is clicked again.
  --
  -- This script functions from any card in the stack, but
  -- always displays the data in a field in Card 1.
  --
if the label of me = "ShowFields" then
  put empty into field MySystemFieldList
  set the lockscreen to true
  put the number of fields in this card into LVFieldCount
  if LVFieldCount = 0 then
put "   No Fields declared" into line 2 of field  
MySystemFieldList

show field MySystemFieldList
set the lockscreen to false
exit mouseUp
  end if
set numberFormat to 00
  put 0 into LVLineCount
  repeat LVFieldCount   -- I know there are quicker ways to do  
this !!! So What !!

add 1 to LVLineCount
put LVLineCount & " - " & the name of field LVLineCount into  
line LVLineCount of LVSystemFieldList

  end repeat
  go to card 1
  set the label of me to "HideFields"
  put LVSystemFieldList into field MySystemFieldList
  show field MySystemFieldList
  exit mouseUp
end if
if the label of me = "HideFields" then
  set the label of button FieldList to "ShowFields"
  hide field MySystemFieldList
end if
end mouseUp

I also use a similar mechanism for variables, buttons and
groups, but this is another story. Of course, the buttons
which run these mechanisms are always present in my stacks,
but are shown (by an invisible button) during development or
stack update, but are hidden when delivered to the users.

-Francis




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting a column

2007-12-10 Thread Richard Gaskin

Jim Ault wrote:

--number of cols, and the length of the content before the column for
extracting could be the biggest factor.  Col 2 extract could be a lot faster
than col 9.  In most cases, knowing which column(s) you wish to extract will
mean you adjust your file format to put these closest to the first item.  If
you inherit the data or don't have a choice... c'est la guerre.


Excellent thoughts.

I modified the test to generate data rather than using the canned data 
supplied, adding this near the top of the test handler:


  put "4" into t
  -- Make cols:
  put empty into tRow
  repeat with i = 1 to 500
put s & t into s
put s & tab after tRow
  end repeat
  -- make rows:
  put empty into tData
  repeat with i = 1 to 500
put tRow &cr after tData
  end repeat
  delete last char of tData
  -- Verify sizes:
  set the itemdel to tab
  answer "Cols: "&the number of items of line 1 of tData &\
  cr&"Rows: "& the number of lines of tData &\
  cr&"Size: "&len(tData)

This gave me a data set of 500 cols with 500 rows, with each column 
containing one more character than the last, the longest being 501 
chars, with a total size of 63,125,499 chars.  I left the functions 
themselves unchanged.


Having it get column 490 gave me these results:

  Split: 32110 ms (0.16 lines/ms)
  Repeat: 3946 ms (1.27 lines/ms)
  Same results?: true

Getting column 2 gave me:

  Split: 39192 ms (0.13 lines/ms)
  Repeat: 2495 ms (2 lines/ms)
  Same results?: true


So then I tried a very horizontal data set of just 20 rows but with 2000 
columns in each, for a total size of 40,100,019 chars.


Grabbing column 1999 from this data set gave me:

  Split:  7849 ms (0.03 lines/ms)
  Repeat: 2328 ms (0.09 lines/ms)
  Same results?: true


So I think what we're seeing is that the overhead of parsing applies to 
both methods.


On the one hand, the "split" command ramps more gracefully the more 
horizontal the data gets when accessing items at the end of each row, 
but on the other hand its performance remains roughly the same no matter 
which item is obtained while "repeat for each" shows improvement with 
items closer to the left.  And in all cases tested, "repeat for each" 
continues to best "split" in overall performance.


I imagine we could come up with a data set for which "split" outperforms 
"repeat for each", but my data sets are well under 20 MBs each (more 
commonly < 5 MBs), almost never exceeding 150 columns and each column in 
a given row would very rarely contain more than 1k, so these tests cover 
most real-world scenarios for my needs.


Just the same, if someone comes up with a real-world scenario in which 
"split" outperforms "repeat for each" I'd be very interested in learning 
what that data looks like and how it's used.


--
 Richard Gaskin
 Managing Editor, revJournal
 ___
 Rev tips, tutorials and more: http://www.revJournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Starting a cgi process

2007-12-10 Thread Richard Miller
I assume there's a simple way to do the following, but I can't find  
it in the documentation.


I understand how to use a form to pass data to, and start, a Rev cgi  
process, for example:


http://myserver/cgi-bin/DoRevRoutine.cgi"; method="get">
 form data goes in here, which is received in the Rev script  
through $QUERY_STRING




How do I pass data to, and start, a Rev cgi process using just a  
hyperlink?


I'm guessing I can use this type of html syntax:
http://myserver/cgi-bin/DoRevRoutine.cgi
with something coming after ".cgi" which can pass data to the Rev cgi  
script.


What's the syntax for creating the hyperlink and then receiving and  
parsing the data in the script?


Thanks.
Richard Miller
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Starting a cgi process

2007-12-10 Thread Mark Smith

You need a '?'

http://myserver/cgi/myrevscript.mt?name1=tom,name2=dick

name1=tom,name2=dick will be in $QUERY_STRING

Best,

Mark


On 10 Dec 2007, at 19:45, Richard Miller wrote:

I assume there's a simple way to do the following, but I can't find  
it in the documentation.


I understand how to use a form to pass data to, and start, a Rev  
cgi process, for example:


http://myserver/cgi-bin/DoRevRoutine.cgi"; method="get">
 form data goes in here, which is received in the Rev script  
through $QUERY_STRING




How do I pass data to, and start, a Rev cgi process using just a  
hyperlink?


I'm guessing I can use this type of html syntax:
http://myserver/cgi-bin/DoRevRoutine.cgi
with something coming after ".cgi" which can pass data to the Rev  
cgi script.


What's the syntax for creating the hyperlink and then receiving and  
parsing the data in the script?


Thanks.
Richard Miller
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Starting a cgi process

2007-12-10 Thread Richard Miller

Never mind. Figured it out.
QUERY_STRING picked up and returned everything after a "?" (which  
followed my usual URL to the cgi script).


Richard

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Starting a cgi process

2007-12-10 Thread Jan Schenkel
--- Richard Miller <[EMAIL PROTECTED]> wrote:
> I assume there's a simple way to do the following,
> but I can't find  
> it in the documentation.
> 
> I understand how to use a form to pass data to, and
> start, a Rev cgi  
> process, for example:
> 
>  action="http://myserver/cgi-bin/DoRevRoutine.cgi";
> method="get">
>  form data goes in here, which is received in
> the Rev script  
> through $QUERY_STRING
> 
> 
> 
> How do I pass data to, and start, a Rev cgi process
> using just a  
> hyperlink?
> 
> I'm guessing I can use this type of html syntax:
> http://myserver/cgi-bin/DoRevRoutine.cgi
> with something coming after ".cgi" which can pass
> data to the Rev cgi  
> script.
> 
> What's the syntax for creating the hyperlink and
> then receiving and  
> parsing the data in the script?
> 
> Thanks.
> Richard Miller
> 

Hi Richard,

For CGI scripts that are called using the HTTP GET
method, you'll take the URL and append a question mark
and a URL-encoded version of the parameters, where the
parameters are in key-value pairs with an equal sign
between the key and the value, and multiple parameters
separated by ampersands.

Example:

Your CGI script will then get the $QUERY_STRING:
"param1=value1¶m2=value2"

If your CGI script uses the POST method, you can use
the libUrlFormData function - see the Revolution
dictionary for detailed information.

Hope this helped,

Jan Schenkel.

Quartam Reports & PDF Library for Revolution


=
"As we grow older, we grow both wiser and more foolish at the same time."  (La 
Rochefoucauld)


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


(no subject)

2007-12-10 Thread Randall Lee Reetz

Struggling with AppleScript.

All I want to do is run a script that opens a finder folder from a  
path (i.e. Macintosh HD:Users:MeUser:Desktop:myFolder:).


Well, this morning it works (after a reboot).  Last night it  
wouldn't.  Same exact script... from Script Editor and from SuperCard  
(oops).


Also, and I have no idea if this is related, copy and paste is not  
working (on my 1GHz PowerBook PowerPC G4 10.4.11).  Also, before my  
reboot this morning, my computer wouldn't open folders from the Doc  
Bar.  What could these problems be caused by?  Any ideas?


Randall
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Getting vScroll movement of a field scrollbar

2007-12-10 Thread James Hurley

I have a field with button superimposed on the text.

I would like the buttons to scroll with the field.

I set the field script to:

local tStart

on mouseDown
   put the vScroll of me into tStart
end mouseDown


on scrollbarDrag newValue
  put tStart & comma &  newValue into msg box
end scrollbarDrag

The idea was to get the vertical movement of the scrollbar and move  
the buttons accordingly.


But the field's scrollbar does not appear to get the  mouseDown  
message and so I don't get the  tStart variable


How do I get the initial position  of the scrollbar?

Jim Hurley
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: (no subject)

2007-12-10 Thread Kay C Lan
On Dec 11, 2007 6:32 AM, Randall Lee Reetz <[EMAIL PROTECTED]> wrote:

> Struggling with AppleScript.
>

Aren't we all;-) (once you've got use to xTalk)

First we'll start with the last problem

Also, before my
> reboot this morning, my computer wouldn't open folders from the Doc
> Bar.  What could these problems be caused by?  Any ideas?
>

First, try using Disk Utility to 'Repair Permissions'. If that doesn't help,
drag the current Icon of the folder off the Dock and then Drag the required
folder back onto the Dock.

>
> Also, and I have no idea if this is related, copy and paste is not
> working (on my 1GHz PowerBook PowerPC G4 10.4.11).


Depends on what your referring to. If you are talking about keyboard
shortcuts in Rev IDE, or using AppleScript (and I believe the Windows
equivalent or other programs like perl) to copy data to the clipboard and
then use Rev to manipulate it, unfortunately there is a long history of this
being a 'intermittent' hard to reproduce problem. Although for keyboard
shortcuts the usual response is use the menu items, as these reliably work

>
> All I want to do is run a script that opens a finder folder from a
> path (i.e . Macintosh HD:Users:MeUser:Desktop:myFolder:).
>
> Well, this morning it works (after a reboot).  Last night it
> wouldn't.  Same exact script... from Script Editor and from SuperCard
> (oops).
>

Your AppleScript should look something like this:
--3 lines, watch line wraps

tell application "Finder"
   open folder "Macintosh HD:Users:MeUser:Desktop:myFolder"
end tell

Your Rev script should look like this:
--a do statement is single line so you'll need to unwrap this
--the tricky bit is quotes and spaces in the right place

do "tell application " & quote & "Finder" & quote & cr & "open folder " &
quote & "Macintosh HD:Users:MeUser:Desktop:myFolder" & quote & cr & "end
tell" as applescript

If the idea is that you want your program to open the actual folder so a
user knows where they are, the above approach is OK, if on the other hand
you simply want to open the folder to determine what the contents are, or to
be able to save files into it, there are quicker and easier ways in Rev to
do that.

HTH
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting vScroll movement of a field scrollbar

2007-12-10 Thread Kay C Lan
On Dec 11, 2007 7:05 AM, James Hurley <[EMAIL PROTECTED]> wrote:

>
> I would like the buttons to scroll with the field.
>

try using mouseEnter

on mouseEnter
   put the vScroll of me into tStart
end mouseEnter

HTH
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Extracting a column

2007-12-10 Thread Éric Miclo

Hello,

Thanks a lot!

I tried it with version ß 2.9 and wasn't able to make it work.
I've just given a try under 2.8.1 and it works perfectly.

Once again, thank you very much, best,

ÉrIC

Le 10 déc. 07 à 11:30, Klaus Major a écrit :


Bonjour Éric,


Hello,

Does somebody know if there is a "quick" way to extract a column  
from a tab limited list (in a field or a variable)?
By "quick" I mean I'm not obliged to cycle through all the lines of  
my var because it can be quite long.


I've tried to use array but the transpose function doesn't work if  
the number of columns is not the same as the number of lines.

Or can I do something else with an array to achieve that goal?


use the new "split" command!
...
put "your data here" into myvar
put 2 into my_column
## The number of column you want to extract
split myvar by column
## turns your data into an array!
put myvar[my_column] into my_column_data
...

Done :-)


Thanks, best,

ÉrIC


Regards

Klaus Major
[EMAIL PROTECTED]
http://www.major-k.de


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



-- My NeXT computer will Be a Mac too! --


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: (no subject)

2007-12-10 Thread Randall Lee Reetz
Thnks, what i was up against last night seems like it might be a "permissions" 
problem as i recently had to rebuild my computer's data from a backup.  Thanks 
for the help.

-Original Message-
From: "Kay C Lan" <[EMAIL PROTECTED]>
To: "How to use Revolution" 
Sent: 12/10/2007 5:26 PM
Subject: Re: (no subject)

On Dec 11, 2007 6:32 AM, Randall Lee Reetz <[EMAIL PROTECTED]> wrote:

> Struggling with AppleScript.
>

Aren't we all;-) (once you've got use to xTalk)

First we'll start with the last problem

Also, before my
> reboot this morning, my computer wouldn't open folders from the Doc
> Bar.  What could these problems be caused by?  Any ideas?
>

First, try using Disk Utility to 'Repair Permissions'. If that doesn't help,
drag the current Icon of the folder off the Dock and then Drag the required
folder back onto the Dock.

>
> Also, and I have no idea if this is related, copy and paste is not
> working (on my 1GHz PowerBook PowerPC G4 10.4.11).


Depends on what your referring to. If you are talking about keyboard
shortcuts in Rev IDE, or using AppleScript (and I believe the Windows
equivalent or other programs like perl) to copy data to the clipboard and
then use Rev to manipulate it, unfortunately there is a long history of this
being a 'intermittent' hard to reproduce problem. Although for keyboard
shortcuts the usual response is use the menu items, as these reliably work

>
> All I want to do is run a script that opens a finder folder from a
> path (i.e . Macintosh HD:Users:MeUser:Desktop:myFolder:).
>
> Well, this morning it works (after a reboot).  Last night it
> wouldn't.  Same exact script... from Script Editor and from SuperCard
> (oops).
>

Your AppleScript should look something like this:
--3 lines, watch line wraps

tell application "Finder"
   open folder "Macintosh HD:Users:MeUser:Desktop:myFolder"
end tell

Your Rev script should look like this:
--a do statement is single line so you'll need to unwrap this
--the tricky bit is quotes and spaces in the right place

do "tell application " & quote & "Finder" & quote & cr & "open folder " &
quote & "Macintosh HD:Users:MeUser:Desktop:myFolder" & quote & cr & "end
tell" as applescript

If the idea is that you want your program to open the actual folder so a
user knows where they are, the above approach is OK, if on the other hand
you simply want to open the folder to determine what the contents are, or to
be able to save files into it, there are quicker and easier ways in Rev to
do that.

HTH
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting vScroll movement of a field scrollbar

2007-12-10 Thread James Hurley


On Dec 11, 2007 7:05 AM, James Hurley sbcglobal.net> wrote:


>
> I would like the buttons to scroll with the field.
>

try using mouseEnter

on mouseEnter
   put the vScroll of me into tStart
end mouseEnter

HTH


Kay,

 Good thought, but it doesn't work unless the mouse leaves and  
reenters the field.


Jim
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


OT: Nobel Peace Prize Video

2007-12-10 Thread Sivakatirswami

If you have time, don't miss it

http://nobelprize.org/cgi-bin/asxgen.asx?id=795&type=award&year=2007

OSLO, NORWAY, December, 2007: When receiving the Nobel Peace Prize on 
behalf of his institution, the chief of the Intergovernmental Panel on 
Climate Change, Dr. Rajendra Pachauri, said, "Coming as I do from India, 
a land which gave birth to civilization in ancient times and where much 
of the earlier tradition and wisdom guides actions even in modern times, 
the philosophy of 'Vasudhaiva Kutumbakam,' which means the whole 
universe is one family, must dominate global efforts to protect the 
global commons."


See a video of Pachauri's entire speech, here 
<%20http://nobelprize.org/cgi-bin/asxgen.asx?id=795&type=award&year=2007>, 
which is an alarming litany of consequences of global warming.



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting vScroll movement of a field scrollbar

2007-12-10 Thread Scott Rossi
Recently, James Hurley wrote:

>> I would like the buttons to scroll with the field.

I was wondering, do you even need to capture the scroll *before*
scrollbarDrag?  Can't you just capture the scroll at the beginning of your
scrollbarDrag handler?

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution