Wade Humeniuk | 1 May 2003 01:50

Re: Announcement: The regex coach

| 
| I think it is a halfway decent showcase for what you can do with
| CAPI. (I haven't found any downloadable examples online except for
| Wade Humeniuk's "Runner's Log".)

Thanks Edi,

You can see the Runner's Log Manual at

http://www3.telus.net/public/whumeniu/Manual.html

complete with screenshots.  LWW 4.1 and CAPI app.  The Runner's
Log is free and has been downloaded about 3000 times so far.

Self installing windows exe at

http://www3.telus.net/public/whumeniu/runnerslog-140.exe

(1.62 MB)

Wade

softinfo | 1 May 2003 14:49
Picon

FLI question

Hello,

is it possible to specify somehow the initial contents for a FLI structure as 
in the example :

(fli:define-c-struct POS
  (x :int)
  (y :int)
  (z :int))

(setq my-pos (fli:allocate-foreign-object :type 'POS :inital-contents ?????))

Thanks and with best regards

softinfo | 1 May 2003 16:18
Picon

Question about FLI:WITH-DYNAMIC-FOREIGN-OBJECTS


Hello,

If I have the following definitions :

(fli:define-c-struct (mt-timestamp (:foreign-name "xxx"))
                     (year mt-short)
                     (month mt-short)
                     (day mt-short)
                     (hour mt-short)
                     (minute mt-short)
                     (second mt-short)
                     (microsecs mt-integer))
(fli:define-c-typedef (mt-timestamp (:foreign-name "xxx"))
                      (:struct mt-timestamp))

(defclass mh-timestamp ()
  ((fs :initform (let ((fs (fli:allocate-dynamic-foreign-object :type 'mt-
timestamp)))
                   (setf (fli:foreign-slot-value fs 'microsecs) 0)
                   (setf (fli:foreign-slot-value fs 'second) 0)
                   (setf (fli:foreign-slot-value fs 'minute) 0)
                   (setf (fli:foreign-slot-value fs 'hour) 0)
                   (setf (fli:foreign-slot-value fs 'day) 1)
                   (setf (fli:foreign-slot-value fs 'month) 1)
                   (setf (fli:foreign-slot-value fs 'year) 2003)
                   fs
                   )
))
)
(Continue reading)

Miro Casanova | 2 May 2003 10:22
Picon
Favicon

KW objects


Hi all,

I've been working with kw-objects and I've got a little problem. I have 
an object of a given class that contains some instance variables with 
list with other objects (these are the kw-objects). The idea is to send 
only 1 object to file for "saving an image" of my program. When I load 
this "image" I can see the first object and inspect its instance 
variables to look at the other objects. Nevertheless, when I query for 
objects in the kw-listener (or in the objects inspector) I get no 
result. I mean, the objects exist (because I can see them by inspecting 
the "root" object I've saved) but I cannot see them when querying with 
kw! anyone has an idea of what's happening?

thanks,
Miro Casanova

Jason Trenouth | 2 May 2003 11:21
Favicon

Re: KW objects

>>>>> On Fri, 02 May 2003 10:22:32 +0200, Miro Casanova <mcasanov <at> vub.ac.be> said:

    Miro> Hi all,

    Miro> I've been working with kw-objects and I've got a little problem. I
    Miro> have an object of a given class that contains some instance variables
    Miro> with list with other objects (these are the kw-objects). The idea is
    Miro> to send only 1 object to file for "saving an image" of my
    Miro> program. When I load this "image" I can see the first object and
    Miro> inspect its instance variables to look at the other
    Miro> objects. Nevertheless, when I query for objects in the kw-listener (or
    Miro> in the objects inspector) I get no result. I mean, the objects exist
    Miro> (because I can see them by inspecting the "root" object I've saved)
    Miro> but I cannot see them when querying with kw! anyone has an idea of
    Miro> what's happening?

You have to explain how you save and load your objects. KW's internal
RETE network needs to be told about KW objects. Usually it notices
them by watching MAKE-INSTANCE (I think) so maybe you are loading them
in some other way?

__Jason

Miro Casanova | 2 May 2003 12:24
Picon
Favicon

Re: KW objects


Hi,

This is the code (summarized).

(defclass library-container ()
   ((struct-root :accessor struct-root :initform '()))

the struct-root:

(kw:def-kb-class structure-root ()
   ((dimensions :accessor dimensions :initform '())))

the dimension objects:

(kw:def-kb-class dimension ()
   ((name :accessor name :initform "")
    (facets :accessor facets :initform '())))

and the facets objects:

(kw:def-kb-class facet ()
   ((name :accessor name :initform ""))

This is the way I save the image:
->first, I have a global variable:

(defparameter *library-pool-instance* (make-instance 'library-container))

->second, I save like this:
(Continue reading)

Jason Trenouth | 2 May 2003 14:10
Favicon

Re: KW objects

>>>>> On Fri, 02 May 2003 12:24:05 +0200, Miro Casanova <mcasanov <at> vub.ac.be> said:

    Miro> Hi,

    Miro> This is the code (summarized).

    Miro> (defclass library-container ()
    Miro>    ((struct-root :accessor struct-root :initform '()))

    Miro> the struct-root:

    Miro> (kw:def-kb-class structure-root ()
    Miro>    ((dimensions :accessor dimensions :initform '())))

    Miro> the dimension objects:

    Miro> (kw:def-kb-class dimension ()
    Miro>    ((name :accessor name :initform "")
    Miro>     (facets :accessor facets :initform '())))

    Miro> and the facets objects:

    Miro> (kw:def-kb-class facet ()
    Miro>    ((name :accessor name :initform ""))

    Miro> This is the way I save the image:
    -> first, I have a global variable:

    Miro> (defparameter *library-pool-instance* (make-instance 'library-container))

(Continue reading)

Miro Casanova | 2 May 2003 14:21
Picon
Favicon

Re: KW objects


> 
> Hi,
> 
> Hmmm. Sounds like KW objects are serialized and deserialized in a way
> that does not trigger KW mechanism for noticing them because it uses
> internal instance creation mechanisms and doesn't go through
> MAKE-INSTANCE. 
> 
> I can't remember if there is an exported function for notifying KW
> about an instance, but in the absence of that you may have to write
> methods on MAKE-LOAD-FORM (see standard) for your DIMENSION class so
> that you control how the instances are recreated.

Hi,
I do have make-load-form methods

(defmethod make-load-form ((self dimension) &optional environment)
   (make-load-form-saving-slots self))

(also for facet, structure-root, and library-container, always with the 
same body).
I expected that by loading the objects they would be also put in the KW 
"memory".

Miro.

> 
> What you actually want to happen may depend on the application.  But
> it is arguable that KW ought to do the "natural" thing itself and have
(Continue reading)

Jason Trenouth | 2 May 2003 15:31
Favicon

Re: KW objects

>>>>> On Fri, 02 May 2003 14:21:23 +0200, Miro Casanova <mcasanov <at> vub.ac.be> said:

    >> Hi,
    >> Hmmm. Sounds like KW objects are serialized and deserialized in a way
    >> that does not trigger KW mechanism for noticing them because it uses
    >> internal instance creation mechanisms and doesn't go through
    >> MAKE-INSTANCE. I can't remember if there is an exported function for
    >> notifying KW
    >> about an instance, but in the absence of that you may have to write
    >> methods on MAKE-LOAD-FORM (see standard) for your DIMENSION class so
    >> that you control how the instances are recreated.

    Miro> Hi,
    Miro> I do have make-load-form methods

    Miro> (defmethod make-load-form ((self dimension) &optional environment)
    Miro>    (make-load-form-saving-slots self))

    Miro> (also for facet, structure-root, and library-container, always with
    Miro> the same body).
    Miro> I expected that by loading the objects they would be also put in the
    Miro> KW "memory".

Try taking them out and see if KW has any that DTRT.

__Jason

Miro Casanova | 2 May 2003 16:25
Picon
Favicon

Re: KW objects


I tried this:

(defmethod make-load-form ((self dimension) &optional environment)
   (values
     `(make-instance ',(class-of self))
     `(progn
        (setf (name ',self) ',(slot-value self 'name))
        (setf (facets ',self) ',(slot-value self 'facets))
        (setf (docs ',self) ',(slot-value self 'docs))
        (setf (basic-clusters ',self) ',(slot-value self 'basic-clusters))
        (setf (root ',self) ',(slot-value self 'root)))))

instead of the :  (make-load-form-saving-slots self)

and it works! which it is quite strange....
I expected the make-load-form-saving-slots to do the same!

Miro

Jason Trenouth wrote:
>>>>>>On Fri, 02 May 2003 14:21:23 +0200, Miro Casanova <mcasanov <at> vub.ac.be> said:
> 
> 
>     >> Hi,
>     >> Hmmm. Sounds like KW objects are serialized and deserialized in a way
>     >> that does not trigger KW mechanism for noticing them because it uses
>     >> internal instance creation mechanisms and doesn't go through
>     >> MAKE-INSTANCE. I can't remember if there is an exported function for
>     >> notifying KW
(Continue reading)


Gmane