View · Search · Index
No registered users in community xowiki
in last 10 minutes

Weblog Page

Showing 631 - 640 of 1561 Postings (summary)

[Xotcl] "Safe" deserialization

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Scott Gargash <scottg_at_atc.creative.com>
Date: Wed, 26 Jul 2006 09:25:36 -0600

There's been a lot of back-and-forth on the comp.lang.tcl and the Tcl'ers wiki lately about handling
user input safely.

Currently I'm using serialized XOTcl objects as user session data. The data gets saved to a file,
and "source" is used to restore it. It all works well. But since the data is on the filesystem,
it's possible for a user to edit the data or to load an arbitrary file ("Try this session...").

It seems like the standard Tcl answer is to source the session file in a safe interpreter, but (I
think) that means I would need to alias all my XOTcl object constructors into the safe interpreter.
Is this correct? Is there an easy way to do this?

How do others deal with this sort of issue?

      Scott


Notice
The information in this message is confidential and may be legally privileged. It is intended
solely for the addressee. Access to this message by anyone else is unauthorized. If you are not
the intended recipient, any disclosure, copying or distribution of the message, or any action
taken by you in reliance on it, is prohibited and may be unlawful. If you have received this
message in error, please delete it and contact the sender immediately. Thank you.

[Xotcl] Ordering of Children

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Matthew Dodwell <mjd_at_orcaspirit.co.uk>
Date: Wed, 1 Feb 2006 13:18:28 -0000

Hi,

Hopefully a simple question.

I'm building a tree view controller and am seeing an unexpected ordering
issue. I add with;

MemoryLineController instproc init {} {
        my AddNode "File Diagnostics"
        my AddNode "Real time Diagnostics"
        my AddNode "Graphs"
        my AddNode "Post-Processing"
}

MemoryLineController instproc CreateTreeview {} {

        set counter 1
        foreach childNode [my info children *gNode*] {
                $childNode BuildTreeNode [my tree] $counter
                incr counter
        }
}

MemoryLineController instproc AddNode {name} {
    eval GUINode [self]::[my autoname gNode%02d] -DisplayName {$name}
}

So the init method adds my root level nodes
The order I get out is;
        Post-Processing
        File Diagnostics
        Real time Diagnostics
        Graphs
i.e. the last is displayed first and then the next 3 in order. Why is this
and what is the best way to correct it?

thanks
    Matthew

[Xotcl] Missing -nocomplain in [unset]

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Sun, 23 Oct 2005 11:04:31 +0300

Well, the subject says it all. That Tcl option seems to be missing
from the XOTcl equivalent.

            / http://www.fishpool.com/~setok/

[Xotcl] XOTcl 1.2.0 available

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Sun, 22 Feb 2004 00:44:23 +0100

Dear XOTcl Community,

here comes the announcement of XOTcl 1.2.0
all the best

-gustaf neumann
=======================================================

Announcing XOTcl 1.2.0
**********************

WHAT IS XOTCL?

  XOTcl is an object-oriented extension of Tcl that was derived from
  OTcl. In short, XOTcl tries to provide a highly flexible,
  reflective, component-based, and object-oriented environment. It
  integrates language support for high level concepts which are not
  found in other languages, with reasonable performance. It prevails
  the Tcl programming style and the dynamic/introspective nature of
  the language, rather than introducing other language's styles and
  rigidness (such as C++) into Tcl.


