Abridged summary of comp.lang.tcl@googlegroups.com - 41 updates in 7 topics

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Abridged summary of comp.lang.tcl@googlegroups.com - 41 updates in 7 topics

comp.lang.tcl mailing list
Cecil Westerhof <[hidden email]>: Dec 05 07:51AM +0100

When doing:
regexp -line ${checkLine} ${currentRow} values
 
This gives a match and fills values.
 
When I do:
regexp -line ${checkLine} "${currentRow} 12" values
 
This does not give a ...more
Rich <[hidden email]>: Dec 05 10:46AM

> regexp -line ${checkLine} "${currentRow} 12" values
 
> This does not give a match and it leaves values untouched.
 
> Is this as it should be? I would expect values to be empty.
...more
Cecil Westerhof <[hidden email]>: Dec 05 01:23PM +0100


> In any case, when not using the -inline flag it is better to check the
> return value from regex to determine match/no-match states than to look
> for the match/submatch vars afterward.
...more
keithv <[hidden email]>: Dec 05 12:22PM -0800

On Tuesday, December 5, 2017 at 2:46:13 AM UTC-8, Rich wrote:
 
> In any case, when not using the -inline flag it is better to check the
> return value from regex to determine match/no-match states ...more
[hidden email]: Dec 05 08:22AM -0800

Hello,
 
I have something strange happening with a script that goes through a directory structure.
 
To test it I created a directory call "Test" and put there several empty directories "A", "B", ...more
Gerald Lester <[hidden email]>: Dec 05 10:46AM -0600


> Any idea what could possible be wrong?
 
> Thanks,
> Andrés García
 
Not sure exactly what is wrong or why, but the following does what you want:
 
foreach dir [glob -types d *] { ...more
Don Porter <[hidden email]>: Dec 05 11:50AM -0500

> /home/Samba/c/Backup/User1/GEO/Coveris/Test/CA
> B/
> /home/Samba/c/Backup/User1/GEO/Coveris/TestB
 
...
 
> Any idea what could possible be wrong?
 
It appears you've detected a bug no one ...more
Brad Lanam <[hidden email]>: Dec 05 08:51AM -0800

> /home/Samba/c/Backup/User1/GEOC
 
> As you can see, when the name of the subdirectory is a single letter, the 'cd' command gets confused and tries to enter a directory that doesn't exist, but it ...more
Brad Lanam <[hidden email]>: Dec 05 08:58AM -0800

On Tuesday, December 5, 2017 at 8:50:53 AM UTC-8, Don Porter wrote:
 
> foreach dir [glob -types d *] { puts "$dir" ; cd "$dir"; puts [pwd] ; cd ..}
 
> --
> | Don Porter Applied and ...more
Andreas Leitgeb <[hidden email]>: Dec 05 08:08PM

>> % foreach dir [glob */] { puts "$dir" ; cd "$dir"; puts [pwd] ; cd ..}
> Also, after the bug occurs, one of the cd/pwd command stops working properly
> either cd doesn't work or pwd does not ...more
Mike Griffiths <[hidden email]>: Dec 04 12:29PM -0800

On Monday, 4 December 2017 18:44:06 UTC, Cecil Westerhof wrote:
> Cecil Westerhof
> Senior Software Engineer
> LinkedIn: http://www.linkedin.com/in/cecilwesterhof
 
Something like ...more
Cecil Westerhof <[hidden email]>: Dec 04 11:07PM +0100

> "
 
> But then I have to fill the 17 variables from the list. So I was just
> wondering if that could be done better.
 
lassign does what I need. I now have the following:
...more
Cecil Westerhof <[hidden email]>: Dec 04 11:08PM +0100

> VALUES('[join $list "','"]')
> should do the trick (assuming the list is guaranteed to not contain
> apostrophes).
 
I did it with lassign. See my other reply.
 
--
Cecil Westerhof ...more
Rich <[hidden email]>: Dec 04 11:11PM

>> 1 0 0 611788 1474304 5033000 0 0 0 88 3234 5258 25 3 72 0 0
 
>> Is there a smart way to put those 17 values into the database?
 
> lassign does what I need. ...more
Cecil Westerhof <[hidden email]>: Dec 05 01:18AM +0100

> operation upon a string, will attempt to parse the string into a list.
 
> For separating whitespace separated items that are simply digits (as
> above) or ascii letters, this will work as you ...more
Cecil Westerhof <[hidden email]>: Dec 05 01:54AM +0100

>> above) or ascii letters, this will work as you would expect.
 
> OK, I will not worry in this case then. But I will look into it, so
> that when I have a more complex case I will be prepared.
...more
Cecil Westerhof <[hidden email]>: Dec 05 02:24AM +0100


> I added:
> set checkLine {^ +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) ...more
Gerald Lester <[hidden email]>: Dec 04 07:47PM -0600

On 12/04/2017 07:24 PM, Cecil Westerhof wrote:
>> set checkLine {^ +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) ...more
Rich <[hidden email]>: Dec 05 02:21AM

> }
> lassign ${currentLine} \
 
> That should take care of things.
 
That does validate that things are as you expect (although the "-all" ...more
Rich <[hidden email]>: Dec 05 02:27AM

>> set checkLine {^ +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+)$}
...more
Cecil Westerhof <[hidden email]>: Dec 05 07:46AM +0100


> {^(?: +([0-9]+)){17}$}
 
