RE: OO programming

2003-01-03 Thread Watson, Christopher
Hmmm...how about a complete OO Lingo implementation of the Document Object
Model (DOM)?

http://www.dom-lingo.webhosts2000.com


Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan Acheive Now Online
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001



-Original Message-
From: Eric Terry [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 12:41 PM
To: Lingo List
Subject:  OO programming


Anyone doing any interesting things with OOP?

Any heads up on good books / sites?

Thanks.

Eric Terry
Programmer/Analyst
Metropolis Entertainment
www.metropolisentertainment.com




[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is
for learning and helping with programming Lingo.  Thanks!]
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: MX opinion!!

2002-12-19 Thread Watson, Christopher
I love the re-tooled Debugger. Just being able to expand and collapse my
lists is terrific. I like to orient the Debugger pane at the bottom of the
Script window. That way, when the Script window switches over to debugging
at the breakpoint, I don't lose my place. The script doesn't shift, and I'm
right where I want to be. But, like the release notes state, the Debugger
font is downright puny and nigh-on unreadable at 1600x1200. Is there any way
to change the font for the Debugger?!

The split-pane Message window is fantastic, too. I like seeing the results
of calls I make from the Message window without having my output obliterate
my input. It's just a little thing that makes a big difference.

I'm quickly getting used to panel grouping, too. Being able to save those
arrangements, and call them back in, is wonderful.

Docking doesn't do much for me. I like to maximize my script windows as much
as possible, so I leave my essential panels undocked so as to have as much
client window space as possible.


Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan Acheive Now Online
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001



-Original Message-
From: Mayuresh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 9:51 PM
To: [EMAIL PROTECTED]
Subject:  MX opinion!!


Hi List

Just downloaded the trial and trying it out, and I like it already.
I think the debugger and object inspectors are great.
_
Regards,
Mayuresh

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is
for learning and helping with programming Lingo.  Thanks!]
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Just Testing

2002-12-10 Thread Watson, Christopher
My apologies for all these tests. My company has been goofing around with
anti-spam filters, and they still haven't gotten it quite right.


Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan Acheive Now Online
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Test

2002-12-10 Thread Watson, Christopher
Test

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Watchpoints

2002-11-08 Thread Watson, Christopher
Whenever I wanted to create a "watchpoint" in Lingo, I would do this...

if (liValueIAmWatching = 1234) then
  nothing
end if

...and I would place a breakpoint at the "nothing" line. I reasoned that the
Watcher window wasn't ever going to help me in this regard because it just
"watched" the variables, it didn't "break" when the variable was set to a
certain value.

How does everyone else do watchpoints? You know, where you can just let the
scripts rip, and then a break will occur only when a particular condition is
met. How about writepoints and readpoints, where a break occurs whenever a
read or write from/to a variable occurs? Goodness knows pretty much all of
us have worked ijn debugging environments that provide this capability.

Share your secrets!


Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan Acheive Now Online
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: ANN: LingoFish available at last!

2002-11-04 Thread Watson, Christopher
Well, download the Cast and the Test Movie and look into it. Pretty
ding-dang cool, if you ask me.

-Christopher

-Original Message-
From: [EMAIL PROTECTED] [mailto:grimmwerks@;grimmwerks.com]
Sent: Wednesday, October 30, 2002 12:59 PM
To: [EMAIL PROTECTED]
Subject: Re:  ANN: LingoFish available at last!



Same thing with me. A lot failed, but then it said I was good to go. Don't 
really understand what's going on anyway. I mean in general.
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: ANN: LingoFish available at last!

2002-10-30 Thread Watson, Christopher
All tests passed.
Windows 2000 Pro
Pentium III, 500 MHz
128 MB RAM

Nice job, Robert! Gotta love Lingo OOP for API implementations!

Christopher Watson
Creator, DOM-Lingo

-Original Message-
From: Robert Tweed [mailto:robert-lists@;killingmoon.com]
Sent: Wednesday, October 30, 2002 11:27 AM
To: Lingo-L
Subject:  ANN: LingoFish available at last!


OK, I've been saying I'll release this "soon" for months now, but finally
it's up on my site. Highly optimised Blowfish implemented in pure Lingo.
Hope some of you find this useful.

http://www.killingmoon.com/director/lingofish/

One thing, could someone with a Mac please test it for me. The second page
is a test/demo movie that runs the cipher through a set of standard test
vectors. If they fail, then the implementation has a flaw. It works fine on
Windows, but I have not had a chance to test on a Mac yet, and some of the
integer arithmentic could possibly fail. I hope not though, because I spent
days tightening it up, so it's about as efficient as you will ever get in
Lingo.

- Robert
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Quickie Port for Lingo and C Expert!

2002-09-26 Thread Watson, Christopher

Here's a good one. I'm having trouble with this. Maybe someone would like to
take a stab at it for fun!

Below is some C source for a relatively simple function that generates a
series of three stellar magnitude deltas from an input floating-point value
(along with a main test routine). I need to duplicate this function
precisely in Lingo. I know it can be done. It's the pointer math that's
getting to me!

If you're feeling altruistic today...give it a shot!

-Christopher

-

