lineOffset / wholeMatches

2001-10-26 Thread NR Kweto

Hello,

Perhaps I misunderstand lineOffset and its behaviour when wholeMatches is 
set to true... The aim of the word-search algorithm I'm trying to script is 
to match words in one list to those in another. Actually, it's the line 
number that I'm after, and I want only whole matches (i.e., make should 
match only to make, not to homeMAKEr). And so, I've tried setting 
wholeMatches to true, but 0 keeps being returned even tho I know a match 
exists.

 START OF LENGTHY EXAMPLE %

For example, these two fields:

FIELD 1 (word families) 
1tabappletabapplescr
2tabbedtabbedstabbeddingcr
3tabhometabhomestabhomemakercr
4tabmaketabmakestabmakingtabmade

---FIELD 2 (the user's word-list) --
applecr
bedcr
makecr
sing

# Here are the script variations I've tried,
# and what is returned when I try a match to
# to the word make. Note that all the
# variations start with these two lines:

put field 1 into tField1 -- the word-family list
put word 3 of field 2 into tWord -- make

VARIATION (1) ---
put lineOffset(tWord, tField1)
#  This returns 3 since
#  homeMAKEr is on that
#  line, BUT 4 is what
#  I'm after. Fair enough, tho.

VARIATION (2) --
set the wholeMatches to true
put lineOffset(tWord, tField1)
#  This returns 0 BUT I
#  thought/expected 4!!

VARIATION (3)
set the wholeMatches to true
put wordOffset(tWord, tField1)
#  This returns 14, which
#  is a correct identifying
#  number -- only, I want
#  a line number, not a
#  word number.

 END OF LENGTHY EXAMPLE %


So, like I say, what am I misunderstanding...

Thank you.

Nicolas R Cueto

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




Re: lineOffset / wholeMatches

2001-10-26 Thread Klaus

Hi Nicolas,

here are my 4 pfennige :-)
(in january that amount will equal to about 2 cents. The EURO is coming !!!)
100 pfennige make one deutsch-mark)

(Where the hell is that coming from: my 2 cents ?
Do do not get very far with 2 cents today, anyway...)

Looks like this is more a semantic issue ;-)

Wholematches in combination with lineoffset.

Sounds to me that a WHOLE LINE has to match before lineoffset will return
anything else than 0.

Maybe i am totally wrong...
(Please do not beat me in that case, thanks :-)


Regards