CHANGES relative to 1.1.1 are:

  - Qualitative Improvements
     * improved performance (up to more than 30% faster)
     * reduced dependency on Tcl internals (stack rewritings removed)
     * less C-code (code reduction of about 500 lines c code)
     * defined macros to access Tcl's internal structures
     Due to the speedup, an emulation of an itcl like language
     in XOTcl can be faster than itcl itself (see below).

  - Functional Improvements
     * new subcommands of self:
       self callinglevel: returns the scope of the proc/instproc
            calling the current method (ignoring filters and next)
       self activelevel: returns the scope of the proc/instproc
            preceding the current method (might be a next call,
            ignoring filters)
       the returned level can be used in uplevel/upvar as first argument

     * new methods upvar/uplevel
       "my uplevel set x 1" is a short form of "uplevel [self callinglevel]
 set x 1"

     * sub-objects can be called like methods (potential incompatibility)
       If an object named o has a sub-object q (i.e. o::q) it is now
       possible to invoke the sub-object via "o q ?method args?". This change
       makes it possible to

       - to redefine tcl sub-commands via procs/instprocs by defining
         the command with subcommands as an object (instead of defining
         a command as a proc and its subcommands via a large
         and hard-to-refine switch statement)

       - to use the same approach for defining subcommands of subcommands
         (and so on) in the same way; it would be possible to define e.g.
         the xotcl info methods via an object),

       - to use interceptors (filters/mixins) for some or all subcommands
 (maybe you are only interested in "file delete")

       - to extend a tcl command on the fly by defining new subcommands
         (by defining new procs/instprocs)

       - to use the unknown mechanism to produce dynamic error messages
         about valid subcommands (via introspection commands).

       As a simple example, one define the a specialized version of Tcl's
       file-command (say ns::file) like the following:

       namespace eval ns {
         Object file
         file proc tail name {
           set tail [file tail $name]
           regexp {[^/\\]+$} $tail tail
           return $tail
         }
         file proc unknown {subcmd args} {
           return eval ::file $subcmd $args
         }
      }

 For more details, please consult the ChangeLog

MORE INFO
  General and more detailed information about XOTcl and its components
  can be found at http://www.xotcl.org


Best regards,

Gustaf Neumann
Uwe Zdun

#=======================================================================
# extract from the logfile of oobench (in oo-bench.tar.gz,
# see http://media.wu-wien.ac.at/download.html)

XOTcl
  methcall: 0.470u 0.000s 0:00.41 114.6% 0+0k 0+0io 347pf+0w
ITcl emulation in XOTcl
  methcall: 0.590u 0.000s 0:00.62 95.1% 0+0k 0+0io 351pf+0w
itcl
  methcall: 0.870u 0.020s 0:00.92 96.7% 0+0k 0+0io 347pf+0w


#=======================================================================
package require XOTcl; namespace import -force xotcl::*

###########################################################
## Small example to emulate a itcl-like language in XOTcl
## -gustaf neumann Jan. 2004
###########################################################
namespace eval itcl {
  Class create class -superclass Class
  class instproc instvars {} {
    set vars [list]; set c [self]
    for {} {[string compare ::xotcl::Object $c]} {set c [$c info superclass]}
 { eval lappend vars [$c set __autovars]
    }
    return "\n\tmy instvar [lsort -unique $vars]"
  }
  class proc constructor {args} {
    if {[llength $args]==2} {
      foreach {arglist body} $args break
    } else {
      foreach {arglist construct body} $args break
      set body $construct\n$body
    }
    my parameter [list {this [self]}]
    my proc constructor args {uplevel next $args}
    my instproc init $arglist [my instvars]\n$body
  }
  class proc method {name arglist body} {
    my proc $name args {uplevel next $args}
    my instproc $name $arglist [my instvars]\n$body
  }
  class proc inherit {class} {
    my superclass $class
  }
  class proc variable {arglist} {
    foreach v $arglist {my lappend __autovars $v}
  }
  class instproc init {classdef} {
    my set __autovars this
    namespace eval [self class] $classdef
    my class Class
  }
}

###########################################################
# Two Demo classes from oo-bench
###########################################################
itcl::class Toggle {
  variable state
  constructor {start_state} {
    set state $start_state
  }
  method value {} {
    return $state
  }

  method activate {} {
    set state [expr {!$state}]
    return $this
  }
}

itcl::class NthToggle {
  inherit Toggle
  variable count_max
  variable counter
  constructor {start_state max_counter} {
    Toggle::constructor $start_state
  } {
    set count_max $max_counter
    set counter 0
  }
  method activate {} {
    if {[incr counter] >= $count_max} {
      Toggle::activate
      set counter 0
    }
    return $this
  }
}


