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

Weblog Page

Showing 1301 - 1310 of 1561 Postings (summary)

[Xotcl] NX attributes

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

From: Victor Mayevski <vitick_at_gmail.com>
Date: Thu, 20 Jan 2011 15:17:57 -0800

Although it might be something obvious but I cannot think of it at the
moment. How do I delete attributes created with the "attribute"
method?

Re: [Xotcl] proper way to access xotcl classes

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: Thu, 08 May 2008 18:19:09 +0200

Matthew Smith schrieb:
> I copy and pasted what you posted, and still get the error:
> invalid command name "s1"
sorry, my mistake. i did too much cur&paste from your
earlier scripts. The version below should work

-gustaf neumann


===============================

package require XOTcl; namespace import ::xotcl::*

Class Stack
Stack instproc init {} {
  my instvar things
  set things ""
}
Stack instproc push {thing} {
  my instvar things
  set things [concat [list $thing] $things]
  return $thing
}
Stack instproc pop {} {
  my instvar things
  set top [lindex $things 0]
  set things [lrange $things 1 end]
  return $top
}

# using unnamed object
set s1 [Stack new]

$s1 push a
$s1 push b

set x [$s1 pop]
puts "The popped value is $x"

# using named object

Stack s1

s1 push c
s1 push d

set x [s1 pop]
puts "The popped value is $x"

Re: [Xotcl] Asserts off/on

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: Sat, 15 Jul 2006 16:21:31 +0200

Kristoffer Lawson schrieb:
>
> Except that this only works 'afterwards'. So it doesn't actually help,
> as I'd still have to apply it after I create objects etc.
i thought you want to turn on checking for all objects (which means
existing objects).
> when really I just want to turn it on at the top of the application
> and leave it at that.
>
> For the moment I managed this with a filter that is called every time
> an object is initialised, but I would imagine this the kind of thing
> that should be handled elegantly by the XOTcl core?
Why a filter?

in order to turn an checking for objects as you create these, you might
use something like the following:

   Object instmixin [Class new -instproc init args {my check all; next}]

-gustaf
>
>
> / http://www.fishpool.com/~setok/

[Xotcl] Re: [Xotcl] Garbage Collection

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

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Tue, 22 May 2001 23:12:50 +0300 (EEST)

For using garbage collection with handles, also check TclJava. It does
exactly that and only releases the object for it to be collected by Java
when no more references are found to the handle (a string). Apparently
this works, to some extent. Here's a brief description and an explanation
of one of the problems that Feather would actually have solved:

http://tcl.activestate.com/man/java1.2.6/TclJava/JavaGC.html

         - ---------- = = ---------//--+
         | / Kristoffer Lawson | www.fishpool.fi|.com
         +-> | setok_at_fishpool.com | - - --+------
             |-- Fishpool Creations Ltd - / |
             +-------- = - - - = --------- /~setok/

[Xotcl] "BULLET-PROOF" BULK EMAIL WEB HOSTING!

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

From: <BULKWEBHOSTING_at_CYBERNETEMAIL.COM>
Date: Tue, 26 Mar 02 13:23:39 EST

Dear xotcl_at_alice.wu-wien.ac.at,


BULK EMAIL WEB HOSTING...THE ONLY WAY TO GO!

Let the masters of the commercial email industry put their expertise into
the hosting of your web site. And don't let the "Net Bullies" restrict your
right of free speech. Cybernet Marketing's new "Bullet-Proof Web Hosting"
is the answer you've been looking for!!

We believe that there should be little or no restrictions on Internet
communications! This service demonstrates the notion of unlimited,
uncensored, and unrestricted web hosting.

NEVER GET TERMINATED AGAIN FOR ADVERTISING YOUR BUSINESS!


LIMITED TIME PRICING PLAN...

+ One Year "Bullet-Proof Web Hosting" Service ... only $595 (regularly $900)

+ Two Year Service ... only $725

+ Three Year Service ... ONLY $945 (BEST VALUE!)

If you are interested in taking advantage of this great service or to find out
more information visit us at:

http://www.cybernetemail.com/webhosting.htm




Want to be removed from our list?
Simply send an email to us at removes_at_cybernetemail.com and
type "remove" in the "subject" line and you will be removed from any
future mailings.

Cybernet Marketing






 

Re: [Xotcl] troubleshooting

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

From: Victor Mayevski <vitick_at_gmail.com>
Date: Sat, 27 Nov 2010 19:58:23 -0800

Thank you Gustaf.



