f



Fedora Linux and Tcl/Tk problems

I have been chasing a problem for the last couple of days which
appears to only happen on Fedora Linux 7 (or 9) but not on other Linux
distros like Mepis or Knoppix.

I've enclosed a code snip from the code which breaks.

The relevant sections are annoted with <bob></bob> but the essense is
that when writing a binary string using

puts -nonewline $fileID $msg

to write to a file the result is corrupted even though the length of
msg and at least one of the fields in the middle of msg is correct
immediately before ... but only on Fedora.

Any ideas?   Thanks in advance.

bob


============== begin code snip ================
#!/usr/bin/tclsh
<snip>

#=============================================
#	doReceive - entry point
#
# This function will be kicked when a SIMPL
# message is received
#=============================================
proc doReceive {} {
set fn doReceive

set buf [Receive]

binary scan $buf i1i1 fromWhom nbytes
binary scan $buf x8a$nbytes msg

puts stdout [ format "nbytes=%d" $nbytes ]
puts stdout [ format "len=%d" [ string length $msg ] ]
binary scan $msg x8i1 seq
puts stdout [ format "seq=%d" $seq ]

<bob>
The sequence is correct here.
</bob>

hndlMsg $fromWhom $msg $nbytes

};# end doReceive

#=============================================
# 	hndlMsg - entry point
#
# This function handles the incoming SIMPL
# message
#=============================================
proc hndlMsg {fromWhom msg nbytes} {
set fn hndlMsg
global FILEMGR_TOKEN
global gatewaySocket
global app
global this
global loggerID
global TRACE_MASK
global logMask

binary scan $msg s1 token

logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $logMask \
	[format "token=0x%X" $token]
#========================================
#  START_LOGGER
#========================================
if { $token == $FILEMGR_TOKEN(START_LOGGING) } {
	binary scan $msg x2A* filepath

logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $logMask \
	[format "START LOGGER filepath=<%s>" $filepath]

	set filename [createFileName $filepath]

	set app(state) FILEMGR_RUNNING

	openLog $filename

	if { $app(agentPending) != "NULL" } {
		set rMsg    [binary format "s1x2i1i1" \
			$FILEMGR_TOKEN(AGENT_WHAT_YA_GOT) \
			$app(agentType) \
			$app(agentIDX)]
		set rBytes  [string length $rMsg]
		Reply $app(agentPending) $rMsg $rBytes
		set app(agentPending) NULL

#		announceStartup
	}

	Reply $fromWhom NULL 0
} else {
#========================================
#   STOP_LOGGER
#========================================
if { $token == $FILEMGR_TOKEN(STOP_LOGGING) } {
	close $app(fileID)
	set app(state) FILEMGR_HALTED
	Reply $fromWhom NULL 0

#	announceHalt
} else {
#========================================
#   AGENT_WHAT_YA_GOT
#========================================
if { $token == $FILEMGR_TOKEN(AGENT_WHAT_YA_GOT) } {
	binary scan $msg x4i1i1 app(agentType) app(agentIDX)
	set app(agentPending) $fromWhom
	vc_send_ack $gatewaySocket

logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $logMask \
	[format "agentIDX=%d type=%d" $app(agentIDX) $app(agentType)]
#puts stdout [format "agentIDX=%d type=%d" $app(agentIDX) $app
(agentType)]

} else {
#========================================
#   A2D_DATA
#========================================
if { $token == $FILEMGR_TOKEN(A2D_DATA) } {

	if { $app(state) == "FILEMGR_RUNNING" } {
puts stdout [ format "len=%d" [ string length $msg ] ]
binary scan $msg x8i1 seq
puts stdout [ format "seq=%d" $seq ]

<bob>
The sequence is still correct here.
</bob>

		puts -nonewline $app(fileID) $msg
		flush $app(fileID)

<bob>
The sequence is corrupt in the file which results.
</bob>

		set rMsg    [binary format "s1x2i1i1" \
			$FILEMGR_TOKEN(AGENT_WHAT_YA_GOT) \
			$app(agentType) \
			$app(agentIDX)]
		set rBytes  [string length $rMsg]
		Reply $fromWhom $rMsg $rBytes
	} else {
		set app(agentPending) $fromWhom
		vc_send_ack $gatewaySocket
	}

} else {
#========================================
#   default
#========================================
	Reply $fromWhom NULL 0

};#end A2D_DATA
};#end WHAT_YA_GOT
};#end STOP_LOGGER
};#end START_LOGGER

};#end hndlMsg

<snip>

========== end code snip =============
0
icanbob (63)
7/22/2009 4:15:20 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

8 Replies
618 Views

Similar Articles

[PageSpeed] 2

bobicanprogram wrote:
> The relevant sections are annoted with <bob></bob> but the essense is
> that when writing a binary string using
> 
> puts -nonewline $fileID $msg
> 
> to write to a file the result is corrupted even though the length of
> msg and at least one of the fields in the middle of msg is correct
> immediately before ... but only on Fedora.

Your code excerpt is exasperatingly both too long and detailed,
obscuring the issue at hand, but also incomplete.

What is the nature of the "corruption" ?

How does the variable ::app(fileID) get its value?  I assume
there's some [open] somewhere in the code not shown here.
After that value is set, what config settings are made to the
channel?

I suspect issues with either translation or encoding, but
can only guess with what you've offered plus a reasonable
level of effort.