/* The following function takes a (B-V)T value,  i.e.,  a B-V color in
the Tycho magnitude system,  and computes from it V-VT,  the difference
between Johnson V and Tycho V;  the corresponding B-V in the Johnson
scheme;  and V-Hp,  the difference between Johnson V and Hp (Hipparcos
"magnitude") for the input color.

   I got the raw data for this from Brian Skiff,  who posted them on
the Minor Planet Mailing List (MPML) with the following comment:

   "...To get standard V and B from Tycho-2, it is probably best to use the
relation shown by Mike Bessell in the July 2000 PASP... Bessell does not
give
an algebraic relation, but instead shows a cubic spline fit with a look-up
table...  I have copied out Bessell's table below as a flat ASCII list."

   In what follows,  values for (B-V)T away from the lookup table
points is computed using (again) a cubic spline.  The functions vary
with sufficient slowness that this ought to be accurate down to the
.001 mag level.*/

#define LOOKUP_SIZE 46

int tycho_to_johnson_colors( const double bt_minus_vt, double *results)
{
   int i, table_loc = (int)( (bt_minus_vt + .25) / .05) - 1;
   double dx, coeff[4];
   static const short lookup_tbl[LOOKUP_SIZE * 3] = {
  /*  BT-VT V-VT  del(B-V)  V-Hp */
  /* -0.250 */   38,   31, 66,
  /* -0.200 */   30,   21, 51,
  /* -0.150 */   22,   11, 36,
  /* -0.100 */   15,5, 21,
  /* -0.050 */8,2,  6,
  /* -0.000 */1,   -5,-11,
  /*  0.050 */   -5,  -10,-25,
  /*  0.100 */  -12,  -17,-38,
  /*  0.150 */  -18,  -20,-48,
  /*  0.200 */  -24,  -21,-58,
  /*  0.250 */  -29,  -23,-69,
  /*  0.300 */  -35,  -25,-79,
  /*  0.350 */  -40,  -25,-87,
  /*  0.400 */  -45,  -26,-94,
  /*  0.450 */  -50,  -30,   -101,
  /*  0.500 */  -54,  -35,   -108,
  /*  0.550 */  -59,  -45,   -114,
  /*  0.600 */  -64,  -51,   -120,
  /*  0.650 */  -68,  -60,   -127,
  /*  0.700 */  -72,  -68,   -131,
  /*  0.750 */  -77,  -76,   -134,
  /*  0.800 */  -81,  -85,   -137,
  /*  0.850 */  -85,  -94,   -142,
  /*  0.900 */  -89, -104,   -147,
  /*  0.950 */  -93, -113,   -151,
  /*  1.000 */  -98, -122,   -155,
  /*  1.050 */ -102, -131,   -158,
  /*  1.100 */ -106, -142,   -157,
  /*  1.150 */ -110, -154,   -160,
  /*  1.200 */ -115, -166,   -162,
  /*  1.250 */ -119, -178,   -164,
  /*  1.300 */ -124, -189,   -166,
  /*  1.350 */ -128, -199,   -166,
  /*  1.400 */ -133, -210,   -165,
  /*  1.450 */ -138, -222,   -164,
  /*  1.500 */ -143, -234,   -161,
  /*  1.550 */ -148, -245,   -157,
  /*  1.600 */ -154, -256,   -153,
  /*  1.650 */ -160, -266,   -148,
  /*  1.700 */ -165, -277,   -143,
  /*  1.750 */ -172, -288,   -137,
  /*  1.800 */ -178, -299,   -131,
  /*  1.850 */ -185, -309,   -125,
  /*  1.900 */ -191, -320,   -119,
  /*  1.950 */ -199, -331,   -112,
  /*  2.000 */ -206, -342,   -106 };

   if( bt_minus_vt < -.25 || bt_minus_vt > 2.)
  return( -1); /* out of table range */
   if( table_loc < 0)
  table_loc = 0;
   if( table_loc >= LOOKUP_SIZE - 4)
  table_loc = LOOKUP_SIZE - 4;
   dx = ((bt_minus_vt + .25) / .05) - (double)table_loc;
   coeff[0] = (dx - 1.) * (dx - 2.) * (dx - 3.) / -6.;
   coeff[1] = dx * (dx - 2.) * (dx - 3.) / 2.;
   coeff[2] = dx * (dx - 1.) * (dx - 3.) / -2.;
   coeff[3] = dx * (dx - 1.) * (dx - 2.) / 6.;
   for( i = 0; i < 3; i++)
  {
  const short *tptr = lookup_tbl + i + table_loc * 3;

  results[i] = .001 * ((double)tptr[0] * coeff[0]
 + (double)tptr[3] * coeff[1]
 + (double)tptr[6] * coeff[2]
 + (double)tptr[9] * coeff[3]);
  }
   results[1] += bt_minus_vt;  /* change a 'delta' into an 'absolute' */
   return( 0);
}

#ifdef TEST_FUNC
#include 
#include 

void main( int argc, char **argv)
{
   double ovals[3];

   if( argc == 2 && !tycho_to_johnson_colors( atof( argv[1]), ovals))
  {
  printf( "V-VT = %.4lf\n", ovals[0]);
  printf( "B-V = %.4lf\n", ovals[1]);
  printf( "V-Hp = %.4lf\n", ovals[2]);
  }
}
#endif
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
le

RE: dear macromedia (bug again)

2002-08-02 Thread Watson, Christopher

I'm going to have to go on record as agreeing with Buzz.

And with Tom.  :-)

>From the practical standpoint of what the mind expects, far models rendering
in front of near models is indeed the root "unexpected behavior:" Q: Who is
the customer here? A: The developer; the end-user. According to most quality
assurance guidelines I've ever worked under, Macromedia and the Director
Product Team have not, in this case, met the customer's requirement that
models in the 3D environments they create in Director appear in correct
apparent distance order. In the strictest of all global terms, THAT is was
is defined as a bug.