On Sat, Nov 27, 2010 at 7:24 PM, Gustaf Neumann <neumann_at_wu-wien.ac.at> wrote:
> Rebuild the pkgIndex.tcl files with
>
>   make libraries-pkgindex
>
> Not sure, why and how you got the problem, but i will try to trigger the
> rebuild of these files more eagerly... maybe a pkg_mkIndex failed in your
> version....
>
> i guess, part of the problem is that "pkg_mkIndex" without the flag
> "-verbose" is completely silent also in cases where an "error" occurs (often
> a missing dummy "namespace declaration", just needed for building pkgIndex).
> If pkg_mkIndex is called with "-verbose", it is too verbose... I have now
> altered the behavior pkg_mkIndex in the build process, problems with while
> building pkgIndex will be easy detected.
>
> Get a fresh version from git
>
> -gn
>
> On 28.11.10 00:07, Victor Mayevski wrote:
>>
>> Thank you Gustaf, that fixed the error. There is an additional error:
>>
>> can't find package xotcl::package
>>     while executing
>> "package require xotcl::package"
>>     (file "./library/xotcl/library/lib/makeDoc.xotcl" line 16)
>> make: *** [library/xotcl/doc/langRef-xotcl.html] Error 1
>>
>> The error seems to be caused by missing pkgIndex.tcl file in
>> ./library/xotcl/library/lib/
>>
>>
>> Thanks
>>
>>
>> On Fri, Nov 26, 2010 at 7:48 PM, Victor Mayevski<vitick_at_gmail.com>  wrote:
>>>
>>> Hello Gustaf,
>>>
>>> I have the following problem when trying to compile NX on freshly
>>> installed Linux x86 system against latest TCL 8.6 from SourceForge
>>> CVS.
>>>
>>> ./generic/nsf.c: In function ‘MethodDispatchCsc’:
>>> ./generic/nsf.c:6959: error: too many arguments to function
>>> ‘tclIntStubsPtr->tclNRRunCallbacks’
>>> make: *** [nsf.o] Error 1
>>>
>>>
>>> Thank you
>>>
>
>

[Xotcl] More usage questions

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

From: Laurent Duperval <laurent.duperval_at_netergynet.com>
Date: Mon, 11 Dec 2000 08:19:53 -0500 (EST)

Hi,

How do I do aggregation of objects? For example, in Java I have

class Foo {
  Class1 c1;
  Class2 c2;
}

where Class1 and Class2 are two other classes. How do I create the same
effect in XOTcl? I've tried a few variations but I don't get the effect I
want so I guess I'm doing wrong.

Also, how do you create and use private data? By this I mean data (and
possibly methods) which are only accessible by the class or the object.

Thanks,

L

-- 
MY EMAIL ADDRESS HAS CHANGED --> UPDATE YOUR ADDRESSBOOK
Laurent Duperval                   "Montreal winters are an intelligence test,
Netergy Networks - Java Center            and we who are here have failed it."
Phone: (514) 282-8484 ext. 228                                   -Doug Camilli
mailto:laurent.duperval_at_netergynet.com           Penguin Power!

[Xotcl] google webservice interface in 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: Wed, 23 Mar 2005 20:07:24 +0100

Dear XOTcl Community,

some of you might have a use of the simple Google query API in XOTcl.
enjoy.

-gustaf

###################################################
# Simple Google query interface in XOTcl
# This script submits a SOAP query to the Google
# web service query interface
#
# -gustaf neumann, Jan. 2005
###################################################
package req XOTcl; namespace import -force ::xotcl::*
package req tdom

set LICENSE_KEY <****INSERT_YOUR_LICENCE_KEY_HERE*****>

Class GoogleQuery -parameter {
    {key $::LICENSE_KEY}
    {q "shrdlu winograd maclisp teletype"}
    {start 0}
    {maxResults 10}
    {restrict ""}
    {safeSearch false}
    {lr ""}
    {ie "latin1"}
    {oe "latin1"}
} -set template \
{<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  <SOAP-ENV:Body>
    <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch"
         SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <key xsi:type="xsd:string">[my key]</key>
      <q xsi:type="xsd:string">[my q]</q>
      <start xsi:type="xsd:int">[my start]</start>
      <maxResults xsi:type="xsd:int">[my maxResults]</maxResults>
      <filter xsi:type="xsd:boolean">true</filter>
      <restrict xsi:type="xsd:string">[my restrict]</restrict>
      <safeSearch xsi:type="xsd:boolean">[my safeSearch]</safeSearch>
      <lr xsi:type="xsd:string"[my lr]></lr>
      <ie xsi:type="xsd:string">[my ie]</ie>
      <oe xsi:type="xsd:string">[my oe]</oe>
    </ns1:doGoogleSearch>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>}

GoogleQuery instproc query {} {
    set SOAPmsg [subst [[self class] set template]]
    set S [socket api.google.com 80]
    puts $S "POST /search/beta2 HTTP/1.0"
    puts $S "Host: api.google.com"
    puts $S "Content-Length: [string length $SOAPmsg]"
    puts $S "Content-Type: text/xml"
    puts $S ""
    fconfigure $S -translation binary
    puts -nonewline $S $SOAPmsg
    flush $S
    set result [read $S]
    close $S
    set F [open OUT w]; puts $F $result; close $F
    return [string range $result \
        [expr {[string first \r\n\r\n $result]+4}] end]
}