-- 
| Don Porter          Mathematical and Computational Sciences Division |
| donald.porter@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|
0
dgp2341 (685)
7/22/2009 4:23:47 PM
On Jul 22, 12:15 pm, bobicanprogram <ican...@gmail.com> wrote:
> I have been chasing a problem for the last couple of days which
> appears to only happen on Fedora Linux 7 (or 9) but not on other Linux
> distros like Mepis or Knoppix.
>
> I've enclosed a code snip from the code which breaks.
>
> The relevant sections are annoted with <bob></bob> but the essense is
> that when writing a binary string using
>
> puts -nonewline $fileID $msg
>
> to write to a file the result is corrupted even though the length of
> msg and at least one of the fields in the middle of msg is correct
> immediately before ... but only on Fedora.
>
> Any ideas?   Thanks in advance.
>
> bob
>
> ============== begin code snip ================
> #!/usr/bin/tclsh
> <snip>
>
> #=============================================
> #       doReceive - entry point
> #
> # This function will be kicked when a SIMPL
> # message is received
> #=============================================
> proc doReceive {} {
> set fn doReceive
>
> set buf [Receive]
>
> binary scan $buf i1i1 fromWhom nbytes
> binary scan $buf x8a$nbytes msg
>
> puts stdout [ format "nbytes=%d" $nbytes ]
> puts stdout [ format "len=%d" [ string length $msg ] ]
> binary scan $msg x8i1 seq
> puts stdout [ format "seq=%d" $seq ]
>
> <bob>
> The sequence is correct here.
> </bob>
>
> hndlMsg $fromWhom $msg $nbytes
>
> };# end doReceive
>
> #=============================================
> #       hndlMsg - entry point
> #
> # This function handles the incoming SIMPL
> # message
> #=============================================
> proc hndlMsg {fromWhom msg nbytes} {
> set fn hndlMsg
> global FILEMGR_TOKEN
> global gatewaySocket
> global app
> global this
> global loggerID
> global TRACE_MASK
> global logMask
>
> binary scan $msg s1 token
>
> logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $logMask \
>         [format "token=0x%X" $token]
> #========================================
> #  START_LOGGER
> #========================================
> if { $token == $FILEMGR_TOKEN(START_LOGGING) } {
>         binary scan $msg x2A* filepath
>
> logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $logMask \
>         [format "START LOGGER filepath=<%s>" $filepath]
>
>         set filename [createFileName $filepath]
>
>         set app(state) FILEMGR_RUNNING
>
>         openLog $filename
>
>         if { $app(agentPending) != "NULL" } {
>                 set rMsg    [binary format "s1x2i1i1" \
>                         $FILEMGR_TOKEN(AGENT_WHAT_YA_GOT) \
>                         $app(agentType) \
>                         $app(agentIDX)]
>                 set rBytes  [string length $rMsg]
>                 Reply $app(agentPending) $rMsg $rBytes
>                 set app(agentPending) NULL
>
> #               announceStartup
>         }
>
>         Reply $fromWhom NULL 0} else {
>
> #========================================
> #   STOP_LOGGER
> #========================================
> if { $token == $FILEMGR_TOKEN(STOP_LOGGING) } {
>         close $app(fileID)
>         set app(state) FILEMGR_HALTED
>         Reply $fromWhom NULL 0
>
> #       announceHalt} else {
>
> #========================================
> #   AGENT_WHAT_YA_GOT
> #========================================
> if { $token == $FILEMGR_TOKEN(AGENT_WHAT_YA_GOT) } {
>         binary scan $msg x4i1i1 app(agentType) app(agentIDX)
>         set app(agentPending) $fromWhom
>         vc_send_ack $gatewaySocket
>
> logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $logMask \
>         [format "agentIDX=%d type=%d" $app(agentIDX) $app(agentType)]
> #puts stdout [format "agentIDX=%d type=%d" $app(agentIDX) $app
> (agentType)]
>
> } else {
>
> #========================================
> #   A2D_DATA
> #========================================
> if { $token == $FILEMGR_TOKEN(A2D_DATA) } {
>
>         if { $app(state) == "FILEMGR_RUNNING" } {
> puts stdout [ format "len=%d" [ string length $msg ] ]
> binary scan $msg x8i1 seq
> puts stdout [ format "seq=%d" $seq ]
>
> <bob>
> The sequence is still correct here.
> </bob>
>
>                 puts -nonewline $app(fileID) $msg
>                 flush $app(fileID)
>
> <bob>
> The sequence is corrupt in the file which results.
> </bob>
>
>                 set rMsg    [binary format "s1x2i1i1" \
>                         $FILEMGR_TOKEN(AGENT_WHAT_YA_GOT) \
>                         $app(agentType) \
>                         $app(agentIDX)]
>                 set rBytes  [string length $rMsg]
>                 Reply $fromWhom $rMsg $rBytes
>         } else {
>                 set app(agentPending) $fromWhom
>                 vc_send_ack $gatewaySocket
>         }
>
> } else {
>
> #========================================
> #   default
> #========================================
>         Reply $fromWhom NULL 0
>
> };#end A2D_DATA
> };#end WHAT_YA_GOT
> };#end STOP_LOGGER
> };#end START_LOGGER
> };#end hndlMsg
>
> <snip>
>
> ========== end code snip =============


Oh and I forgot to mention.    This little diddy below works in all
flavors of Linux.   Go figure.

bob

============= begin snip =======================
#!/usr/bin/tclsh

set one 0x41
set two 0x4042

set buf  [binary format "s1x2i1" \
			$one \
			$two ]

if [ catch {open  /tmp/john w} fileID ] {
	puts stdout error
}

puts -nonewline $fileID $buf
flush $fileID

close $fileID

exit

============== end snip ==================

