• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Question for Programming and Webmastering Readers

regexorcist

New Member
Joined
Feb 1, 2010
Messages
178 (0.03/day)
Location
~/
System Name Slackware Linux
Processor yes
Motherboard yes
Cooling currently convection, but considering mineral oil
Memory sometimes fails due to too much beer
Video Card(s) ATI Radeon HD5570 series
Storage IDE
Display(s) 32" LCD TV
Case sometimes
Audio Device(s) huh? what? speak up, I can't hear you
Power Supply yes
Software Slackware running Open-Source software (it doesn't get any better)
I wouldn't be of any help, as I'm just a hack.

I do like tk because tcl/tk is already on most
all Linux distros (except for the custom ones Gentoo, Arch, LFS, etc...).

I've managed to use tk with tcl, perl and python, but it does
look different on different distros. For example, the listbox
and textbox were the same vertical size when I created that tcl/tk script
a while back on Gentoo, but other distros show them as different sizes.

Gtk+, Qt and wxWidgets are available, but who wants to install multiple
graphic libraries to try out a little script (I wouldn't), so I'll stick w/ tk for now.

You mentioned ncurses which is great for scripting, but that won't satisfy
the new GUI Linux user, who has heard of the shell, but never bothered with it. :laugh:
 

Clement

New Member
Joined
Feb 11, 2010
Messages
192 (0.04/day)
Location
SouthEast Blue Mountain, Pa
System Name Work Horse
Processor E5200@3.000@1.2 (12.5x240) (Limited by mobo mem volts) ::[Evil Glare]-I'm gonna mod you!::
Motherboard 4COREDUAL-SATA2 R2
Cooling AC Freezer Pro 7; AC Accelero S1 <-These two are bad ass!
Memory (2gb G.Skill F2-8500-CL5D-2GBPK) @ 1.9v/320MHz/3:4/4-4-4-10-16-2T
Video Card(s) X1950GT 621/729 (Will do more)
Storage Seagate 320; 2x1TB WD
Display(s) ViewSonic 19" Widescreen
Case Black, Sturdy.
Audio Device(s) Onboard DAC works great.
Power Supply Enermax EG365P-VE
Software Fedora x64; WinXP32
Benchmark Scores Once, I programmed for a little over 22.5 hours straight.
I wouldn't be of any help, as I'm just a hack.

I do like tk because tcl/tk is already on most
all Linux distros (except for the custom ones Gentoo, Arch, LFS, etc...).

I've managed to use tk with tcl, perl and python, but it does
look different on different distros. For example, the listbox
and textbox were the same vertical size when I created that tcl/tk script
a while back on Gentoo, but other distros show them as different sizes.

Gtk+, Qt and wxWidgets are available, but who wants to install multiple
graphic libraries to try out a little script (I wouldn't), so I'll stick w/ tk for now.

You mentioned ncurses which is great for scripting, but that won't satisfy
the new GUI Linux user, who has heard of the shell, but never bothered with it. :laugh:

Just a hack? :laugh: You don't give yourself enough credit.

Haven't gotten far enough yet to know for sure myself, but could you explicitly specify the vertical size?

Tk is more than suffice as I've been reading, you just have to know how to use it.

Thanks for reminding me of when I first started with a shell....VERY good point!
 
Last edited:

Clement

New Member
Joined
Feb 11, 2010
Messages
192 (0.04/day)
Location
SouthEast Blue Mountain, Pa
System Name Work Horse
Processor E5200@3.000@1.2 (12.5x240) (Limited by mobo mem volts) ::[Evil Glare]-I'm gonna mod you!::
Motherboard 4COREDUAL-SATA2 R2
Cooling AC Freezer Pro 7; AC Accelero S1 <-These two are bad ass!
Memory (2gb G.Skill F2-8500-CL5D-2GBPK) @ 1.9v/320MHz/3:4/4-4-4-10-16-2T
Video Card(s) X1950GT 621/729 (Will do more)
Storage Seagate 320; 2x1TB WD
Display(s) ViewSonic 19" Widescreen
Case Black, Sturdy.
Audio Device(s) Onboard DAC works great.
Power Supply Enermax EG365P-VE
Software Fedora x64; WinXP32
Benchmark Scores Once, I programmed for a little over 22.5 hours straight.
test.tcl:
Code:
set key "54636c2077696c6c206e65766120646965206a3030206630306c7a21204c4f4c21";puts [subst [regsub -all -nocase {([0-9a-f][0-9a-f])} $key {[format %c 0x\1]} ]]

$ tclsh test.tcl

:laugh:
 
Last edited:

regexorcist

New Member
Joined
Feb 1, 2010
Messages
178 (0.03/day)
Location
~/
System Name Slackware Linux
Processor yes
Motherboard yes
Cooling currently convection, but considering mineral oil
Memory sometimes fails due to too much beer
Video Card(s) ATI Radeon HD5570 series
Storage IDE
Display(s) 32" LCD TV
Case sometimes
Audio Device(s) huh? what? speak up, I can't hear you
Power Supply yes
Software Slackware running Open-Source software (it doesn't get any better)
Haven't gotten far enough yet to know for sure myself, but could you explicitly specify the vertical size?
Yes but I chose to use pack for a layout manager and to fill it up on a Frame.
I'm sure there is a way using .pack(), I'll look into it.


test.tcl:
Code:
set key "54636c2077696c6c206e65766120646965206a3030206630306c7a21204c4f4c21";puts [subst [regsub -all -nocase {([0-9a-f][0-9a-f])} $key {[format %c 0x\1]} ]]

$ tclsh test.tcl

:laugh:
Yes it will never die :laugh:

Do you have this??
Code:
#!/usr/bin/tclsh
	 
package require http
	 
set url http://www.this-page-intentionally-left-blank.org/comments.html;
	 
set http [::http::geturl $url];
set var_html [::http::data $http];

regsub -all { people} $var_html {} var_html
set var_line1 [string first {I t} $var_html];
set var_start $var_line1;
set var_line2 [string first {way</} $var_html];
set var_end $var_line2-23;
puts [string range $var_html $var_start $var_end];
:laugh:
 

Clement

New Member
Joined
Feb 11, 2010
Messages
192 (0.04/day)
Location
SouthEast Blue Mountain, Pa
System Name Work Horse
Processor E5200@3.000@1.2 (12.5x240) (Limited by mobo mem volts) ::[Evil Glare]-I'm gonna mod you!::
Motherboard 4COREDUAL-SATA2 R2
Cooling AC Freezer Pro 7; AC Accelero S1 <-These two are bad ass!
Memory (2gb G.Skill F2-8500-CL5D-2GBPK) @ 1.9v/320MHz/3:4/4-4-4-10-16-2T
Video Card(s) X1950GT 621/729 (Will do more)
Storage Seagate 320; 2x1TB WD
Display(s) ViewSonic 19" Widescreen
Case Black, Sturdy.
Audio Device(s) Onboard DAC works great.
Power Supply Enermax EG365P-VE
Software Fedora x64; WinXP32
Benchmark Scores Once, I programmed for a little over 22.5 hours straight.
Yes but I chose to use pack for a layout manager and to fill it up on a Frame.
I'm sure there is a way using .pack(), I'll look into it.



Yes it will never die :laugh:

Do you have this??
Code:
#!/usr/bin/tclsh
	 
package require http
	 
set url http://www.this-page-intentionally-left-blank.org/comments.html;
	 
set http [::http::geturl $url];
set var_html [::http::data $http];

regsub -all { people} $var_html {} var_html
set var_line1 [string first {I t} $var_html];
set var_start $var_line1;
set var_line2 [string first {way</} $var_html];
set var_end $var_line2-23;
puts [string range $var_html $var_start $var_end];
:laugh:

I just stopped at regular expressions in my second tutorial this morning, so I am still learning just Tcl. I would love to jump ahead, but I'm moving fast enough.

I think regular expressions was somewhere around chapter 20 something In my C++ book. I don't remember reading about it in my C bible, but that was soooo long ago.

I reached regular expressions in less than 10 hours with this language :laugh:

And yes, what it outputs to the console is very true I am waiting for surgery and trying to have fun for the next 6-12wks or whatever it takes. May as well learn something useful.

Eventually I will create my own puzzles like that. I'm a big fan of the obfuscated contests and making one liners.

How do we have our posts moved to a new thread of its own? Can I just email the mod for this sub-forum? I'm starting to feel bad posting here about Tcl :shadedshu
 
Last edited:
Top