Re: MacTech Programmer's Challenge

2001-08-19 Thread Scott Raney

On Sat, 18 Aug 2001 Geoff Canyon [EMAIL PROTECTED] wrote:

 From the web page at: http://www.mactech.com/progchallenge/2001_09_Challenge.html
  The basic requirement is that you open a text file containing
 valid C/C++ source code and generate a Nassi-Schneiderman diagram
 for each routine included in that file.
 It's frustrating that they aren't offering sample files. One thing
 that will definitely be needed is regex patterns to recognize C and
 C++ source code. I'm looking online for this right now, but haven't
 found anything yet. If anyone knows where such a beast exists, or
 better yet has already done C/C++ pattern matching in MC/Rev, that
 would help.

I think you probably don't want to use regex for this.  It isn't
necessary and will probably just make parsing the file harder and
slower.  Instead, keep in mind that spaces and returns aren't
significant in C and that the primary delimiter is the semicolon (in
fact, you might want to just convert all the returns to spaces as the
very first step to make building the labels easier because you don't
have to worry about handling statements that break over multiple
lines, or multiple statements on a single line, though the problem
description isn't specific about whether this sort of reformatting is
allowed or required).  This means the main loop should probably be
something like:
set the itemDelimiter to ;
repeat for each item i in yourcontainer

Then, switch of word 1 of i to see if it's one of the language
keywords.  Dealing with for is a little tricky because you'll have
to set a flag to collect two more items into a container and then do
some hand-coded parsing of the last one (the stuff before the closing
) goes with the for and the stuff after goes with the next
statement.  If you really want to get fancy (probably not necessary
for this Challenge), use repeat for each token to separate out each
operator, MetaTalk being similar enough to C that that will do most of
the work for you.  This would be a lot more work, though, because
you'll have to build something that has a lot better understanding of
the C language than if you just use the semicolon as a delimiter.

 Also, I think this description is vague:
  You must provide a means for the user to select a section of the
 diagram, or click on a section of interest, and zoom in on that
 section. The zoomed-in display should increase the level of detail
 displayed, until no further increase in detail is possible.
  Does that mean that higher levels of the diagram go away, or is it
 more like the zoom feature on the dock in OS X, where everything is
 visible all the time, but whatever has the focus is expanded to the
 detriment of others?

Seems to me it could go either way.  But if zoom excludes other stuff,
you're going to have to add some sort of unzoom feature that brings
it back.  It might be sufficient to just show a single line in each of
the code blocks and have zoom just mean to expand a block so that
you can see all of the text in it (kind of like a progressive
disclosure/tree view, except that you raise the expanded object *on
top* of the other objects rather than pushing them all down, which
would be nice but would also be a nightmare to lay out with a deeply
nested diagram).  Clicking on the object again would unzoom it back to
it's previous size.

I also don't think much of their idea of squashing the diagram down to
fit in whatever the window size is.  Seem to me you'll just end up
with a solid black figure in the degenerate case.  Better would be to
put a lower limit on the size and then add scrollbars if it won't fit
in the window.

If nothing else, we can all get one take-home message here: trying to
set requirement specs in the absence of a working prototype (the
hallmark of design with traditional CASE (Computer Aided Software
Engineering) methodologies) is a recipe for disaster, which of course
is the reason CASE became a dirty word among software developers and
why high-level tools are becoming so popular.
  Regards,
Scott

 regards,
 
 Geoff


Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


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: MacTech Programmer's Challenge

2001-08-18 Thread Scott Raney

On Sat, 18 Aug 2001 David Bovill [EMAIL PROTECTED] wrote:
 
 I'm sort of working on something like this at the moment - which brings up
 the problem I'm having creating flow diagrams...
 
 I want to be able to position groups - and it would be so much easier if I
 could use the pointer tool to do this and still trap for messages like
 mouseMove or whatever - but the only thing I can trap seems to be
 selectedObjectChanged (apart from the mysteries of the control key menus)...
 
 I guess I can simulate it, and simulate the move and resize handles but I
 wish that I could still have messages in paint and pointer/selection tool
 modes
 
 Any tricks I am missing?

The messages you want *are* sent when you have the pointer tool,
they're just swallowed by the main development-environment front
script.  You'll need to either remove that while testing, or put your
own script in front of that with insert script.  The messages aren't
sent when you have a paint tool in 2.3.X, but are in 2.4. You can get
the final beta of that in the directory:
ftp://ftp.metacard.com/MetaCard/2.4/
  Regards,
Scott


Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


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: MacTech Programmer's Challenge

2001-08-18 Thread David Bovill

Way cool!

 From: Scott Raney [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Sat, 18 Aug 2001 20:04:58 -0600 (MDT)
 To: [EMAIL PROTECTED]
 Subject: Re: MacTech Programmer's Challenge
 
 The messages you want *are* sent when you have the pointer tool,
 they're just swallowed by the main development-environment front
 script.  You'll need to either remove that while testing, or put your
 own script in front of that with insert script.  The messages aren't
 sent when you have a paint tool in 2.3.X, but are in 2.4. You can get
 the final beta of that in the directory:
 ftp://ftp.metacard.com/MetaCard/2.4/
 Regards,
 Scott

NB - how come these email lists turn us all into Americains - I'd never say
*that* over here -:)


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.




MacTech Programmer's Challenge

2001-08-17 Thread Scott Raney


MacTech Magazine has announced that their September Programmer's
Challenge will be an open language competition, which means for the
first time MetaCard and Revolution developers have a decent shot at
winning the prize:
http://www.mactech.com/progchallenge/2001_09_Challenge.html

A quick search on Google.com turned up quite a few examples of the
kinds of diagrams they're talking about.  For example:
http://www.open.org/~prslkg/sy_chap.htm

I encourage everyone to at least take a look at the challenge
description and if the spirit moves you, prepare an entry.  Doesn't
look like it would be too hard to make something like this using
graphic objects with labels.  Note that you can put multiple lines in
the label property and that you can position the label as needed using
the margin and textAlign properties.  Put them all in a scrolling
group sized to fit the window.  Zoom will be a little trickier since
it's not built in, but the math required to reset the rect or points
properties of the graphics is pretty straightforward.  Note that they
also only allow two weeks, which means that you probably won't be
competing with a whole bunch of slick C/C++ entries ;-)

If you need any motivation or assistance, don't hesitate to contact
me.
  Regards,
Scott


Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...



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: MacTech Programmer's Challenge

2001-08-17 Thread David Bovill

I'm sort of working on something like this at the moment - which brings up
the problem I'm having creating flow diagrams...

I want to be able to position groups - and it would be so much easier if I
could use the pointer tool to do this and still trap for messages like
mouseMove or whatever - but the only thing I can trap seems to be
selectedObjectChanged (apart from the mysteries of the control key menus)...

I guess I can simulate it, and simulate the move and resize handles but I
wish that I could still have messages in paint and pointer/selection tool
modes

Any tricks I am missing?


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.