0
icanbob (63)
7/22/2009 4:25:00 PM
On Jul 22, 12:23 pm, Don Porter <d...@nist.gov> wrote:
> bobicanprogram wrote:
> > The relevant sections are annoted with <bob></bob> but the essense is
> > that when writing a binary string using
>
> > puts -nonewline $fileID $msg
>
> > to write to a file the result is corrupted even though the length of
> > msg and at least one of the fields in the middle of msg is correct
> > immediately before ... but only on Fedora.
>
> Your code excerpt is exasperatingly both too long and detailed,
> obscuring the issue at hand, but also incomplete.
>
> What is the nature of the "corruption" ?
>
> How does the variable ::app(fileID) get its value?  I assume
> there's some [open] somewhere in the code not shown here.
> After that value is set, what config settings are made to the
> channel?
>
> I suspect issues with either translation or encoding, but
> can only guess with what you've offered plus a reasonable
> level of effort.
>
> --
> | Don Porter          Mathematical and Computational Sciences Division |
> | donald.por...@nist.gov             Information Technology Laboratory |
> |http://math.nist.gov/~DPorter/                                 NIST |
> |______________________________________________________________________|

I apologize for the incomplete nature of the code snip.   It is part
of a fairly complex program.

Here is the code snip for where the open is done

================ begin snip ==============
#=======================================
# openLog - entry point
#=======================================
proc openLog { filename } {
set fn "openLog"
global f
global FILEMGR_TOKEN
global TRACE_MASK
global app
global this
global loggerID
global logMask

logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $logMask [format
"filename=%s" $filename]

if [catch {open $filename w} app(fileID)] {
	logit $loggerID $this $fn $TRACE_MASK(TRACE_MISC) $TRACE_MASK
(TRACE_MISC) \
		[format "cannot create filename=%s" $filename]
} ;# end if open

} ;# end of openLog
================ end snip ================

To my knowledge nothing is done to app(fileID) after that until the
close.    The fact that the Fedora runs actually create a file is a
powerful indication that app(fileID) is not corrupted in some way.
The contents in the Fedora generated files is corrupted,  however.

When identical code (verified by cksum) is run on Knoppix or Mepis
Linux a file is written which contains the correct binary data.
When same code is run on Fedora 7 or Fedora 9 a file is still written
(hence the fileID is correct) but the data is jumbled hopelessly.  (I
could get you od -x images of the two files if that would help).
This is despite the debug statements immediately ahead of the puts
which show that "msg" is the correct length (276) and that the "seq"
field offset 8 bytes into that "msg" is also correct.

In a typical run the sequence is:

file open
puts msg
puts msg
....
file close

Verify file by either a custom utility written in C to dump contents
or by straight "od -x"

My extensive debugging has narrowed the problem to the "puts" command
itself ... but only on Fedora.

bob
PS.
The structure associated with the "msg" originates from a C program
using this definition:

typedef struct
	{
	UINT16 token; 	//A2D_DATA
	int agentIDX;
	unsigned long intrCounter;
	int sec;
	int usec;
	INT16 data[8][16];
	}A2D_DATA_MSG;

where UINT16 is unsigned short and INT16 is short.

PS2.
The "seq" in my debug statement is accessing the "intrCounter" field.

0
icanbob (63)
7/22/2009 4:42:38 PM
bobicanprogram wrote:
> Oh and I forgot to mention.    This little diddy below works in all
> flavors of Linux.   Go figure.

This is a much better example program, pared down to the
parts that matter.

I am assuming the successful end state you seek is a file
named /tmp/john that is 8 bytes long with the values

     0x41 0x00 0x00 0x00 0x42 0x40 0x00 0x00

stored in it.  (Really helps to state these things explicitly.)

The program below actually will not reliably do that in
all environments, because you have not controlled
translation and encoding configuration on the $fileID
channel.  It will fail even in common environments if
the values of $one and $two are permitted to have other
values, such as 0xA3 .

Since you are writing binary data, your case is handled
nicely by some shortcuts modern Tcl supports for binary channels.
The simplest is to change your [open] command from

     open /tmp/john w

to

     open /tmp/john wb

which signals at the time you open the channel that you
will be writing bytes, not characters, to it and that
encoding and translation configurations should be set
up accordingly.

If your Tcl release is outdated and does not support
that option to [open], and you can't update to Tcl 8.5,
then use the command

     fconfigure $fileID -translation binary

after the [open] instead to achieve the same result.

Applying the lessons of this good example back to your
larger program left as an exercise.

> 
> bob
> 
> ============= begin snip =======================
> #!/usr/bin/tclsh
> 
> set one 0x41
> set two 0x4042
> 
> set buf  [binary format "s1x2i1" \
> 			$one \
> 			$two ]
> 
> if [ catch {open  /tmp/john w} fileID ] {
> 	puts stdout error
> }
> 
> puts -nonewline $fileID $buf
> flush $fileID
> 
> close $fileID
> 
> exit
> 
> ============== end snip ==================
> 