> This is a capturing version. Dropping the inner parenthesis would make
> it non-capturing.
 
When using:
regexp -line ${checkLine} ${currentRow} -> values
...more
Cecil Westerhof <[hidden email]>: Dec 05 08:03AM +0100


>> {^(?: +([0-9]+)){17}$}
 
>> This is a capturing version. Dropping the inner parenthesis would make
>> it non-capturing.
 
For the moment I have:
set checkLine {^(?: +[0-9]+){17}$} ...more
Cecil Westerhof <[hidden email]>: Dec 05 08:00AM +0100


> That does validate that things are as you expect (although the "-all"
> is redundant with a fully spelled out regex). However if you just use
> regexp to validate you don't need the capturing ...more
rene <[hidden email]>: Dec 04 11:20PM -0800

Am Montag, 4. Dezember 2017 19:44:06 UTC+1 schrieb Cecil Westerhof:
 
> This gives for example:
> 1 0 0 611788 1474304 5033000 0 0 0 88 3234 5258 25 3 72 0 0
...more
Rich <[hidden email]>: Dec 05 10:21AM


> When using:
> regexp -line ${checkLine} ${currentRow} -> values
 
> It looks like only the last match is put into values.
 
Yes, that is exactly what you asked for, given that you have 17 ...more
Rich <[hidden email]>: Dec 05 10:25AM


> to:
> set vmstat [open "|vmstat -n ${runLength}" r]
 
> It is the same, but clearer.
 
It does mean that a subsequent reader does not need to know the default
in order to understand the ...more
Rich <[hidden email]>: Dec 05 10:27AM

> db eval {insert into t1 values($a)}
> set b [db eval {select * from t1 where rowid=1}]
> {1 a {some text}}
 
That works, but it puts a string serialization of the list into one
row.
...more
Cecil Westerhof <[hidden email]>: Dec 05 01:20PM +0100


> regexp -line ${checkLine} ${currentRow} -> v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17
 
> to capture all of the submatches.
 
> Pick your own names instead of v1 ... v17.
...more
Cecil Westerhof <[hidden email]>: Dec 05 01:21PM +0100

> row.
 
> I interpreted Cecil's request that he had 17 columns in his DB, and
> wanted to put the appropriate values into the correct columns.
 
Correct and I managed that with the help of this ...more
Cecil Westerhof <[hidden email]>: Dec 05 01:16PM +0100

> because there are a few esoteric variants that can't be expressed with
> the single letter variant. So it would be:
 
> [open "..." RDONLY]
 
That is a good idea. If you do not mind I will ...more
Cecil Westerhof <[hidden email]>: Dec 05 02:09PM +0100


> {^(?: +([0-9]+)){17}$}
 
> This is a capturing version. Dropping the inner parenthesis would make
> it non-capturing.
 
It looks something is not quite right. I tried the following: ...more
Rich <[hidden email]>: Dec 05 05:55PM


> So something is going wrong. Or are I doing something wrong again?
 
The second one failed to match. Probably because it does not account
for spaces at the start of the line like the first one ...more
Cecil Westerhof <[hidden email]>: Dec 05 07:22PM +0100


>> So something is going wrong. Or are I doing something wrong again?
 
> The second one failed to match. Probably because it does not account
> for spaces at the start of the line like the first ...more
[hidden email]: Dec 05 02:49AM -0800

On Monday, 4 December 2017 19:38:22 UTC+11, Michael Niehren wrote:
 
> subject say's it all. I have a running Tcl/TK Application (V8.6) and want to bring it
> to a browser based application.
...more
Eugene <[hidden email]>: Dec 04 10:22PM -0500

Hi,
 
Does anyone know why Glide typing doesn't work with Gboard (google
keyboard) in Androwish (I have the latest version installed on my Nexus
9)? This is the only application where it doesn't ...more
Cecil Westerhof <[hidden email]>: Dec 04 11:21PM +0100

I open a read-only pipe with:
set vmstat [open "|vmstat -n 60"]
 
I close it immediately with:
close ${vmstat}
 
This takes almost a minute and ends in the following error: ...more
Rich <[hidden email]>: Dec 04 11:13PM

> child killed: write on pipe with no readers
> while evaluating {close ${vmstat}}
 
> What is happening here.
 
You are opening a pipe to vmstat, the immediately closing the Tcl end.
...more
Cecil Westerhof <[hidden email]>: Dec 05 01:15AM +0100


> Vmstat is still running, and tries to write to its end of the pipe.
 
> The error message you get is likely from vmstat, not Tcl.
 
> Read the data vmstat writes first, then close the pipe.
...more
Rich <[hidden email]>: Dec 05 02:16AM

> that is no problem, because I do not want it to stop.
> But what to do if the situation changes and I do want to stop a
> program that runs forever?
 
You have a couple choices there.
...more
Robert Heller <[hidden email]>: Dec 04 08:29PM -0600

> that is no problem, because I do not want it to stop.
> But what to do if the situation changes and I do want to stop a
> program that runs forever?
 
When you close the pipe, you kill the ...more
"Ricardo kozmate.net" <[hidden email]>: Dec 04 09:42PM

Em 04/12/17 12:46, Cecil Westerhof escreveu:
> this goes wrong when the seconds are 08 or 09
 
That is because a string with a leading "0" is interpreted as a octal
number, and "08" and "09" are ...more
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to [hidden email].