proc main {} {
  set n [lindex $::argv 0]
  set val 1
  set toggle [Toggle t1 $val]
  for {set i 0} {$i < $n} {incr i} {
    set val [[$toggle activate] value]
  }
  if {$val} {puts "true"} else {puts "false"}

  set val 1
  set ntoggle [NthToggle t2 1 3]
  for {set i 0} {$i < $n} {incr i} {
    set val [[$ntoggle activate] value]
  }
  if {$val} {puts "true"} else {puts "false"}
}

main

--
Univ.Prof. Dr.Gustaf Neumann
Abteilung für Wirtschaftsinformatik
WU-Wien, Augasse 2-6, 1090 Wien
-------------------------------------------------------

Re: [Xotcl] problem compiling xotcl-0.9.4 on Linux

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Catherine Letondal <letondal_at_pasteur.fr>
Date: Sat, 20 Jul 2002 11:11:29 +0200

Hi,

I have successfully installed xotcl 0.9 from the source distribution
(xotcl-full-0.9.4) and the xotclsh et xowish executables work fine.
However, when I try to use the libxotcl0.9.so library, I encounter strange
problems:

LD_LIBRARY_PATH=/usr/local/lib ./mywish
% Object x
invalid command name "Object"
%

although xotcl seems to be loaded:
% set xotcl::version
0.9
%

mywish has been compiled the following way:
gcc -o mywish tkAppInit.o -L/usr/local/lib -lxotcl0.9 -lX11 -lm

(I have removed other librairies for BLT, Tktable, itcl, etc.. extensions I'm using)
The compilation issued no errors.
The makefile for building mywish has worked for several months and I had
no problem with it.

So, I don't know what to do. Do you have any suggestions?
Thanks again in advance,


--
Catherine Letondal -- Pasteur Institute Computing Center

[Xotcl] XOTclIDE version 0.78

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: <mail_at_xdobry.de>
Date: Mon, 08 Aug 2005 17:03:43 +0200

Hi!

New version of XOTclIDE 0.78 is released
http://www.xdobry.de/xotclIDE

News:
1) supports Metakit as version control database.
One can use at once version control system on Tcl Active State intallation
2) more paneled windows (with so called slide-bar or spliter)
3) method changed in current session are marked blue (only with version control)
4) small improvements and bug fixes see CHANGES for more details

XOTclIDE was also presented on 4th Tcl European Conference as
part of presentation under title "making "legacy" Tcl code object oriented.
There are PDF slides available.

Artur Trzewik

[Xotcl] small example: clock.xotcl

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Fri, 23 Mar 2001 20:23:19 +0100

Dear community,
here is a really small example of XOTcl + Tk: a small digital
clock that runs under unix and Win.

best regards
-gustaf
===============================================================================
#!/usr/local/bin/xowish
Class Clock -parameter top
Clock instproc init {} {
  [self] instvar W
  set W [label [[self] set top].[self]]
  pack $W
  [self] tick
}
Clock instproc tick {} {
  [[self] set W] conf -text [clock format [clock seconds] -format %H:%M:%S]
  after 1000 [self] tick
}

Clock c -top .

Re: [Xotcl] Status of the bugs I reported/could people resend their replies to those bugs

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Uwe Zdun <uwe.zdun_at_wu-wien.ac.at>
Date: Fri, 02 Apr 2004 09:39:29 +0200

Hi Jim,

i've received 4 emails during the last couple of days. Sending them to
us or to the mailing list is
fine. I've no clue why the archives
do not seem to work with your emails. I forward this to our sys
admin/try to find out what
wents wrong with the list ...
the issues you raised I need to discuss with Gustaf, especially the aol
server stuff, because
I don't know why it is the way it is (up to now, I personally used AOL
server only seldomly). I way
travelling last week, Gustaf is travelling this week, so we had no
chance to talk. So hang in
there ;)

Regards,

Uwe


Jim Lynch wrote:

>Hi,
>
>Last month I reported three bugs in the configure step of the xotcl
>build process. While I was reporting those bugs and for a few days
>after, I was working on my mail, and so turned off the list's replying
>to me at first.
>
>Is there a different way to report bugs? Could someone tell me the
>status of these bugs? Would anyone like copies of the bug reports
>sent to them?
>
>Anyway, I got my mail working, but I discovered a problem in the
>list as well... During the period I had replies from the list turned
>off, I expected to see all my bug reports in the archive, but each
>time I sent the next bug, I checked the archive, and only my last one
>showed up. To make matters worse, someone else posted to the list
>in March after I did, and his/her message replaced mine.
>
>Could the archive be configured to only accept 5 messages? But if
>that's the case, the behavior of replacing the last message doesn't
>make much sense. Could there be a bug in the software? Maybe the
>HD where the archives are kept is out of space?
>
>If anyone replied to my reports, could you resend the replies just
>to me, at jim_at_jam.sessionsnet.com?
>
>-Jim
>
>--
>Jam sessions community web site: http://jam.sessionsnet.org
>_______________________________________________
>Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
>http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>
>

[Xotcl] Re: [Xotcl] knowing who is called "next"

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <Gustaf.Neumann_at_wu-wien.ac.at>
Date: Fri, 19 Jan 2001 21:41:03 +0100 (CET)

>>>>> "CL" == Catherine Letondal <letondal_at_pasteur.fr> writes:

CL> Hi,

CL> Most of the time, I know what is going to be called when I peut a next
CL> statement :
CL> - the class instproc method if from a proc
CL> - the mixin method if any
CL> - the superclass method
CL> etc..

CL> My question is the following: I have sometimes the instproc
CL> redefined at the instance level with a proc: this is to enable the
CL> user to experiment a method on a given object without breaking all
CL> the application (this is actually one the main reason for me to
CL> use Xotcl). It's also a debug feature for more experimented
CL> developpers.

CL> However, I have the "next" problem in such case: it's the instproc
CL> level which is called instead of either the mixin or superclass
CL> method.

 Dear Catherine,

 why not letting the user to define mixin for the experimentation?
 you can still define other mixins/instmixins/etc. for your "own"
 purposes.
  
 what you seem to want is to change the onion shells of the next path

      filters mixins instmixins proc instprocs

 to something else, preferably starting with proc. note, that the
 onion shells are not atomic (with the exception of proc), but can
 be quite complicated (e.g. registering multiple cascaded filters),
 so simply "jumping" to a certain method of a certain Class won't let
 you to call there the "appropriate" method via next. changing or
 altering the order on the fly can lead to programs that are very hard
 to comprehend.

 We could implement a [[self] info next] or better a [self next] for
 introspection purposes (somewhat a generalization of "info
 calledproc"), but i am afraid, that this won't help you.

 best regards
-gustaf

CL> Is there any way either:
CL> - to ask by introspection who is going to be called -
CL> e.g something like:
CL> [[self] info next methodname]
CL> - to enforce it:
CL> classname next

CL> I know the procsearch command, but it doesn't take a "next"
CL> argument!? I have tried :
CL> puts "procsearch: [[self] procsearch next]"
CL> which gives this output:
CL> procsearch: ::buttondata0::next
CL> (buttondata0 is an instance for which a proc has been defined)
CL> ::buttondata0 proc

CL> I don't see any solutions with 'info called/calling' features either?

CL> Many thanks!

CL> --
CL> Catherine Letondal -- Pasteur Institute Computing Center

CL> _______________________________________________
CL> Xotcl mailing list - Xotcl_at_wi.wu-wien.ac.at
CL> http://wi.wu-wien.ac.at/mailman/listinfo/xotcl

[Xotcl] forwarding

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Victor Mayevski <vitick_at_gmail.com>
Date: Tue, 10 Jan 2012 19:06:30 -0800

Is it possible to do a forward in the following manner:

     obj public forward link %self::child-obj

The best I could do was:

     obj public forward link :child-obj

which I have to call in the following way:
     [obj link] mymethod

Also, I don't even know why it works that way, because I think it
should work this way:
     obj public forward link -objframe :child-obj
but that does not work.

Thanks

Next Page