-- 
| Don Porter          Mathematical and Computational Sciences Division |
| donald.porter@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|
0
dgp2341 (685)
7/22/2009 4:55:00 PM
On Jul 22, 12:55 pm, Don Porter <d...@nist.gov> wrote:
> bobicanprogram wrote:
> > Oh and I forgot to mention.    This little diddy below works in all
> > flavors of Linux.   Go figure.
>
> This is a much better example program, pared down to the
> parts that matter.
>
> I am assuming the successful end state you seek is a file
> named /tmp/john that is 8 bytes long with the values
>
>      0x41 0x00 0x00 0x00 0x42 0x40 0x00 0x00
>
> stored in it.  (Really helps to state these things explicitly.)
>
> The program below actually will not reliably do that in
> all environments, because you have not controlled
> translation and encoding configuration on the $fileID
> channel.  It will fail even in common environments if
> the values of $one and $two are permitted to have other
> values, such as 0xA3 .
>
> Since you are writing binary data, your case is handled
> nicely by some shortcuts modern Tcl supports for binary channels.
> The simplest is to change your [open] command from
>
>      open /tmp/john w
>
> to
>
>      open /tmp/john wb
>
> which signals at the time you open the channel that you
> will be writing bytes, not characters, to it and that
> encoding and translation configurations should be set
> up accordingly.
>
> If your Tcl release is outdated and does not support
> that option to [open], and you can't update to Tcl 8.5,
> then use the command
>
>      fconfigure $fileID -translation binary
>
> after the [open] instead to achieve the same result.
>
> Applying the lessons of this good example back to your
> larger program left as an exercise.
>
>
>
>
>
> > bob
>
> > ============= begin snip =======================
> > #!/usr/bin/tclsh
>
> > set one 0x41
> > set two 0x4042
>
> > set buf  [binary format "s1x2i1" \
> >                    $one \
> >                    $two ]
>
> > if [ catch {open  /tmp/john w} fileID ] {
> >    puts stdout error
> > }
>
> > puts -nonewline $fileID $buf
> > flush $fileID
>
> > close $fileID
>
> > exit
>
> > ============== end snip ==================
>
> --
> | Don Porter          Mathematical and Computational Sciences Division |
> | donald.por...@nist.gov             Information Technology Laboratory |
> |http://math.nist.gov/~DPorter/                                 NIST |
> |______________________________________________________________________|



You are a genius !!!  I've been pulling what little remains of my hair
out over this one.  Alas I have a completely ragged copy (most of the
pages are loose now) of Welch's book on Tcl/Tk as my bible and it is a
bit dated now.   The "wb" option wasn't around when that book was
written.

Thanks again.

bob
PS.
By the way this Tcl/Tk list absolutely rocks.   A few years back I
posted a note from a system with an incorrect clock setting.   If you
look at the time stamps, that note was answered BEFORE it was
posted ... now that is a community !!!

PS2.
Just curious if you have an explanation as to why the little diddy
code ran on all boxes but my more complex example did not.   Size of
the binary blob perhaps?  content?
0
icanbob (63)
7/22/2009 6:51:45 PM
At 2009-07-22 02:51PM, "bobicanprogram" wrote:
>  By the way this Tcl/Tk list absolutely rocks.   A few years back I
>  posted a note from a system with an incorrect clock setting.   If you
>  look at the time stamps, that note was answered BEFORE it was
>  posted ... now that is a community !!!

TIP #131: Read My Mind and Do What I Mean
http://www.tcl.tk/cgi-bin/tct/tip/131.html

-- 
Glenn Jackman
    Write a wise saying and your name will live forever. -- Anonymous
0
glennj (645)
7/22/2009 7:22:09 PM
bobicanprogram <icanbob@gmail.com> writes:

> You are a genius !!!  I've been pulling what little remains of my hair
> out over this one.  Alas I have a completely ragged copy (most of the
> pages are loose now) of Welch's book on Tcl/Tk as my bible and it is a
> bit dated now.   The "wb" option wasn't around when that book was
> written.
>
> Thanks again.

Note also
     http://wiki.tcl.tk/1180

-- 
So long,
	Andreas Kupries <akupries@shaw.ca>
			<http://www.purl.org/NET/akupries/>
	Developer @	<http://www.activestate.com/>
-------------------------------------------------------------------------------
0
akupries (323)
7/24/2009 4:31:15 AM
On Jul 22, 8:51=A0pm, bobicanprogram <ican...@gmail.com> wrote:
>
> Just curious if you have an explanation as to why the little diddy
> code ran on all boxes but my more complex example did not. =A0 Size of
> the binary blob perhaps? =A0content?

Content. Your smaller example contains only bytes in the range 0-127,
aka ASCII, which are left untouched by most encodings. A 0xDEAD is
much more of a stress test than 0x4142 in that area ;-)

-Alex


0
7/24/2009 7:00:58 AM
Reply:

Similar Artilces:

[TCL/TK interface] Passing variable to TCL/TK
Hi, I am trying to sent to a variable to tcl/tk and unify there it with a string. I wrote the prolog code: :- use_module(library(tcltk)). :- use_package(classic). go(A):- tk_new([name('Simple')], Tcl), tcl_eval(Tcl, 'source simple2.tcl', _), tcl_eval(Tcl, ['ask', br(write(A))], _), tk_main_loop(Tcl), tcl_delete(Tcl). and the tcl file simple2.tcl proc ask {var} { unify_term $var my_value } unfortunatelly when I query for go(S). the interpeter goes into a loop (!?). Where I am wrong. Are there any example code somewhere i...

Opening a TCL program from within another TCL program in ANSYS Tcl-Tk
Hi everyone, I have been pulling my hair with this one for a couple of days and still have not found a fix. I'm working within ANSYS Tcl-Tk implementation. I created a Tcl-Tk script that generates a simple window with three buttons. Each button opens another window which is created in a separate Tcl file. The second window have a lot of text entries, variables, procedures, etc. I can open the second Tcl file by itself and everything works as supposed, but when I open it using the button in the first window, it opens but any procedure called by the widgets on the second window are not found... Here's the deal... Since I'm working within the ANSYS implementation of Tcl-Tk, I'm actually using an ANSYS command to open the second window. The command I use is: ### ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' ### It actually sends a command back to ANSYS telling it to execute a Tcl command... I know this is not pretty but its the only way i was able to make it at least show the window. ############################## #Main Tcl (excerpt): ############################## namespace eval Tools { proc IBRCambpell {} { #source O:/mad_projects_2/ANSYS/Macros/IBR_CAS.tcl ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' } proc viewManager {} { ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ ViewManager.tcl' } proc powerAnnotation {} { ans_sendcommand ~eui,'source ...