Klaus Major [EMAIL PROTECTED]
MetaScape GmbH

 
 FIELD 1 (word families) 
 1tabappletabapplescr
 2tabbedtabbedstabbeddingcr
 3tabhometabhomestabhomemakercr
 4tabmaketabmakestabmakingtabmade
 
 ---FIELD 2 (the user's word-list) --
 applecr
 bedcr
 makecr
 sing
 
 # Here are the script variations I've tried,
 # and what is returned when I try a match to
 # to the word make. Note that all the
 # variations start with these two lines:
 
 put field 1 into tField1 -- the word-family list
 put word 3 of field 2 into tWord -- make
 
 VARIATION (1) ---
 put lineOffset(tWord, tField1)
 #  This returns 3 since
 #  homeMAKEr is on that
 #  line, BUT 4 is what
 #  I'm after. Fair enough, tho.
 
 VARIATION (2) --
 set the wholeMatches to true
 put lineOffset(tWord, tField1)
 #  This returns 0 BUT I
 #  thought/expected 4!!
 
 VARIATION (3)
 set the wholeMatches to true
 put wordOffset(tWord, tField1)
 #  This returns 14, which
 #  is a correct identifying
 #  number -- only, I want
 #  a line number, not a
 #  word number.


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




Re: lineOffset / wholeMatches

2001-10-26 Thread eugen helbling

NR Kweto wrote:
 
 Hello,
 
 Perhaps I misunderstand lineOffset and its behaviour when wholeMatches is
 set to true... The aim of the word-search algorithm I'm trying to script is
 to match words in one list to those in another. Actually, it's the line
 number that I'm after, and I want only whole matches (i.e., make should
 match only to make, not to homeMAKEr). And so, I've tried setting
 wholeMatches to true, but 0 keeps being returned even tho I know a match
 exists.
 
  START OF LENGTHY EXAMPLE %
 
 For example, these two fields:
 
 FIELD 1 (word families) 
 1tabappletabapplescr
 2tabbedtabbedstabbeddingcr
 3tabhometabhomestabhomemakercr
 4tabmaketabmakestabmakingtabmade
 
 ---FIELD 2 (the user's word-list) --
 applecr
 bedcr
 makecr
 sing
 
 # Here are the script variations I've tried,
 # and what is returned when I try a match to
 # to the word make. Note that all the
 # variations start with these two lines:
 
 put field 1 into tField1 -- the word-family list
 put word 3 of field 2 into tWord -- make
 
 VARIATION (1) ---
 put lineOffset(tWord, tField1)
 #  This returns 3 since
 #  homeMAKEr is on that
 #  line, BUT 4 is what
 #  I'm after. Fair enough, tho.
 
 VARIATION (2) --
 set the wholeMatches to true
 put lineOffset(tWord, tField1)
 #  This returns 0 BUT I
 #  thought/expected 4!!
 
 VARIATION (3)
 set the wholeMatches to true
 put wordOffset(tWord, tField1)
 #  This returns 14, which
 #  is a correct identifying
 #  number -- only, I want
 #  a line number, not a
 #  word number.
 
  END OF LENGTHY EXAMPLE %
 
 So, like I say, what am I misunderstanding...
 
hi Nicolas,
perhaps this change will give you the right answer for your variation 3

 VARIATION (3)
set the wholeMatches to true
put the number of lines in word 1 to wordOffset(tWord,tField1) of tField1

or if your application permits, put a TAB at the end of each line in the field 1 like
 FIELD 1 (word families) 
 1tabappletabapplestabcr

 VARIATION (1) ---
 put lineOffset(tab  tWord  tab, tField1)

regards 
Eugen

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




Re: Subject: Re: clickline()

2001-10-26 Thread eugen helbling

Mark Luetzelschwab wrote:
 
 Subject: Re: clickline()
 hi all,
 got a problem with clickline() on mc2.4
 
 i have a text field in a stack consisting of 3 lines.
 
 I feel this field with
 put  1 cr -  cr into fld X
 by clicking with the mouse (anywhere int the line) on the first line
 expect that the clickline() returns
 the line I clicked on. In mc 2.3.2 clickline() returns a value and
 clickchunk() returns
 char 1 to 0 of field X
 In mc 2.4 the function returns empty until I click the textchunk 1
 any proposals?
 have checked the archive but did not find anythink.
 
 thanks in advance and sorry for my english.
 
 
 I suppose this is a bug. You can use:
 if word 2 of the clickLine is empty then answer Please, click on a
 word on the line! or something similar.
 -- -
 
 Actually, I would consider this a 'feature'.  It used to be that
 clicking outside the text (i.e. in the margins) returned empty, and
 clicking in whitespace returned char a to a-1...now it looks like if
 you click on text, it gives you the info, if you click on anything
 that is not text, its empty. Makes the logic easier than having to
 determine if the click was in the margin or in the text.
 
 Use the clickCharChunk/clickchar function to get the char number/char
 the user actually clicked on (in case you do want to know if they
 clicked on a tab, etc).
 
hi all

Mark, thanks for clickCharChunk. Seems to be like you described the behavior of 
clickline. Ans so I could solve the problem/future.
regards

-- 
Eugen Helbling
_

   GINIT Technology GmbH[EMAIL PROTECTED]
   Eugen Helbling  www.ginit-technology.com
   Emmy-Noether-Str. 11phone:   +49-721-96681-0
   D-76131 Karlsruhe   fax:   +49-721-96681-111

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




Re: mc and cgi

2001-10-26 Thread Nicolas Cueto
Klaus Major asked:

 the number of hits per second that MC can handle.

Now how does one figure _that_ out...

Nicolas R Cueto


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


Re: lineOffset / wholeMatches

2001-10-26 Thread Nicolas Cueto
Eugen Helbling advised:

 VARIATION (1) ---
 put lineOffset(tab  tWord  tab, tField1)

It worked!

Thank you.

Nicolas R Cueto


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


read from stdin / $REQUEST_METHOD is POST

2001-10-26 Thread Nicolas Cueto
Hello,

How could I limit the amount of data/chars receivable via stdin/POST in an
.mt (cgi) script? I'd like to prevent something bad happening
unintentionally or maliciously to the server. Or is this a server-engine
issue?

Thank you.

Nicolas R Cueto





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


Re: RFC: Optimizing stripDup()

2001-10-26 Thread Jacqueline Landman Gay

Geoff Canyon wrote:
 
 Maybe something like:
 

Geoff's is faster than mine. I never thought to use arrays. Pretty impressive.

-- 
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com

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




Re: RFC: Optimizing stripDup()

2001-10-26 Thread Jacqueline Landman Gay

LiangTyan Fui wrote:
 
 Here is a function that I've written quite some time ago. It takes a list of
 text theList, separated by theitemDel, remove duplicate items in the list,
 and returns a new list without duplicate items.
 Unfortunately, this function running rather slowly on a large list (a few
 thousands records) - that is why I am posting here as a little open
 source, Request For Comment: Make it faster guys!
 Remember, the sequence of the records cannot be changed, that say you are
 not likely to use sort.

On a test field of almost 8,000 lines, the original script takes 112
ticks on my Mac, compared to 8 ticks for this version:
 
function stripDup theList,theitemDel
  # verify param
  -- put the ticks into startticks -- Enable for time tests
  if theList=  then return 
  if theitemDel =  then put cr into theitemDel
  put char 1 of theitemDel into theitemDel
  set the itemDelimiter to theitemDel
  put  into theList2
  set wholematches to true
  repeat for each item i in theList
if itemOffset(i, theList2) = 0
then put i  theItemDel after theList2
  end repeat
  -- put the ticks - startticks -- Enable for time tests
  return theList2
end stripDup

-- 
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com

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




finding system folder on Mac

2001-10-26 Thread Leston Drake

Does anyone know how to identify the System (or better yet, the 
Preferences) folder on a Mac? I understand this is the place to store 
app-specific data on the Mac, but how does one identify it (since they can 
be renamed)?

TIA,
Leston


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




Re: finding system folder on Mac

2001-10-26 Thread Leston Drake

Geoff pointed me to the External collection from RunRev, since I'm still 
using 2.3. I guess in 2.4 you can use the specialFolderPath
function.

At 01:10 PM 10/26/2001, you wrote:
Does anyone know how to identify the System (or better yet, the 
Preferences) folder on a Mac? I understand this is the place to store 
app-specific data on the Mac, but how does one identify it (since they can 
be renamed)?

TIA,
Leston


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



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




Re: RFC: Optimizing stripDup()

2001-10-26 Thread LiangTyan Fui

On 10/27/01 2:34 AM, Jacqueline Landman Gay wrote:

 Geoff Canyon wrote:
 
 Maybe something like:
 
 
 Geoff's is faster than mine. I never thought to use arrays. Pretty impressive.

Yup, the winner is Geoff. Thanks!
Now, where should I post this script to?
Do we have an organised xTalk library somewhere? Or should I use
http://www.mctools.org?

Regards,
LiangTyan Fui




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