OpenThought Engine FAQ                                  http://openthought.net
----------------------                                  eric at openthought.net

Q. What is OpenThought?

A. OpenThought is a web application engine. The difference between it and other
applications is that OpenThought never requires you to load a new page. It does
all of it's communication between the browser and the server in the background,
and displays it automatically on the existing page using DHTML. This gives the
look and feel of not just any old web page, but that of a full blown
application. OpenThought allows you to build applications on top of it which
make use of this technology.


Q. What browsers do OpenThought applications work with?

A. OpenThought requires that you use one of the following browsers:

Netscape 4.x, 6.x
Mozilla 0.80+
Internet Explorer 4.x, 5.x, 6.x
Opera 6.x
Konqueror 3.0.0+

If you discover others that work, please let me know.


Q. What language do I use to develop OpenThought Applications with?

A. On the server side, OpenThought's native language is Perl.  Currently, Perl
is the only language you can create OpenThought applications in.

Thats not the end up the story though.  OpenThought has been designed so that
drivers can be written to allow one to access it with another language.
Such drivers include SOAP, XML-RPC, and even Jabber.  This would enable any
language with a SOAP implementation to utilize the OpenThought Framework.
Currently, no such drivers have been written, but several are planned.


Q. That sounds kinda neat.  How does it work?

A. There are components both on the server, and within the browser, that allow
the whole process to work.  However, the part you probably wanted to know is
that OpenThought uses a hidden frame to transfer data to and from the server.


Q. This is hugely cool!  But my back button doesn't always work.  Why is that?

A. Currently, there are some cases where the back button may not do what one
would expect.  The back button is indeed working as the browser thinks it
should, just not as most users would initially expect :-)

The reason for this is in the usage of the hidden frame, as mentioned in the
previous question.  Any time you exchange data with the server, the browser
thinks you have loaded a new page.  So pressing the back button doesn't
necessarily go back one page, it goes back to the last communication with the
server.

I currently don't have a way around this.  On applications I build, I provide
buttons that one can use instead of the browsers back button.  If it really
bothers you, it's pretty simple to open a browser window for the user, which
contains no back button.  But I'm certainly open to suggestions :-)


Q. I followed all the instructions, but when I try to restart Apache, it
silently fails!

A. It appears that you have a problem with XML::Parser and Expat on your
system.  This probably means you have version 2.30 of the parser installed.
Downgrading to 2.29 typically fixes this problem.  See the next question for
more details and other solutions...


Q. Every time I try to connect to OpenThought, Apache segfaults!

A. Thats a known problem with Apache and expat.  Here's the scenerio:

You currently have expat compiled into Apache.  You may not know it, but if
you're getting that error, you do :-)  Now, the latest copy of XML::Parser
makes use of a shared lib version of expat, and requires that you install that
shared lib version in order for XML::Parser to work.  See the problem?  Apache
now sees *TWO* copies of expat... the one compiled into it, and the shared lib.
So, as soon as it gets a request - and sometimes even immediatly after it
starts up, it just segfaults since it has no idea which one to use.

There are two possible fixes for this.  One is to install a slightly older
version of XML::Parser, version 2.29, which does not use this shared lib expat.
If you do choose to install it, you MUST remove the shared lib version of expat
you installed.

The second, and better way of handling this, is simply to recompile Apache.
All you have to do is pass it's configure script the parameter:
  --disable-rule=EXPAT

In fact, all newer version of mod_perl even do this for you!  If you choose the
second method, you can even keep that newer version of XML::Parser on your
system.


Q. I'm getting the error "Bizarre copy of ARRAY in aassign"

A. Thats a known bug in Perl 5.6.0.  It should be fixed in the next release of
Perl.  There is an explanation and patch in this following message from
perl5-porters mailing list:


From: Gurusamy Sarathy <gsar@ActiveState.com>
      To: David Mitchell <davem@fdgroup.co.uk>
      cc: perl5-porters@perl.org">perl5-porters@perl.org
      Date: Thu, 08 Jun 2000 07:04:42 -0700
      Message-Id: <200006081404.HAA04555@molotok.activestate.com>

On Thu, 08 Jun 2000 07:11:47 +0200, Richard Foley wrote:
>The short script below reproduces a core-dump related to
>Perl 5.6.0 and caller() / @DB::args.
>It is small and self-contained. I have included a bare 14 line version,
>followed by a more verbose one.

This happens due to an "optimization" in non-USE_ITHREADS builds that
assumed @_ needn't be cleared at the end of a subroutine call if it's
contents weren't reference counted.  @DB::args breaks that assumption.

Thanks for the test case.


Sarathy
gsar@ActiveState.com
-----------------------------------8<-----------------------------------
Change 6214 by gsar@auger on 2000/06/08 13:57:54

        @_ can't have junk in it even in the non-USE_ITHREADS case because
        caller() wants to populate @DB::args with it (causes a coredump
        in Carp::confess())

Affected files ...

... //depot/perl/cop.h#49 edit
... //depot/perl/t/op/runlevel.t#16 edit

Differences ...

==== //depot/perl/cop.h#49 (text) ====
Index: perl/cop.h
--- perl/cop.h.~1~      Thu Jun  8 06:58:03 2000
+++ perl/cop.h  Thu Jun  8 06:58:03 2000
@@ -106,13 +106,9 @@
     } STMT_END
 #endif /* USE_THREADS */
 
-#ifdef USE_ITHREADS
-   /* junk in @_ spells trouble when cloning CVs, so don't leave any */
-#  define CLEAR_ARGARRAY()     av_clear(cx->blk_sub.argarray)
-#else
-#  define CLEAR_ARGARRAY()     NOOP
-#endif /* USE_ITHREADS */
-
+/* junk in @_ spells trouble when cloning CVs and in pp_caller(), so don't
+ * leave any */
+#define CLEAR_ARGARRAY()       av_clear(cx->blk_sub.argarray)
 
 #define POPSUB(cx,sv)                                                  \
     STMT_START {                                                       \

==== //depot/perl/t/op/runlevel.t#16 (xtext) ====
Index: perl/t/op/runlevel.t
--- perl/t/op/runlevel.t.~1~    Thu Jun  8 06:58:03 2000
+++ perl/t/op/runlevel.t        Thu Jun  8 06:58:03 2000
@@ -349,3 +349,18 @@
 bar
 B 2
 bar
+########
+sub n { 0 }
+sub f { my $x = shift; d(); }
+f(n());
+f();
+
+sub d {
+    my $i = 0; my @a;
+    while (do { { package DB; @a = caller($i++) } } ) {
+        @a = @DB::args;
+        for (@a) { print "$_\n"; $_ = '' }
+    }
+}
+EXPECT
+0
End of Patch.