Tcl/Tk to Perl/TK Translation Problem
Hello, I am having problems translating the following tcl/tk code to perl/tk: ============ tcl code ============ label .controls.sizel -text "Size:" grid .controls.quall .controls.quallo .controls.qual .controls.qualhi -sticky ew grid .controls.sizel .controls.sizesm .controls.size .controls.sizelg -sticky ew grid .controls.colorl .controls.color -sticky ew grid configure .controls.color -columnspan 3 grid configure .controls.quall .controls.sizel .controls.colorl -sticky e grid configure .controls.quallo .controls.sizesm -sticky e grid configure .controls.qualh...

Debugger for Tcl/Tk and [incr Tcl]
hi, where can i get Coverage for debugging tcl/tk, [incr Tcl] source? this tool is advised to use in 'Practical Programming in Tcl and Tk' or any other good debugger, which i could use? best, s. On Jan 23, 5:56=A0am, Sitaca <sit...@gmail.com> wrote: > hi, > > where can i get Coverage for debugging tcl/tk, [incr Tcl] source? > this tool is advised to use in 'Practical Programming in Tcl and Tk' > > or any other good debugger, which i could use? I see, at http://wiki.tcl.tk/8638 , a brief reference to the topic of coverage for tcl. I don't know whether or not any of the tools mentioned include coverage of itcl. On 23 jan, 12:52, "Larry W. Virden" <lvir...@gmail.com> wrote: > On Jan 23, 5:56=A0am, Sitaca <sit...@gmail.com> wrote: > > > hi, > > > where can i get Coverage for debugging tcl/tk, [incr Tcl] source? > > this tool is advised to use in 'Practical Programming in Tcl and Tk' > > > or any other good debugger, which i could use? > > I see, athttp://wiki.tcl.tk/8638, a brief reference to the topic of > coverage for tcl. I don't know whether or not any of the tools > mentioned include coverage of itcl. I have a more complete version of the coverage tool mentioned on that page. I just never got around to publishing it more widely. As for debuggers: the Wiki has a lot of pointers on that subject as well. Regards, Arjen Larry W. Virden wrote:...

Re: Tcl/Tk to Perl/TK Translation Problem
Philippe de Rochambeau <philippe@wwphi.net> wrote: > Hello, > > I am having problems translating the following tcl/tk code to perl/tk: > > ============ tcl code ============ > label .controls.sizel -text "Size:" > > grid .controls.quall .controls.quallo .controls.qual .controls.qualhi > -sticky ew > grid .controls.sizel .controls.sizesm .controls.size .controls.sizelg > -sticky ew > grid .controls.colorl .controls.color -sticky ew > grid configure .controls.color -columnspan 3 > grid configure .controls.quall .control...

tk::mac::ShowPreferences in Tcl/Tk Linux version?
When I define a procedure tk::mac::ShowPreferences working on a Mac Leopard Snow with the Mac version of ActiveState Tcl/Tk I can use the Mac Preference menu without problems. Great work! But normally I work on a Unix platform compiling my program with tclkit-darwin-aqua for a Mac Platform. And defining a procedure proc ::tk::mac::ShowPreferences {} { tk_messageBox -type ok -icon info -default ok \ -title "Preferences" \ -message "Here will be a Preference Dialog!" } and compiling it for aqua will fail on the Mac. Probably I have to add the tk::ma...

Problem with tcl/tk
Dont know if many people use this product, but im new to linux and it's probably a stupid question. Directions for install say " In the tcl/unix directory type ./configure " Configure is the file i am trying to load up, and is in the tcl/unix directory. Not really sure where it wants me to type it. Just says type ./configure I tried typing the whole directory "/home/******/tcl/unix/configure and it didnt seem to work. When I used ./configure instead of /configure as i was told to do... nothing at all happened. Anyone know what I'm doing wrong?? I know my ...

Incr Tcl /Tk for Tcl 8.4
Hi, I am trying to download incr Tcl and incr Tk for Tcl/Tk 8.4.19. I looked at: http://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-source/3.4.1/ But only itcl seems to be there. And the CVS doesn't have the 3.4.1 tag. Do you know where I can get incr Tk and hopefully a corresponding iwidgets? Thanks, Andres On 5 Okt., 11:16, Andres Garcia <tclc...@gmail.com> wrote: > Hi, > > I am trying to download incr Tcl and incr Tk for Tcl/Tk 8.4.19. > > I looked at: > > http://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-sou... > > But only itcl seems to be there. And the CVS doesn't have the 3.4.1 > tag. There is no tag for this version. But you can use a date. cvs -d :pserver:anonymous@incrtcl.cvs.sourceforge.net:/cvsroot/incrtcl -z3 co -P -D 2010-10-28 incrTcl > > Do you know where I can get incr Tk and hopefully a corresponding > iwidgets? Itk is inside itcl sources. cvs -d :pserver:anonymous@incrtcl.cvs.sourceforge.net:/cvsroot/incrtcl -z3 co -P -D 2010-10-28 iwidgets HTH rene Thanks. Andres >> I am trying to download incr Tcl and incr Tk for Tcl/Tk 8.4.19. >> >> I looked at: >> >> http://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-sou... >> >> But only itcl seems to be there. And the CVS doesn't have the 3.4.1 >> tag. The released sources for Itcl 3.4.1 were not developed in SF CVS. SF CVS got abandoned during the January...