GoogleQuery instproc init {} {
  set result [my query]
  set doc [dom parse $result]
  set root [$doc documentElement]
  puts "[llength [$root selectNodes //snippet]] snippets found"
  foreach item [$root selectNodes //resultElements/item] {
    Answer new -childof [self] \
    -URL [[$item selectNodes URL] text] \
    -title [[$item selectNodes title] text] \
    -chachedSize [[$item selectNodes cachedSize] text] \
    -snippet [[$item selectNodes snippet] text]
  }
}
Class Answer -parameter {URL title chachedSize snippet}

set G [GoogleQuery new -q xotcl]
foreach a [$G info children] {
  foreach e {URL title chachedSize snippet} {puts "$e: [$a $e]"}
  puts ""
}

Re: [Xotcl] Expand init arguments and custom destructor

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

From: Stefan Sobernig <stefan.sobernig_at_wu.ac.at>
Date: Tue, 08 Feb 2011 09:58:03 +0100

Krzysztof,

> 1. Is it less efficient if I expand a list before providing it as an
> argument for init?
>
> set myList [list 1 2 3 4]
>
> MyClass myObject $myList
>
> vs
>
> eval MyClass myObject $myList

well, it depends on what you want to achieve. Is it just about boxing
the arguments in a list and then, for further processing unboxing it
(e.g., in the init body?). Or are the values treated as a list in
follow-up steps?

the script below sheds some light on various scenarios (you can run it
to reproduce on your machine; timing in microsecs per iteration, 10000
iterations each):

t.001: 26.2 mms, MyClass myObject $myList; set ::out
t.002: 32.6 mms, eval MyClass myObject $myList; set ::out
t.003: 26.9 mms, MyClass myObject 1 2 3 4; set ::out
t.004: 26.0 mms, MyClass myObject {*}$myList; set ::out

from this bird eye perspective (and without knowing the details of your
scenario), you might want to consider avoiding the [eval] overhead by
using the {*} operator in 8.5+ for the boxing case ...

(t.003 is a kind of baseline measurement and appears slightly more
expensive because the values in the argument vector must be turned into
Tcl_Objs first etc., a conversion which has already been achieved if
dealing with a [list] and its values).

> 2. When do I need to create a custom destructor? I create objects inside
> init - do I have to do that in this case, or will those object be
> destroyed automatically when I destroy their parent?
>
> MyClass instproc init args {
>
> my contains {
> MySecondClass innerObject
> }
> }

The deletion of parents cascades. So there is no need for a custom
destructor on a parent to deal with its kids.

//stefan




>
> Best Regards,
> Krzysztof
>
>
>
> _______________________________________________
> Xotcl mailing list
> Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl


-- 
Institute for Information Systems and New Media
Vienna University of Economics and Business
Augasse 2-6, A-1090 Vienna
`- http://nm.wu.ac.at/en/sobernig
`- stefan.sobernig_at_wu.ac.at
`- ss_at_thinkersfoot.net
`- +43-1-31336-4878 [phone]
`- +43-1-31336-746 [fax]

Re: [Xotcl] Sense or non-sense of version-numbers.

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: Wed, 8 Jan 2003 16:42:19 +0100

Just one more comment: if you run Xotcl from its local directory (where
you've compiled it), the auto_path points first to the local xotcl directory
(containing patchlevels).

In any other case, it points only to the installation directories; here, there
is no patchlevel in xotcl's lib directory name (due to Tcl compatibility; Tcl
does not install with the patchlevel).

--uwe




On Wednesday 08 January 2003 16:37, Adrian Wallaschek wrote:
> Hi there!
>
> I do like version numbers, but there is a "too much" in everything.
>
> What is the deeper benefit of having the version number for xotcl
> recursively even inside the source-tree?
>
> What actually happens for me is that now I seem to have problems building
> the code because in 1.0.1
> When running xotcl-1.0.1/xotclsh I do find ..../xotcl-1.0 in the auto_path
> instead of the required/expected .../xotcl-1.0.1.
>
> I haven't yet found out where it goes wrong but it looks like the $VERSION
> doesn't use the revision counter in some Makefile.
>
> The question is: why all this fuzz?
>
> Didn't anybody else see this occurring, did I mess up anything?
>
>
> Regards,
> Adrian Wallaschek
>
> "Just when you think, life can't possible get worse,
> it suddenly does!"
> The Hitchhiker's guide to the galaxy - Douglas Adams
>
> _______________________________________________
> Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl

-- 
Uwe Zdun
Department of Information Systems, Vienna University of Economics
Phone: +43 1 313 36 4796, Fax: +43 1 313 36 746
zdun_at_{xotcl,computer,acm}.org, uwe.zdun_at_wu-wien.ac.at

Next Page