Now, with that said, we turn to the technical side. Tom is correct in saying
that, because what is actually happening is not an "unexpected behavior"
from the vendor's viewpoint -- that the 3D engine is performing exactly as
implemented -- it cannot be classified as a bug. As far as Macromedia's
tracking databases are concerned, it shouldn't be. But it should most
definitely be logged as a customer requirement not met by the development
team, and an issue to be dispositioned in the next release.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___


-Original Message-
From: Buzz Kettles [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 02, 2002 2:32 PM
To: [EMAIL PROTECTED]
Subject: RE:  dear macromedia (bug again)


I have to disagree Tom
(& I certainly know & understand the semantics involved in labelling 
something a bug)

In this case, however, one of the primary premises of working in 3D 
space is that nearer objects render in front of further objects

This fails that primary premise.

my 2 cents

-Buzz
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Efficiency Questions

2002-07-17 Thread Watson, Christopher

Thanks, guys! Always a big help.

My overheated benchmarks show that the chars() function is the winner by as
much as a 24% margin.

Thanks, Buzz, for the reminder about .ref. In my application, however, I'm
hardly doing any multiple accesses of the same chunk, so I don't have a
strong case for using that property right now.

The only reason I threw in the property list version of the two-value return
is because it made better visual "code sense" at the re-access point using
.h and .v, rather than [1] and [2]. It was clearer what each value was.
Still, I'll probably just stick with the simple linear list approach. Faster
ands smaller. The values aren't used as a point in the context of Lingo
(they represent a location within the SVG coordinate plane), so I'll refrain
from incurring the overhead of points.

Thanks again!

-Christopher
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Efficiency Questions

2002-07-17 Thread Watson, Christopher

In conjunction with my SkySVG project, some items that beg the question
"Which is best?" Meaning, "best" from a speed and efficiency perspective.

1. Accessing character ranges

lsRAh = lsInputLine.char[6..9]

-OR-

lsRAh = chars(lsInputLine, 6, 9)

-OR-

lsRAh = char 6 to 9 of lsInputLine

2. Returning two values from a function

on plotFunc pfRAdeg, pfDEdeg
  -- calculations for lfPlotRA and lfPlotDE
  return point(lfPlotRA, lfPlotDE)
end

lpPlotRADE = plotFunc(lfRAdeg, lfDEdeg)
lfPlotRA = lpPlotRADE.locH
lfPlotDE = lpPlotRADE.locV

-OR-

on plotFunc pfRAdeg, pfDEdeg
  -- calculations for lfPlotRA and lfPlotDE
  return [lfPlotRA, lfPlotDE]
end

lpPlotRADE = plotFunc(lfRAdeg, lfDEdeg)
lfPlotRA = lpPlotRADE[1]
lfPlotDE = lpPlotRADE[2]

-OR-

on plotFunc pfRAdeg, pfDEdeg
  -- calculations for lfPlotRA and lfPlotDE
  return [#h: lfPlotRA, #v: lfPlotDE]
end

lpPlotRADE = plotFunc(lfRAdeg, lfDEdeg)
lfPlotRA = lpPlotRADE.h  -- or lpPlotRADE[#h]
lfPlotDE = lpPlotRADE.v  -- or lpPlotRADE[#v]

Christopher Watson
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: What is the going rate for experienced Director now?

2002-07-16 Thread Watson, Christopher

That's not too big a shaft, Brian.

High-level Director contract work -- depending on market, demand, alignment
of skillset with project demands, clout, and many other factors -- should
start around $40/hr and top out at around $150/hr. Again, lots of
dependencies there. Under one set of particular circumstances, you might
only see the bottom end. Under another set, the high. Overall, though, the
Director contract climate is arctic.

Christopher Watson


-Original Message-
From: brian [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 3:31 PM
To: [EMAIL PROTECTED]
Subject: Re:  What is the going rate for experienced Director
now?


>The other day I saw a job posting from Director work in Texas
>suggesting that they were willing to pay $12-$14 per hour -
>
>my wife suggested that they must've lost a decimal place ...
>
>note: the Director contact market is extremely cool right now.
>(At least what I've been able to find)
>
>-Buzz


You have got to be kidding. I was just trying to see if one of my temp
agencies was giving me the shaft. They quoted me $35/hr.


 Brian Douglas  (:ub)
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Numeric Range Search in List

2002-06-27 Thread Watson, Christopher

Here's the original problem, guys. And, by the way, thanks for the shared
brainpower.

I'm using Lingo (and DOM-Lingo) to generate SVG documents for each of the
Guide Star Catalog (GSC) regions within the Tycho-2 Star Catalog.
Essentially, I'm generating a TON of very detailed star charts for viewing
in the Adobe SVG Viewer. There are 9,537 regions defined by the GSC to cover
the whole sky, and the Tycho-2 database uses those regions to primarily
identify and catalog its stars. The Tycho-2 Main Catalogue has 2.5 million+
stars, and they are ordered in the database by region (which is nice --
makes things real easy for this phase). I'm generating an SVG chart for each
of the regions -- averaging over 200 stars per chart, but up to 600 stars
per chart in the regions covering the Milky Way. Lingo reads the delimited
database records, parses them, and does all the math for position and
magnitude (cx, cy and r attributes for  elements, if you know SVG).
DOM-Lingo builds an SVG DOM tree for each region, and the serialized XML is
spit back out into a "GSC.svg" document.

The values of the "bounding box" list elements that I detailed are actually
the min and max Right Ascension and Declination, expressed in decimal
degrees, for each of the 9,537 GSC regions. The R.A. values run from 0.0 to
360.0, and the Decl. values run from -90.0 (South Celetial Pole) to +90.0
(North Celestial Pole).

Now that I've progressed past the star plotting phase of this project, it's
time to tackle the galaxies (and then, eventually, the nubulae, clusters,
radio sources, etc.). The Catalog of Principal Galaxies (PGC) contains
positional data for over 77,000 galaxies, but it is NOT cataloged or ordered
according to GSC. Therefore, in order to make the appending of the galactic
data to the existing SVG documents easier and quicker, I'm going to have to
tranform the PGC database into a positionally ordered GSC-compliant format.
That way, I can then work with the chunk of galaxies that lie within each
region, in order. I have to read and parse the SVG document for the region,
use DOM-Lingo to tack on the new galactic elements, and then reserialize.

To do this first-step conversion, I need to take the R.A. and Decl.
coordinates for each galaxy and match them up to the corresponding GSC
region in which they lie. For each galaxy I read from the PGC, I'll append
its raw data to the end of the corresponding intermediate region file. I'll
then concatenate all those intermediate regions files into a single
GSC-compliant database file, which I can then use to modify the existing
9,537 SVG documents. If I were to simply walk through the PGC, line for
line, in the order that it is currently in, and open/parse/append/serialize
each galaxy into its corresponding SVG region document, it would be take a
whole heck of a lot longer to do it than if I had an entire region's worth
of galaxies to slap onto them.

So that's why I need to determine which GSC region a particular set of
coordinates falls within. The GSC regions are only defined by their
positional extents in the sky. I have to find where each galaxy goes. Thus,
I need a good way to determine that, based on the list of region extents
that I have.

-Christopher

-Original Message-
From: Colin Holgate [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 11:38 AM
To: [EMAIL PROTECTED]
Subject: Re:  Numeric Range Search in List


>tX = 124.357892
>tY = 20.736474
>tPoint = loc (tX,tY)
>
>repeat with i = 1 to myBigRectList.count
>  if tPoint.inside(myBigRectList[i]) then .
>end repeat


This is the approach I would have suggested, except it would still be 
up to 9500 repeats of the inside test. That's why I'm curious about 
what the original problem was, because there's a way to do the entire 
thing in one line.
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Numeric Range Search in List

2002-06-27 Thread Watson, Christopher

OK, I need a little guidance here.

I have a list with 9500+ elements in it. Each element in this big list is a
four-item list which acts as bounding box limits. Looks like this...

[[0.0, 2.5, 0.0, 2.5], [2.5, 5.0, 0.0, 2.5] ... [350.0, 360.0, 88.5, 90.0]]

The first item in each internal list is the minimum horizontal value (the
left) for that particular bounding box, the second is the maximum horizontal
value (the right), the third is the minimum vertical value (the top), and
the fourth is the maximum vertical value (the bottom).

Then I have two floating point values, which act as x and y (or h and v)
coordinates, like these...

124.357892
20.736474

What I need to do is search the big list for an element which contains a
bounding box within which BOTH the floating point values would physically
lie. For example, if I were to successfully find the "box" element in which
124.357892 and 20.736474 resided, I might find the element [122.5, 125.0,
20.0, 22.5]. That specific "box" element contains the horizontal coordinate
(124.357892 falls between 122.5 and 125.0) and the vertical coordinate
(20.736474 falls between 20.0 and 22.5).

I hope that makes sense.

Important: There is only ONE bounding box in the big list in which the
coordinates will lie, and there will always be ONE. The bounding box values
are not in numeric order of any kind, and it can't be reliably sorted in
such a way that a binary search can be implemented on this.

What would be the speediest way to perform this search? I'm sure there's a
tricky way to do this. I just can't come up with it.


¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Lingo questions

2002-05-20 Thread Watson, Christopher

That would bew:

http://www.furrypants.com/loope/

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___


-Original Message-
From: DrEvil [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 20, 2002 9:35 AM
To: [EMAIL PROTECTED]
Subject:  Lingo questions


Hello everyone, I'm new to the list and I have a few questions.

First off, I'm in a Director class at school and we have been learning a
lot of lingo. The problem is that we aren't getting too deep into
Object Oriented. We spent 1 class on it, and it seemed kindof rushed.

My question is this. Does anyone have any web pages or explanations that
will better help me understand OOP. I'm not quite understanding how
multiple items can work off a single script, each keeping their separate
values for the properties. Hopefully someone can help me understand
this, or provide a link that can help me out.

Thanks

Jeremy


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is
for learning and helping with programming Lingo.  Thanks!]
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: XML Question

2002-05-03 Thread Watson, Christopher

You can create XML documents, from scratch, in memory using DOM-Lingo:

http://www.dom-lingo.webhosts2000.com/

You can then use Lingo's postNetText() to send the XML (which DOM-Lingo can
produce using it's toString() interface) to a server in a standard HTTP POST
request.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___


-Original Message-
From: brian douglas [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 2:09 PM
To: [EMAIL PROTECTED]
Subject: RE:  XML Question


aorry i guess I was not clear,

I want to be able to create an xml document in director and send it to a
server., How do I create the structured file using director.

b
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: beginSprite script

2002-05-03 Thread Watson, Christopher

>Are not these questions rhetorical?










¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: XML Question

2002-05-03 Thread Watson, Christopher

Take a look at DOM-Lingo:

http://www.dom-lingo.webhosts2000.com

It parses, serializes (writes), traverses, manipulates, etc. Everything
you'd want to do, I'm sure...and all without an Xtra.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___


-Original Message-
From: brian douglas [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 8:17 AM
To: [EMAIL PROTECTED]
Subject:  XML Question


Hello list,

I was wondering, I have created a XML Object that includes all the Flash
methods for accessing nodes, but anm running into difficulties trying to
create methods to write XML. Is there a tutorial out there, or another Xtra
to compile XML?


B
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Lingo Gurus! Need some Input!

2002-04-24 Thread Watson, Christopher

>Can you set the colors on this sprite so that you can't see it?
>(leave it visible, just camouflage it.

That's pricisely the kludge I'm running now. And it works, so I'm not going
to fight it any longer. The QA Mode status text sprite is on-stage, but is
shrunk to a height of only a few pixels (so that no text shows), and the
scroll bar (which is evidently necessary) is just barely off-stage and not
visible. At the point I need this, it doesn't show anything.

>I presume you are not doing this in your parsing, etc.?
>
>repeat with var = 1 to blah.count

Well, Buzz...the parsing is long since done at the point of my problems. The
parsing is a split second thing earlier in the start-up of the engine.
There's just some DOM access going on in the object creation loop -- no
parsing, per se, going on -- and the repeat block iterates to a maximum held
within a property variable of the ItemManager object:

  property miNumItems

  miNumItems = goXML.getDocumentElement().getAttribute("NumItems")
  repeat with i = 1 to miNumItems

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Lingo Gurus! Problem Solved...For Now...

2002-04-23 Thread Watson, Christopher

Thank you, everyone, for your help.

After much consternation and consideration, I tried placing another instance
of my "Status" text member onto the stage in a separate channel. I assigned
a small behavior to that sprite to make it visible only in Release Mode,
shrunk the height of the member to the point where no text showed within it,
and nudged it far enough to the right to place the scroll bar off the stage.
I then modified the behavior attached to the original "Status" field sprite
to stretch the height of the text member back to what it should be for QA
Mode only.

I now have the speed I need, without showing anything new on the stage, and
without breaking QA Mode.

Super-duper kludgey...but, hey...it works. I'm not asking any more
questions. Just praying QA passes it.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Lingo Gurus! Need some Input!

2002-04-23 Thread Watson, Christopher

>Have you tried throwing some put statements in there or commenting out
>specific chunks of code to try to determine what portion of the code is
>causing the slow-down?

Yes. See my reply to Jakob.

>How bulky are the XML files that you are parsing?  Could they be slowing
>things down?

The XML is really pretty small. Definitely not bulky. Nothing unique or
special about it, either. And DOM-Lingo handles everything just fine. It's
not the bottleneck.

>Where are you doing this intitalization (frame script,
>parent script, movie script)?

The main Engine object is created in the "startMovie" handler. But it's a
frame script that calls the Engine object to create the ItemManager object,
whose "new" handler conatins the repeat loop that creates the list of Item
objects, which ancestor themselves to Layout objects, which ancestor
themselves to Template objects, which ancestor themselves to SampleLayout
objects, which ancestor themselves to IntroLayout objects. Everything is a
parent script. The one and only movie script contains the startMovie
handler, and a few global utility functions.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Lingo Gurus! Need some Input!

2002-04-23 Thread Watson, Christopher

>Does the text-fix also work if the member is not on the stage, or 
>not even in a sprite?

No. The sprite needs to be on-stage and visible for the speed-up to occur.

-If it only 'fixes' while on the stage, then it might have to do with 
the sort of 'mini-updatestage' i anticipate is happening when 
modifying staged text-members.

Sounds right to me, but I can't put any other text sprites on the stage,
because it's not in the design spec to do that. I wish I could, but I can't.

-Does a regular 'updateStage' also introduce a fix?

No. It doesn't. That was the first thing we tried.

-Have you tried to eliminate conceptual parts of your test, ie: is it 
the number of objects alone that grinds, or is generically using 
ancestry, or is it specific to some of your complex code - say 
DOM-XML?

Yes. I have strategically commented out and/or segregated chunks of code to
other repeat loops in order to pinpoint where the slow-down is actually
occuring, and it is indeed a result of my object creation and complex
ancestry tree. I took out the calls to DOM-Lingo, and that definitely wasn't
the problem, either. It's really looking more and more like a by-product of
my complex architecture.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Lingo Gurus! Need some Input!

2002-04-23 Thread Watson, Christopher

>Don't have a clue, but have you thought about leaving the text sprite 
>there and not worrying about it? What happens if you have the text 
>sprite, but don't write to it, or only write to it once in the whole 
>routine?

We ran a test that left the text sprite on-stage, and wrote into it in
Release Mode just as we do in QA Mode. But as far as we can tell, the
speed-up only occurs when that text sprite is on stage and visible. And we
simply can't have that in Release Mode. It's not part of the design.

Hoping that updateStage (or otherwise making visual changes to that which is
on-stage during this initialization process) would kick the speed up, we
tied the object creation loop into the progress bar that is already a part
of the engine start-up. No dice. Even making that update once within each
iteration of the loop does nothing to kick it up. So it's not tied to
writing to the stage or updating it.

It's looking more and more like it's all about the ancestry tree I'm
creating. It must just be too complex for these slower, older machines. But
that just seems weird.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Lingo Gurus! Need some Input!

2002-04-22 Thread Watson, Christopher

Alright...I need some help from all you high-caliber dudes and dudettes
regarding an strangeity we're seeing in our Shockwave activities.

During the initialization of our Shockwave-based testing environment, I'm
creating a slew of child objects from within a repeat loop within the "new"
handler of a parent script at the time of creation of another child object.
The child object in which the repeat loop resides is actually an ancestor of
another object. The main global child object, when created, assigns the
ancestor property to a child object it creates. That child object then runs
through a repeat loop which can, depending on the test being administered,
create up to 19 other child objects, storing them in a list property within
itself. Each of these other child objects ancestor themselves to other
objects they create, and those to still others, and those to still others.
All in all, we're talking about one object ancestoring to another it
creates, then creating a list of others, which all ancestor 4 levels deep
themselves. Each child object in this whole sheme is calling DOM-Lingo API
to gather vital info from the input XML which describes the test. In a
nutshell, it's a complex inititialization web.

On faster machine, running more modern operating systems, the whole process
is pretty fast. In fact, the phase of initialization that actually involves
all of this child object creation whizzes by, usually in less than a second.

On lower end machines with older operating systems, however, this object
creation phase is slo-o-o-o-o-o-w. Maybe not right at the outset, but
according to my debug window, the whole process slows down logarithmically.
It's almost acceptable, the pace at which the repeat loop executes at the
beginning of its iterations, but gradually slows down to a snails pace at it
progresses. By the time we get around to creating the 10th, 15th, 19th
object, we're chugging at about 3 or 4 seconds for each loop. Not
acceptable.

The lower end machines I'm talking about are, for example, Windows 95 and 98
machines on 233 MHz P2's, with either 32 or 64 MB of RAM. On my W2K box,
which is a PIII 500, it's screams. No slowdown.

These child objects I'm creating, they are not memory hogs. They don't do
much more than create other smallish child objects, and call out to
DOM-Lingo to get info from the XML. Memory is NOT in bad shape while this is
going on.

And here's the real kicker, guys. When I run my engine in what we call QA
Mode (where I display a text sprite into which I place debug strings as it
runs), it runs lickety-split on the low-end machines, too! The only
difference between the "release" and the "QA" modes is that text sprite, and
that I'm putting text into it as the repeat loop runs. There are NO OTHER
programmatic differences between the modes.

Now, I need to also say that I have already produced a version of this
engine that breaks the repeat loop out into a two-frame loop that repeatedly
calls the second child object (after it is created) to create this list of
other child object. Naturally, I thought that if I departed from my "repeat
loop" ways, and let the playback head drive the creation of these objects,
the engine would snap out of it and get through the loop a lot quicker. I
figured that I just need to give the engine some "main application loop"
time. But that didn't do a thing. No change.

I'm bamboozled. If it's not memory, why is this object creation process
bogging down? And morfe importantly, why does it NOT bog down if I'm writing
strings to a text sprite?

Please help. Someone!


¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Unicode in Director

2002-04-15 Thread Watson, Christopher

The XML Parser Xtra supports the UTF-8 and UTF-16 encodings of the Unicode
character set. It also supports ISO-8859-1 (Latin 1), US-ASCII, and EUC-JP
and SHIFT-JIS (for Japan). It also supports an encoding named
"x-director-lingo" I think. But I can't locate the documentatioin for that
right now, or I'd point you to it.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___


-Original Message-
At 12:41 PM +0700 4/15/02, you wrote:
>Hi all,
>
>Does Director 8.5 support Unicode? I can not read XML file has unicode.
Have
>you ever meet this problem? Please show me.
>
>Thanks a billions
>Hung Hoang.
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Text cursor still shows after moving text box offst age!

2002-04-09 Thread Watson, Christopher

Thanks, Buzz...the scrollTop force-feed worked.

-Christopher

-Original Message-
From: Buzz Kettles [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 4:46 PM
To: [EMAIL PROTECTED]
Subject: RE:  Text cursor still shows after moving text box
offst age!


have you tried either of these ?

member().scrollTop = member().scrollTop
-- an attempt to wake up the scroller display ...

or

the stageColor = the stageColor

hth

-Buzz
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Text cursor still shows after moving text box offstage!

2002-04-08 Thread Watson, Christopher

I'm having the same problem with the scroll bar for a scrollable text
sprite. Visible/invisible, on-stage/off-stage...no matter what I try, that
scroll bar is still there!

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___


-Original Message-
From: James Tu [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 6:27 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject:  Text cursor still shows after moving text box
offstage!


I've had this happen to me when I try to move a editable textbox offstage...

The blinking cursor still stays on stage!!!

Has anyone else encoutered this?

I tried lots of things...making it not editable, invisible, before I move 
it offstage, and the same thing happens!!!

HELP!
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Is there a Math.round in Lingo ?

2002-03-28 Thread Watson, Christopher

Running the integer function on any floating-point value will get you the
rounded value. But be careful, the precision is only 16 decimal places.

put integer(2.2)
-- 2

put integer(2.5)
-- 3

put integer(2.4999)
-- 3



-Original Message-
From: Kevin McCarthy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 4:51 PM
To: [EMAIL PROTECTED]
Subject:  Is there a Math.round in Lingo ?


Hi,

I need to know, is there a way of saying math.round in lingo, I am
trying to slide a camera around.

Or perhaps there may be a way of actually sliding a camera from an old
position to a new position in director that I'm not aware of..??

-KEV-

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is
for learning and helping with programming Lingo.  Thanks!]
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: embedding fonts

2002-03-28 Thread Watson, Christopher

Make sure to include the Font Xtra and the Font Asset Xtra in that
projector.

Rules for Creating Projectors

1) If something suddenly doesn't work in your projector that worked in
authoring or in a browser, check the Xtras.
2) See Rule 1.

¯¯¯
Christopher Watson
Sr. Software Engineer
Interactive Web Media
Lightspan, Inc.
Tel 858.824.8457
Fax 858.824.8001
___


-Original Message-
From: Mattie Wells [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 10:19 AM
To: [EMAIL PROTECTED]
Subject:  embedding fonts


Hello again,:-)
Im having proplems embedding fonts and getting them to work . Does anyone
know why the embedded font is not working in the projector file? Its a redo
project and they did not include the fonts so I had to go in a replace all
the fonts with a basic arrial font. I embedded that font into the cast, Then
created a projector file. I removed the arrial font from my computer and ran
the projector.exe and its still substituting the font for somthing else.
any ideas?

Thanks,
Mattie Wells
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Time Stamping in Code at Publish Time

2002-03-18 Thread Watson, Christopher

Here's an interesting one.

We've got several development and R&D servers onto which I deploy the DCR I
produce. The manual deployments happen relatively irregularly over the
course of a week or so, and then the DCR is intergrated into a site build
that is installed onto other servers at other times. Depending on the time
of day, one set of servers may have one version of the DCR, and another set
may have another version. Eventually, a specific version is tagged as a
build candidate, and it gets packaged up in our build process and installed
on the QA boxes for testing.

The DCR can be run in a "QA Mode" that displays several bits of information
in the stage area for testing purposes only. One bit of info, which is very
important to the testers, is the "Submission Level". That's simply a letter
(A, B, C...and so on), which is manually incremented in my "startMovie"
handler each time a I publish a DCR destined for the build and a submission
into QA. We track our defects (bugs) using the Submission Level as the key
for regressions, etc.

But at the development and R&D boxes, there may be several versions of the
DCR deployed during any given day, and it becomes important for the content
reviewers and production people to know EXACTLY what version of the DCR
they're looking at. It becomes even more important to ME when the content
and curriculum people approach me wondering if the version they're looking
at has that one little fix I implemented earlier in the day...or not. I
don't have any way of telling them if it does, because all we can see as a
result of running it in "QA Mode" is a Submission Level letter. For these
particular servers, that's just not enough info.

I need more granularity in my versioning display. But I do not want to have
to increment or edit a string in Lingo every single time I publish the DCR
(which is dozens of times per day). I need some sort of automated way to get
my DCR the information it needs to display a "version" tied to the specific
instance of publishing the DCR. How can I do that???

I really wish there was some message sent to movie scripts whenever a DCR
was about to be published, so that I could alter via Lingo the movie script
that contains my version string. I could insert the current date and time,
and have that available via a global variable at runtime. That way, I could
also display the "publish date and time" of the DCR when it was run in "QA
Mode".

Anybody got any tricks up their sleeves for doing this sor of thing? Any
alternative ways of looking at this problem?

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Tokenizer Optimizations Anyone?

2002-03-04 Thread Watson, Christopher

Thank you Cole, Irv and Luke.

Cole, you were right. There are some tangible speed-ups when going to "old
school" over "dot". I'm converting my entire DOM implemenation, because it's
definitely worth the effort.

Irv, those were some terrific suggestions. I'll put the delimiter string
length into a local var and work with that. I had already tried the list
variation on the set of delimiters, but didn't see any substantial gains
there. Now, using the itemDelimiter to "chunk" the tokens out is an idea
that I think has some potential. I'd just have to figure out how to
successfully make it recursive for all the delimiters, while maintaining the
proper order in the resultant token list. I'll look into that.

Luke, thanks for the new approach. I hadn't considered getOne as an
alternative to looping through the delimiters. That's what I call "comin' in
through the side door".

Results later

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Tokenizer Optimizations Anyone?

2002-03-04 Thread Watson, Christopher

Hello friends.

Below you will find the properties and "new" handler for my string
tokenizer. This object takes a string, and a collection of delimiters, and
splits the string into an internally maintained linear list of tokens, based
on the specified delimiting characters.

I'm looking for ANY ways to optimize this "new" handler, without having to
resort to TextCruncher or any other Xtra.

I'm sure the handler is understandable, so I don't need to go into great
detail to explain it. Basically, any number of delimiting characters can be
sent in, so the search needs to take all delimiters into account. Obviously,
it needs to find the nearest occurance of any one of the supplied
delimiters, and then needs to add to the linear list the chunk of text
between the current search point and the found delimiter. I'm currently
hacking the front off of the supplied text with each find, so that I can use
the offset function to locate the next nearest occurance of a delimiter.

I just want to know if there's a better way to do this.

Thanks!

---
-- [DOM-Lingo] Tokenizer
---
-- Copyright ©2002 Christopher Watson
-- All Rights Reserved Worldwide.
---

---
-- PROPERTIES
---
property mlTokens -- [DOM-Lingo] Internal private token list
property miCurrToken  -- [DOM-Lingo] Token offset

---
-- CONSTANTS
---
property LINEFEED -- [DOM-Lingo] ASCII 0x0A (decimal 10)

---
-- METHODS
---

---
-- [DOM-Lingo] new
---
on new me, psData, psDelims
  mlTokens = []
  miCurrToken = 0
  LINEFEED = numToChar(10)
  if psData.length = 0 then return me
  repeat while TRUE
liNearestOffset = psData.length
lbDelimFound = FALSE
repeat with i = 1 to psDelims.length
  liOffset = offset(psDelims.char[i], psData)
  lbDelimFound = (lbDelimFound or (liOffset > 0))
  if (liOffset > 0) and (liOffset < liNearestOffset) then
liNearestOffset = liOffset
  if lbDelimFound and liNearestOffset = 1 then exit repeat
end repeat
if lbDelimFound then
  mlTokens.add(psData.char[1..liNearestOffset - 1])
  delete char 1 to (liNearestOffset - 1) of psData
else
  if psData.length > 0 then mlTokens.add(psData)
  exit repeat
end if
  end repeat
  return me
end

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: where are the Lingo-L archives?

2002-02-21 Thread Watson, Christopher

Actually, for Outlook 2000,  the quickest way to get to the headers is to
right-click the message as it sits in your box, and choose "Options." They
appear in the "Internet headers" field of the Message Options window that
pops up. And, you are correct, there are no options for displaying the full
message headers anywhere in the body of the message or the preview pane.

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008


-Original Message-
From: Matthew DeSimone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 9:43 AM
To: [EMAIL PROTECTED]
Subject: RE:  where are the Lingo-L archives?


Actually, Outlook2k+ only has the headers available under
"tools/options" once you view the message.  I have yet to be able to
find an option which
lets me display the full message headers in the message body itself.
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



getNetText -> getStreamStatus -> error = 4152?

2002-02-07 Thread Watson, Christopher

I'm performing a getNetText to an ASP page which calls a COM object and
writes an XML response back to my Shockwave engine. The list returned by
getStreamStatus immediately contains an #error property of 4152. I looked
through the docs, and searched the Tech Notes, but there's no mention of a
4152 error code.

Anyone care to tell me what the code means?

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: XML with unkown amount of children (Follow-up)

2002-01-28 Thread Watson, Christopher

To add, Matt:

The alternative (and actually preferred) method with DOM-Lingo would be to
just create a TreeWalker, with the  element as it's root. Here's all the
code, from parsing to walking:

loParser = new(script "DOM_Parser")
loParser.parseString(lsMyXML)
loDoc = loParser.getDocument()
loB1Elem = loDoc.getElementsByTagName("b1").getItem(0)
loWalker = loDoc.createTreeWalker(loB1Elem, #SHOW_ELEMENT, VOID, TRUE)
loChildNode = loWalker.firstChild()
repeat while not voidP(loChildNode)
  -- work with the child node here
  loChildNode = loWalker.nextSibling()
end repeat

The repeat loop would walk through all the children of the  element
(which is the parent root), and the call the loWalker.nextSibling() would
return VOID when there were no more siblings.

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008


-----Original Message-
From: Watson, Christopher [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 10:21 AM
To: '[EMAIL PROTECTED]'
Subject: RE:  XML with unkown amount of children


Matt,

If you're using the XML Parser Xtra, then every child node in the tree has a
"count" property which will tell you how many children there are for that
node. In your example, you can loop through the children of the  element
node like this:

repeat with i = 1 to parserObj.child[1].child[2].child.count
  loChildElem = parserObj.child[1].child[2].child[i]
  -- work with the child element
end repeat

If you're using DOM-Lingo, it would be:

loChildNodeList =
loDoc.getElementsByTagName("b1").getItem(0).getChildNodes()
repeat with i = 0 to (loChildNodeList.getLength() - 1)
  loChildElem = loChildNodeList.getItem(i)
  -- work with the child element
end repeat
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: XML with unkown amount of children

2002-01-28 Thread Watson, Christopher

Matt,

If you're using the XML Parser Xtra, then every child node in the tree has a
"count" property which will tell you how many children there are for that
node. In your example, you can loop through the children of the  element
node like this:

repeat with i = 1 to parserObj.child[1].child[2].child.count
  loChildElem = parserObj.child[1].child[2].child[i]
  -- work with the child element
end repeat

If you're using DOM-Lingo, it would be:

loChildNodeList =
loDoc.getElementsByTagName("b1").getItem(0).getChildNodes()
repeat with i = 0 to (loChildNodeList.getLength() - 1)
  loChildElem = loChildNodeList.getItem(i)
  -- work with the child element
end repeat

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008


-Original Message-
From: Matthew DeSimone [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 9:24 AM
To: [EMAIL PROTECTED]
Subject:  XML with unkown amount of children


'Lo all,

I was just wondering if there is a Lingo test I can run on an
xml object to determine the number
of children contained within a particular level.  

For instance, if my document look as such:



<1a/>
<1b/>
<1c/>




Is there a function (or a way to find out) the number of
children contained in b1?  Basically
I want to run a repeat loop through all children of a given
node, but that is a little hard
when I do not have a number to end on.  

Thanks in advance for any help.

~matt desimone
[EMAIL PROTECTED]
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: Ancestor Limits?

2002-01-15 Thread Watson, Christopher

Thanks, Kerry. My chain is currently 7 deep, and I, too, am having no
problems at this point. So I guess I won't worry.

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008


-Original Message-
From: Kerry Thompson [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 5:05 PM
To: [EMAIL PROTECTED]
Subject: RE:  Ancestor Limits?


> Are there any limits to number of "generations" you can create in an
> ancestor chain?
> 
I haven't run across any. Some of my objects have an ancestor chain 6 or
7 deep. Granted, that's no where near maxInt, but it is a fairly complex
chain, and I've had no problems. At least not with the ancestor chain
^_^

One bug I found, though--a sprite with two behaviors with a common
ancestor. The ancestor was processing things like stepFram, so the
sprite was processing some events twice.

Cordially,

Kerry Thompson
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Ancestor Limits?

2002-01-14 Thread Watson, Christopher

Are there any limits to number of "generations" you can create in an
ancestor chain?

Christopher Watson
Sr. Software Engingeer
Director/Shockwave Development
Lightspan, Inc.
Tel: 858.824.8457
Fax: 858.824.8008

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]