Problem using hyperhelp
As those who have answered various of my questions know, I have problems finding information known to exist "somewhere" in the man pages. I think I have a handle on how I want to retrieve what *I* consider the "relevant" hits. Now comes the problem displaying the retrieved information. As the man pages I'm using are in HTML (see http://www.tcl.tk/man/) I started looking for Tcl/Tk packages that could display HTML files. I came across "hyperhelp". It is apparently included in the ActiveState distribution which I use. At least its man page is available in the Help system. That page gives an example of usage. As is frequently the case - it does *NOT* work as given. The routine problem is missing "package require" statements (though often given elsewhere in the page). A Google search and roving the wiki indicated that at least package require Tk package require Iwidgets package require Itk are required. I still get invalid command name "hyperhelp" .. On 29 jan, 09:03, Richard Owlett <rowl...@atlascomm.net> wrote: > As those who have answered various of my questions know, I have problems > finding information known to exist "somewhere" in the man pages. I think > I have a handle on how I want to retrieve what *I* consider the > "relevant" hits. > > Now comes the problem displaying the retrieved information. As the man > pages I'm using are in HTML (seehttp://w...

E.J. Friedman-Hill's Tcl/Tk Course
E.J. Friedman-Hill's Tcl/Tk Course Tcl/Tk Programming in Five Easy Lessons http://www.linbox.com/ucome.rvt/any/doc_distrib/tcltk-8.3.2/TclCourse/ I am unable to open the ppt files that seem very promising. Can anyone see what is the problem with them and can convert/fix so that I can open in the office 2007 or open office ? Thanks Bolega On 24/03/2011 2:51 AM, bolega wrote: > E.J. Friedman-Hill's Tcl/Tk Course > Tcl/Tk Programming in Five Easy Lessons > > http://www.linbox.com/ucome.rvt/any/doc_distrib/tcltk-8.3.2/TclCourse/ > > I am unable to o...

tcl/tk install problem
Hi, on one machine (GenToo 64bits) I suddenly get the following error messages (similar messages appear on a different machine with Tcl/Tk 8.5.3 though 8.5.2 is running just fine) What could be the reason for this problem? Many thanks for a hint, Helmut. Application initialization failed: Can't find a usable tk.tcl in the following directories: /usr/lib64/tcl8.4/tk8.4 /usr/lib64/tk8.4 /usr/lib/tk8.4 /lib/tk8.4 /usr/library /library /tk8.4.18/library /usr/lib64/tk8.4/tk.tcl: no event type or button # or keysym no event type or button # or keysym while executing "bind Listbox <MouseWheel> { %W yview scroll [expr {- (%D / 120) * 4}] units }" invoked from within "if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { bind Listbox <MouseWheel> { %W yview scroll [expr {- (%D)}] uni..." (file "/usr/lib64/tk8.4/listbox.tcl" line 181) invoked from within "source /usr/lib64/tk8.4/listbox.tcl" (in namespace eval "::" script line 1) invoked from within "namespace eval :: [list source [file join $::tk_library $file.tcl]]" (procedure "SourceLibFile" line 2) invoked from within "SourceLibFile listbox" (in namespace eval "::tk" script line 4) invoked from within "namespace eval ::tk { SourceLibFile button SourceLibFile entry SourceLibFile listbox SourceL...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For an introduction to genetic algorithms visit: http://gaul.sourceforge.net/intro.html Platform: Linux (GAUL library dependency) Home page: http://sourceforge.net/projects/tcl-gaul/ Man page: http://tcl-gaul.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

TCL/TK listbox problem
Hello, I implemented a TCL/TK interface in Scilab with 2 listbox, but when I select an item in one of them and try to select an other item in the second one, the first item is unselected.. I tried with a multiple selection, I can select as much item as I want but only in one listbox, when I want something from the second one, my first selection got unselected Does anyone know where it can come from ? Thanks in advance, Mitox Can you send us a short scilab script reproducing the problem. For me it works fine: list_item = ["rouge" "vert" "tomate" "chevre" "Truc"]; initial=strcat(list_item,'|') list_item2 = ["paris" "marseille" "lyon" "bordeaux" "rennes"]; initial2=strcat(list_item2,'|') f=figure(); // create a figure //h=uicontrol(f,'style','edit', 'position', [10 10 150 160]); l1 = uicontrol(f,"Position" , [0 10 100 150],... "Style" , "listbox",... "String" , initial,... "BackgroundColor",[1 1 1]); l2 = uicontrol(f,"Position" , [120 10 100 150],... "Style" , "listbox",... "String" , initial2,... "BackgroundColor",[1 1 1]); // then I can ckeck uncheck all the items I want in one or both listboxes and: get(l1,'value') get(l2,&#...

Fedora 15 and Tcl/Tk
Hi, I have a fairly old application that has been working fine... The app 'iconifys the root window at startup.( wm iconify .) Pops up a dialog to get connection parameters for attaching to a database and then constructs the GUI in the root window (.) I then de-iconify ( wm deiconify . ) the root window and start fiddling the with database. When I run the app in Fedora 15 ( with the stock Tcl/Tk 8.5.9) the main window does not appear after the connection dialog. However if I invoke the 'overview' mode in Fedora 15 I can see the window and clicking on the rascal causes it to be made visible. The program works fine in Fedora 14 and the latest Mac OS X. Anyone have a clue on how I can fix the problem? Jerry On Jun 20, 5:49=A0pm, "jerry.le...@gmail.com" <jerry.le...@gmail.com> wrote: > Hi, > > I have a fairly old application that has been working fine... > > The app 'iconifys the root window at startup.( =A0wm iconify .) Pops up > a dialog to get connection > parameters for attaching to a database and then constructs the GUI in > the root window (.) > > I then de-iconify ( wm deiconify . ) the root window and start > fiddling the with database. > > When I run the app in Fedora 15 ( with the stock Tcl/Tk 8.5.9) the > main window does not > appear after the connection dialog. > > However if I invoke the 'overview' mode in Fedora 15 I can see the > window and clicking on the rasca...

Tcl/Tk on Linux questions
I'm thinking of moving from Windows to Linux. Though a computer _user_ since days of 026's, I'm not familiar with any OS internals/structure since CPM-80. I have not yet decided on which distro to use. One set of considerations push towards a reasonably standard Debian based distro. Another set has me leaning towards Tinycore and its competitors. The conflict is that the standard/common distro's manage to download "everything but the kitchen sink" when >90% of my time will be spent with a couple of "kitchen sinks" ;/ I interpret http://docs.activestate.com/activetcl/8.5/at.install.html as saying that as long as I have a specific kernel (or later) all is GO [i.e. no dependencies to download]. When I asked a similar question on a Linux forum (though I was focusing my question on obtaining smallest .iso) I would have to download such a large amount of graphics support that it would defeat my goal of a small download. Two questions: 1. How confused/befuddled am I? 2. What I want from a "GUI" many might consider just a set of menus. There were some demo tcl files on the ACTIVEDVD I purchased several years ago. Something like their top level would suit me well. My desktop would likely appear to be a half dozen icons each launching a specific menu. Anything more I associate with a GUI is already buried in pure Tcl/Tk scripts I write. From the user perspective this is pretty much how I actua...

tcl-pam: PAM authentication for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-pam Tcl-pam is a Tcl interface to the PAM* service of Linux. It provides a Tcl package that allows Tcl scripts to use PAM to authenticate users and programs. It relies on linux-pam library: http://www.kernel.org/pub/linux/libs/pam/ * PAM (Pluggable Authentication Modules): A mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API). This enables programs that rely on authentication to be written independently of the underlying authentication scheme. Platform: Linux Home page: http://sourceforge.net/projects/tcl-pam/ Man page: http://tcl-pam.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Remembering Tcl: Problems with C and Tcl communicated via pipelines
I am now remembering TCL and I have came across with a problem when doing something I used to do. My purpose is to implement a console-like GUI to present in a listbox outputs from another program written in c and allow to command orders via an entry. All the communication between both programs will be via pipeline As a first approximation, I tried several easy examples and I get stucked with these two programs (see below). When executing tclprogram2.tcl I get Done1 and Done2 and nothing more: i must end it with Ctrl-C. However, if I change Hello3 lines before for loop, the program run smoo...

tcl-mq: POSIX Message Queues for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mp Tcl-mp is a Tcl interface to POSIX Message Queues*. It provides a Tcl package that allows scripts to create/open/close/unlink multiple parallel message queues, and to send/receive messages synchronously and asynchronously to/from them. * A POSIX message queue is an Inter-Process Communication mechanism available on Linux and some other POSIX-compliant operating systems. It allows to or more processes (or threads) to communicate under the same OS. The messages are buffered by the kernel, which gives them kernel persistency. A message queue can be thought of as a linked list of messages. Threads with adequate permission can put messages onto the queue, and threads with adequuate permission can remove messages from the queue. Each message is assigned a priority by the sender, and the oldest message of highest priority is always retrieved first. Unlike PIPES and FIFOS, no requirement exists that someone be waiting for a message to arrive on a queue, before some process writes a message to that queue. It's not even a requirement for both processes to exist at the same time. Read mq_overview(7) for more details Platform: Linux Home page: http://sourceforge.net/projects/tcl-mp/ Man page: http://tcl-mp.sourceforge.net/ Author: Alexandros Stergiakis alsterg On Sep 3, 11:37=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl pro...

tcl-syslog: Unix system logging for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-syslog Tcl-syslog is a Tcl interface to the *nix syslog service. It provides a Tcl package that allows Tcl scripts to log messages to syslog. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-syslog/ Man page: http://tcl-syslog.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-mmap: A POSIX mmap interface for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mmap Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides a Tcl package that allows Tcl scripts to: 1) Memory map files for improved access efficiency; 2) Share memory between related processes; 3) Easily implement cyclic persistent log files. * See the mmap(2) man page. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-mmap/ Man page: http://tcl-mmap.sourceforge.net/ Author: Alexandros Stergiakis On Sep 3, 11:48=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl project: tcl-mmap > > Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides > a Tcl package that allows Tcl scripts to: 1) Memory map files for > improved access efficiency; 2) Share memory between related processes; > 3) Easily implement cyclic persistent log files. > > * See the mmap(2) man page. > Great to see this and the other packages you made. Looking at the manpage it looks a bit misformatted before the usage example. Any specific reason to use GPL for this instead the usual Tcl/MIT/BSD style license used? Michael schlenk wrote: > On Sep 3, 11:48 am, Alexandros Stergiakis <alst...@gmail.com> wrote: >> This is an announcement for a relatively new Tcl project: tcl-mmap >> >> Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides >> a Tcl package that...

Tcl/Tk on embedded (ARM) Linux?
Some time ago I developed an embedded application using Tcl/TK on a touch screen intel/ITX type system, and as the project moves forward, time has come to put it onto an HMI with a proper form factor based upon an ARM touch screen platform ... I have not received the development platform/build environment just yet, I'm looking for anyone with experience ... I figure that once the tool chain is set up, it should be a simple ./configure/Make with the standard Canadian Cross approach ... Any pointers would be appreciated. I'm planning to use 8.6 ... Cheers, Rob. On Aug 25, 5:25=A0am, S...@ControlQ.com wrote: > Some time ago I developed an embedded application using Tcl/TK on a touch > screen intel/ITX type system, and as the project moves forward, time has > come to put it onto an HMI with a proper form factor based upon an ARM > touch screen platform ... > > I have not received the development platform/build environment just yet, > I'm looking for anyone with experience ... I figure that once the tool > chain is set up, it should be a simple ./configure/Make with the standard > Canadian Cross approach ... Any pointers would be appreciated. =A0I'm > planning to use 8.6 ... > Is 8.6 released yet? I use Debian on my ARM based NSLU2 and Debian has tcl 8.5. And Debian supports ARM as a first-class citizen. On Aug 24, 11:25=A0pm, S...@ControlQ.com wrote: > Some time ago I developed an embedded application using Tcl/TK ...

problem compiling tcl/tk on IRIX64?
I pulled the latest tcl/tk 8.4.14 and tcl compilies without problems. The 'make test' in tcl complains of some issue with clock and '%k', but I'm not worried about that one. Configure and make for tk run without issues. When I do the 'make test' I get errors complaining about 'ambiguous ... rectangle' and 'ambiguous ... image'. Any idea what's going on here? tcl/tk 8.4.14 IRIX64 $ CC=/usr/bin/cc ./configure --prefix=/usr/freeware --with-tcl=../../tcl8.4.14/unix $ make $ make test bind.test ==== bind-6.1 Tk_DeleteBindTable procedure FAILED ==== Contents of test case: catch {destroy .b.c} canvas .b.c .b.c bind foo <1> {string 1} .b.c create rectangle 0 0 100 100 .b.c bind 1 <2> {string 2} destroy .b.c ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: unknown or ambiguous item type "rectangle" while executing ".b.c create rectangle 0 0 100 100" ("uplevel" body line 5) invoked from within "uplevel 1 $script" ---- errorCode: NONE ==== bind-6.1 FAILED ==== bind-24.14 FindSequence procedure: no binding FAILED ==== Contents of test case: catch {destroy .b.f} canvas .b.f set i [.b.f create rect 10 10 100 100] list [catch {.b.f bind $i <a>} msg] $msg ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: unknown...

Tcl/Tk , Xlib problems with Cygwin
Hi, We would like to move a graphic application from Linux to Windows, using Cygwin (newest version). The application uses GRASS features. It's written in C and Tcl/Tk, and it uses Xlib. The interface and the windows are built in Tcl/Tk. There is also a linkage between an Object, and some commands, developed in C, wich can be used by Tcl/Tk. The display module uses C and Xlib. It works fine under Linux . But with Cygwin, with natives Tcl/Tk librairies, the application can't display RASTER files in the window (drawable). It crashes at XPutImage(), just after XPutPixel(). If I do :...

PLplot and Tcl/Tk interface problems
Hello, a new release of PLplot (http://wiki.tcl.tk/plplot and http://plplot.sf.net) is due this weekend and now some severe problems (segfaults at exit for instance) have shown up. The problems seem to be due to the incompatibility of older versions of Itcl/Itk and Tcl/Tk 8.5. I am unable to check the problems as I do not have convenient access to Linux at the moment, at least not for helping to maintain PLplot. A solution would be to disable Tcl and Tk by default from the build, but I would rather like a more subtle solution. Can anyone help out? Regards, Arjen ...

Web resources about - Fedora Linux and Tcl/Tk problems - comp.lang.tcl

Problem novel - Wikipedia, the free encyclopedia
Working class, or proletarian novels are often also social problem novels . This was in many ways a reaction to rapid industrialization , and ...

Maria Sharapova's meldonium problem: it's about the brains, not the looks
What Maria Sharapova seems most guilty of is breathtaking stupidity.

Maria Sharapova's meldonium problem: it's about the brains, not the looks
What Maria Sharapova seems most guilty of is breathtaking stupidity.

Obama Wants SXSW to Help Solve America's Problems, Including Apple Standoff
President Obama asked a tech-savvy audience attending the first day of the South by Southwest Interactive Festival in Austin to help tackle the ...

Florida’s problem with sea level rise catches up with Rubio at debate
... debate near Miami, Florida. (credit: Joe Raedle / Getty Images) Earlier this year, a group of Florida mayors that are dealing with problems ...

How to fix Microsoft Edge's worst problems
... soon (and to the rest of us when the Redstone update for Windows 10 rolls out in June/July). If you’re using the new browser and having problems, ...

NASTY: Bill Clinton's Disgusting Flatulence Problems Date Back to White House Years
It's not just Granny Catlady who stinks. It's also her husband : Clinton became so flatulent at one point during his presidency that his close ...


Weekend Reading: Andrew Gelman: The problems with p-values are not just with p-values
**Andrew Gelman**: [The problems with p-values are not just with p-values](http://andrewgelman.com/2016/03/07/29212/): >The American Statistical ...

Apple's iPhone problem in one chart: Apple usually does worse than the market as a whole
... net adds of new phones are in decline , and the major portion of "growth" to be had is in replacing existing units. That's a particular problem ...

Resources last updated: 3/13/2016 11:28:20 AM