# Question for Programming and Webmastering Readers



## Kreij (Feb 28, 2008)

Hi All,

I have put up several posts with code snippets and such concerning C# things.
I notice that all the posts in this area get a lot of views, but very little response.

This is normal as people are usually perusing the posts for information and do not necessarily have a comment to make. While this is fine, we could make this area a lot better with more reader input.

So, here is your chance to sound off. The questions are ...

Do you find the code snippets useful?
Do you want to see more targetted information (i.e. Database, DirectX, hardware. etc.)?
Do people want to see more in a particular language (VB, C++, C#. PHP, etc.)
Maybe more using particular databases (Sql Server, MySQL, etc.)?
More on website code (html, xml, css, javascript, silverlight, etc.)?
Robotics? Automated home control? etc.
More on basic, moderate or advanced techniques?
Programming language tutorials for beginners?

Just some ideas. Post your thoughts. I am sure the coders in the TPU community will happily cater to users' needs if they speak up.

If people respond to this, we may be able to get the mods to "sticky" it so we can keep an eye on reader's requests and help them more.


----------



## Disparia (Feb 29, 2008)

I'd also like to see this section grow out a bit more.

*bump* so maybe more people will see this on the New Posts list


----------



## Oliver_FF (Feb 29, 2008)

Well i'm a computer science undergrad so I generally drop by to see if anyone's having any programming woes...


----------



## calvary1980 (Mar 1, 2008)

I dropped out of my 3rd year into my masters at UT, I majored in reverse engineering (cryptology) I would be willing to help anybody. I don't think programming deserves a sub-section I think it should be on it's own if that makes any sense.

- Christine


----------



## Kreij (Mar 1, 2008)

I think that because of the low volume of thread traffic in this section, that it does not really warrant a seperate section at the moment. I think that if interest were to grow, that the W1z or one of the mods would make it a seperate section.

I personally would like to see more code snippets from people, as I tend to have to bounce all over the internet to find specific topic, and it would be nice if I could find more here at TPU.

So start adding code snippets people ! 

I also think if we use a consistent format it would make searching easier ...
I use "Sample Code <language> : <description>"
Seemed to be pretty simple and straightforward, and people could just search on "Sample Code" to see all the samples.

I am, of course, open to any ideas.


----------



## Kreij (Mar 1, 2008)

After a little pondering, maybe it would be better if people just used a topic like,
"Sample Code : <description>

Then people would add posts that port it to other languages into the same post.

Just a thought.


----------



## Kreij (Mar 6, 2008)

Well as of this post, there were 159 views and 3 replies (that were not mine)
With a response result of approximately 1.9%, I don't see much interest in this section.

I will continue to post stuff as I really enjoy sharing new things that I learn.

For those code junkies like myself, hang in there, and I will always be monitoring this section to see if I can help.


----------



## Kreij (Mar 7, 2008)

Okay, I'm not quite ready to give this one up yet.
Coding is my hobby, helping people with coding is a passion for me.

So all you lurkers (guests) who are out there, make an account and give us some input.
The account is free and you don't get any spam. What more could you want?

What's your excuse? Can't think of a good user name? Who cares what it is?
PastyFace, LumpyNads, ImADoofus.  All fine names that will garner you a place of honor here at TPU.

The only thing that loses you respect here at TPU is not having the spine to sign up and post.

SO GET TO IT !!!

Okay .. end of rant.


----------



## Kreij (Mar 21, 2008)

Gratuitous bump just to keep this forum from fading into obscurity.


----------



## Kreij (May 31, 2008)

It's been a couple of months so I can safely bump this again.
Just to let people know that there is no question so simple or so complex that we will not try to help with programming problems.

Any input is greatly appreciated to make the Programming section more useful to everyone.


----------



## Oliver_FF (May 31, 2008)

My second year exams are up this week, so i'm going to write a few more articles on a few things soon 

Considering an interesting one on packet sniffing and how you can use it to check your firewalls working properly... You think that'd go down ok?


----------



## Disparia (May 31, 2008)

I've been working on the plot, characters, etc, for my SNES-est RPG.

When I have something substantial I'll start a thread on it.


----------



## Kreij (Jun 1, 2008)

@Oliver_FF : That would be great. Networking code is always interesting.

@Jizzler : Looking forward to seeing what you come up with.


----------



## Ben Clarke (Jun 1, 2008)

I'd like to see some tutorials. So I can do something more useful with my spare time.


----------



## Oliver_FF (Jun 1, 2008)

Ben Clarke said:


> I'd like to see some tutorials. So I can do something more useful with my spare time.



Any particular things you'd like to see tutorials on?


----------



## Kreij (Jun 1, 2008)

A forum is not the best medium for tutorials as they tend to get really long.
It may be better to start a tutorial link thread where people can post links to tutorials that they think are well done. 
Plus we would then have access to all kinds of tutorials from one central location.
I have quite a few links to good tutorials saved in my browser favorites on my work computer which I can share tomorrow when I am there.


----------



## Kreij (Jun 1, 2008)

Oops ... I just remembered that the sticky at the top of this forum is for tutorials 

Duh.


----------



## Oliver_FF (Jun 30, 2008)

I'm feeling a simple writeup on some of the key elements to OOP like classes, inheritance, interfaces, polymorphism, collections and generics, object types - dynamic and static and just stuff kinda like that...

Any objections? I'll give it a week before doing anything


----------



## Kreij (Jun 30, 2008)

Oliver_FF said:


> I'm feeling a simple writeup on some of the key elements to OOP like classes, inheritance, interfaces, polymorphism, collections and generics, object types - dynamic and static and just stuff kinda like that...
> 
> Any objections? I'll give it a week before doing anything



Sounds good to me


----------



## Deleted member 3 (Jun 30, 2008)

Personally I like vb.net (and I'm about the only one )

When I google for solutions I prefer the most basic examples. ie if something can be done in 2 lines, I like that example. I prefer to create everything around it myself. Besides, more code just confuses when trying to understand something.


----------



## Kreij (Jun 30, 2008)

There's nothing wrong with VB. I've used it when needed to help people code or fix problems.
It's just not my language of choice.

I usually just look for code snippets too.
Once in awhile an indepth tutorial comes in handy if you are trying to learn something new (for example, XNA).


----------



## Oliver_FF (Jun 30, 2008)

DanTheBanjoman said:


> Personally I like vb.net (and I'm about the only one )
> 
> When I google for solutions I prefer the most basic examples. ie if something can be done in 2 lines, I like that example. I prefer to create everything around it myself. Besides, more code just confuses when trying to understand something.



Visual Basic was actually my first programming language, back when I was 14 and I loved it at the time. It's really really easy to use and the debugging is stellar 

It's just difficult posting small code snippets when most of the projects I work on are large and cumbersome - once you've figured something out it quickly becomes obvious and kinda fades into the background as you tackle the next problem 

I'm considering a simple guide that goes through step by step how mergesort works (you know, when you've got a collection and call .sort() on it?) it's fiendishly clever and most of the guides out there are like "do what now? i'm lost "

Still, my packet sniffing FAQ is on the first page of google results 
http://www.google.co.uk/search?hl=en&q=packet+sniffing+faq&btnG=Google+Search&meta=
and
http://www.google.co.uk/search?hl=en&q=packet+sniffing+faq+how-to&btnG=Search&meta=


----------



## Deleted member 3 (Jun 30, 2008)

Oliver_FF said:


> It's just difficult posting small code snippets when most of the projects I work on are large and cumbersome - once you've figured something out it quickly becomes obvious and kinda fades into the background as you tackle the next problem



That works both ways. ie I'm making something, I require something to work, and the example shows a totally different program. And most examples leave you to figure out how to implement things in your situation. You end up with far too much code. I've had this various times, and then sometimes a week sometimes a few months later, I figure how I can do the same thing in a few lines.

Every time I have a new idea to create something or add functionality to something I start looking, most of the things I'm able to figure out by googling or bugging W1z.
For instance, today I had some time at work and added a link to a database to read fancy things. that are already stored. In the same way my database gains new features over time.

It actually started with an inventory list I got to maintain. The boss said it was now my work. It was made in Excel, which over time would grow and be a piece of crap. So I moved it all to Access. Now it contains far more data, is accessible via my own deployment tool, it generates and prints labels to the Dymo printer. 

Anyway, due to my previous work in Access and my hate towards "databases" made in Excel I'm extending my knowledge of vb. (Office products use vba, nearly the same as vb.net) I keep learning new things, and surely my code isn't the best out there, it's handy to be able to make things as a system admin.


----------



## Kreij (Jul 1, 2008)

@Dan : Move that bad boy to SQL Server Express. Far superior to Access.


----------



## Deleted member 3 (Jul 1, 2008)

Kreij said:


> @Dan : Move that bad boy to SQL Server Express. Far superior to Access.



Negative. Using SQL server is like using a IBM mainframe to play Pacman. Access is easy to use and big bad SQL servers offer nothing that Access doesn't. That includes performance, as this is a small database and won't outgrow Access. By the time it does it's because the company grew huge and we have other people to bother themselves with a new system


----------



## Kreij (Jul 1, 2008)

DanTheBanjoman said:


> Negative. Using SQL server is like using a IBM mainframe to play Pacman.



I had to check to make sure I was still on TPU after that comment. I though we all played Pacman on mainframes  



> Access is easy to use and big bad SQL servers offer nothing that Access doesn't. That includes performance, as this is a small database and won't outgrow Access. By the time it does it's because the company grew huge and we have other people to bother themselves with a new system



You are right in that if scalability will not be a concern, then Access is simpler to use.
Sql Server has a few other advantages but for most small database implementations, they are pretty irrelevant.

I do feel, however, that once you become comfortable with SQL Server it is pretty easy to use.


----------



## Deleted member 3 (Jul 1, 2008)

It's not that I don't know SQL, it's simply more work for me while I create stuff to take the work away. For instance, I also manage backups, which with SQL server becomes more complex. While a single MDB file can just be copied during normal backup without having to test restoring it.


----------



## Kreij (Jul 1, 2008)

I use SQL Server Management Studio Express which allows easy backup to anywhere you want.
It also will verify the file automatically (if you select the option) after it runs the backup.

But you are right, it's not as simple as just copying a .mdb file.


----------



## Oliver_FF (Jul 30, 2008)

Ok so i was going to write some more interesting things up a short while ago, but i've been really busy sorting stuff out. I'm leaving home tomorrow for the first time, going 150 odd miles cross country to start an awesome job for this huge software/hardware company , so i've been arranging everything and packing stuffs.

I'll be without internet for a good week or two, maybe more -can't wait to get back  Laters!


----------



## Kreij (Jul 31, 2008)

Best wishes on your new career !!


----------



## magibeg (Aug 8, 2008)

I think one of the reasons why we have so few responses in the programming section has to do with the reader age of TPU. I noticed theres a lot of young teens in here that probably lack any programming experience and may just be interested in reading about it but don't yet feel comfortable enough to post anything yet.

I suppose one way to gain more interest would be to have minor tutorials for game creation. Games like minesweeper, and tetris have a number of programming tutorials online already and can provide a good base for new programmers. Realizing of course that in terms of practical programming it may not be that useful but it would be a good way to get peoples 'feet wet' so to speak.


----------



## Oliver_FF (Aug 9, 2008)

I've got Internets!!! Juicy 10MB cable 

It's the weekend!!

Time to get writing some stuffs


----------



## Dark_Webster (Aug 9, 2008)

I like programming. In fact, it is one of the things that i've been doing since the beggining of the vacations. I'm learning Visual Basic so when I go to class this year, I already know how to work with it.
I've already learned how to program in Pascal, but it does suck.

I also think that this section of the forum is very undeveloped. I would like to see tutorials for some programming languages and for example, for newbies, a guide with some of the most common programming languages and give a brief description about what we can do with it. Let's hope to have more people participating in this section .


----------



## Kreij (Oct 25, 2008)

Just a bump to make sure our little section is helping others.

Post your comments people, and use this section for your programming questions.

There are a lot of people who can help on many programming languages and topics


----------



## FordGT90Concept (Oct 26, 2008)

I have some code I could release but there's always that issue of open vs. closed source...


----------



## Kreij (Oct 27, 2008)

FordGT90Concept said:


> I have some code I could release but there's always that issue of open vs. closed source...



Well if are under an NDA for contracted work, or the company you work for claims all copyright to the code you write, then I would not recommend posting it 

Most of the people who post code here are just throwing snippets out from personal projects that they are working on, or code portions that are relatively generic and just meant to help people with syntax, language usage or to explain new features.

As always, if in doubt. Don't.


----------



## FordGT90Concept (Oct 27, 2008)

All my projects are personal. 

The issue I have is that some things could be sold for profit but only if they haven't been deemed public domain already.  Obviously, not a trace of code from those will hit the interwebz. XD


----------



## Kreij (Oct 27, 2008)

Oh no, Ford, you're wrong. If you come up with a new algorithm or method of doing something that can be patented or copywritten, post it here so we can steal learn from it. 

Like I said, post code snippets that you think will help people with their own pet projects or get them moving along in the coding endeavors. 

Oliver_FF has done some great ones on networking stuff and I've done a few on user controls and using the new features in C# 3.0, as well as some older ones that I would have to go look up to see what they were about. I try to keep them interesting and try to use a writing style that is lighter and not so technical that it puts everyone to sleep.

Okay, maybe my writing isn't great, but I have not recieved any PM's from people I have put in a coma. 

Thanks for adding you code to the forum!


----------



## Braveheart (Oct 29, 2008)

"Robotics? Automated home control? etc." = yes please


----------



## Kreij (Oct 30, 2008)

Braveheart said:


> "Robotics? Automated home control? etc." = yes please



Microsoft's Robotics Home Page


----------



## Kreij (Jan 23, 2010)

It's been awhile since I toss this thread back into the limelight, but I don't want to start another thread as there are some ideas in here that people can ponder.

If you are looking for information in P&W, or would like to see something here. Please use this thread.


----------



## regexorcist (Feb 2, 2010)

While there are many sources for VB, C#, C++, javascript, PHP, etc...,
there are no where near as many sources for scripting languages
associated w/ *nix like python, perl, tcl or bash shell scripting
(even though most are multi-platform).

I like scripting in all 4, but I especially like tcl/tk and finding good sources 
w/ lots of examples has been difficult.

If I had a choice, I'd like to see more tcl and tcl/tk  (thank you)


----------



## regexorcist (Feb 2, 2010)

To start the tcl/tk ball rolling...

Here is a script I made and posted on a few different forums,
but it never got more than 1 or 2 replies or suggestions.
I'm beginning to think tcl and tcl/tk are fading into obscurity.


```
#!/usr/bin/env tclsh
package require Tk

#I wrote this simple tcl/tk script a while back
#and posted it on a different forum, but I'm posting
#it here also, so everyone sees how awesome tcl/tk can be. 
#by exiled aka debtboy aka regexorcist

#NOTE: Only tested on Gentoo, Fedora, Mint, Frugalware and Arch so far
#To run it, you must have tcl/tk installed
#copy this code into a file with a .tcl extension, something like proc.tcl
#then make that file executable and just run it
#no special permissions needed.

#The program displays various information about the system
#as well as key configuration files.
#Configuration files differ between Linux distros, so a few
#may not be available.
#All the important Linux in one place, point and click
 

proc listbox_Select {window} {

   set sel_index1 [$window curselection]
   set selected1 [$window get $sel_index1]
   set sel_name [string trim $selected1]

   #set page_display1 [exec cat $selected_file1]
   #set line_count [exec cat $selected_file1 | wc -l]

   if {$sel_name == "modules"} {
        set page_display1 [exec lsmod]
   } elseif {$sel_name == "pci-devices"} {
        set page_display1 [exec lspci]
   } elseif {$sel_name == "uptime"} {
        set page_display1 [exec uptime]
   } elseif {$sel_name == "cpuinfo"} {
        set fpath "/proc/" 
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "version"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "filesystems"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "iomem"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "meminfo"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "partitions"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "swaps"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "diskstats"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "devices"} {
        if {[file exists "/proc/$sel_name"]} {
             set page_display1 [exec cat "/proc/$sel_name"]
        } else {tk_messageBox -message "/proc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } elseif {$sel_name == "smb.conf"} {
        if {[file exists "/etc/samba/$sel_name"]} {
             set page_display1 [exec cat "/etc/samba/$sel_name"]
        } else {tk_messageBox -message "/etc/samba/$sel_name file does not exists on your system"
             set page_display1 " "
        }  
   } elseif {$sel_name == "fonts.conf"} {
        if {[file exists "/etc/fonts/$sel_name"]} {
             set page_display1 [exec cat "/etc/fonts/$sel_name"]
        } else {tk_messageBox -message "/etc/fonts/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   } else {
        if {[file exists "/etc/$sel_name"]} {
             set page_display1 [exec cat "/etc/$sel_name"]
        } else {tk_messageBox -message "/etc/$sel_name file does not exists on your system"
             set page_display1 " "
        }
   }

   .text1 delete 1.0 end
   .text1 insert end $page_display1
   #.listbox1 selection clear 0 end
}

proc menu_proc_clicked {no opt} {
   .listbox1 delete 0 end
   .text1 delete 1.0 end
   .listbox1 insert end "  cpuinfo" "  version" "  filesystems" \
                     "  uptime" "  iomem" "  meminfo" \
                     "  partitions" "  swaps" "  diskstats" \
                     "  devices" "  modules" "  pci-devices"
}

proc menu_config_clicked {no opt} { 
   .listbox1 delete 0 end
   .text1 delete 1.0 end
   .listbox1 insert end "  passwd" "  resolv.conf" "  hosts" "  host.conf" \
                     "  hosts.allow" "  hosts.deny" "  smb.conf" \
                     "  crontab" "  anacrontab" "  profile" "  protocols" \
                     "  adduser.conf" "  fstab" "  fonts.conf"
}

frame .frame_top
frame .frame_left 
frame .frame_right

font create .font1 -size 12 -family "Courier" -weight "normal" -underline "false"
font create .font2 -size 12 -family "Courier" -weight "bold" -underline "false"
font create .font3 -size 16 -family "Courier" -weight "bold" -underline "true"
font create .font4 -size 14 -family "Courier" -weight "bold" -underline "false"

label .label1 -text "FILE NAMES" -font ".font3"
label .label2 -text "FILE CONTENTS" -font ".font3"
label .label3 -text "Linux System Info Program by regexorcist" -font ".font4" -foreground "blue"
label .label4 -text "Just playing around with tcl/tk" -font ".font4" -foreground "blue"

text .text1 -width 80 -height 25 -wrap none -font ".font1"
.text1 configure -yscrollcommand {.scrollbar2 set} 
.text1 configure -xscrollcommand {.scrollbar3 set}
scrollbar .scrollbar2 -command {.text1 yview} -orient v
scrollbar .scrollbar3 -command {.text1 xview} -orient h

listbox .listbox1 -selectmode single -height 20 -font ".font2"
scrollbar .scrollbar1 -command {.listbox1 yview}
.listbox1 configure -yscrollcommand {.scrollbar1 set}
bind .listbox1 <<ListboxSelect>> {listbox_Select .listbox1}


#Declare that there is a menu
menu .menu1
. config -menu .menu1

#The Main Buttons
.menu1 add cascade -label "File" -underline 0 -menu [menu .menu1.file -tearoff 0]
.menu1 add cascade -label "Help" -underline 0 -menu [menu .menu1.help -tearoff 0]

## File Menu ##
set m .menu1.file
$m add command -label "System Info" -underline 0 -command {menu_proc_clicked 1 "System"}
$m add command -label "Config Files" -underline 0 -command {menu_config_clicked 1 "Config"}
$m add separator
$m add command -label "Exit" -underline 1 -command exit

## Help ##
set m .menu1.help
$m add command -label "About" -command { 
        tk_messageBox -message "regexorcist scripting"
        }

pack .frame_top -side "top"
pack .frame_left -side "left" -padx 10 -pady 10
pack .frame_right -side "right" -padx 10 -pady 10

pack .label3 -in .frame_top
pack .label4 -in .frame_top
pack .label1 -in .frame_left
pack .listbox1 .scrollbar1 -in .frame_left -side left -expand "true" -fill both
pack .label2 -in .frame_right  
pack .text1 .scrollbar2 -in .frame_right -side right -expand "true" -fill both
pack configure .text1 .scrollbar3 -in .frame_right -side top -fill x
```

lets bring tcl back!!


----------



## Clement (Feb 15, 2010)

Kreij said:


> Hi All,
> 
> I have put up several posts with code snippets and such concerning C# things.
> I notice that all the posts in this area get a lot of views, but very little response.
> ...



PHP
Python
Perl
AJAX
Cross-Platform C/C++/Assembly 

*Collaborative projects that anyone can contribute to.*


----------



## Clement (Feb 15, 2010)

regexorcist said:


> To start the tcl/tk ball rolling...
> 
> Here is a script I made and posted on a few different forums,
> but it never got more than 1 or 2 replies or suggestions.
> ...



Start a new thread, maybe for examples, resources, etc.?

This language seems appropriate for minimal server boxes.

If I remember correctly, it does not require a window management system or does it? (Little busy atm)

I wouldn't mind learning this language, seems very nice, and should not be forgotten!


----------



## regexorcist (Feb 15, 2010)

Clement said:


> PHP
> Python
> Perl
> AJAX
> ...


Hi Clement,

There are some exciting things going on w/ Python3
and Perl6 (which is designed for the Parrot VM), but
my Python, Perl and Parrot posts go unanswered?? 
(doesn't seem to be alot of interest here)

I'm not much good at C/C++ (yet I did write some things back in the Turbo C days),
and I've spent a few too many years writing Assembly language for 
the 8051 family of Micro-Controllers.
(I've written so much assembly, I never want to look at it again )

Now I favor Linux, Databases and HIGH level scripting languages which are  
easy to use and powerful enough for most tasks.





Clement said:


> Start a new thread, maybe for examples, resources, etc.?
> 
> This language seems appropriate for minimal server boxes.
> 
> ...


Yes there doesn't seem to be much, if any interest in Tcl except w/ IRC bots.
It is very interesting as *everything is a string*.


----------



## Clement (Feb 15, 2010)

regexorcist said:


> Hi Clement,
> 
> There are some exciting things going on w/ Python3
> and Perl6 (which is designed for the Parrot VM), but
> ...



I believe I was thinking of ncurses above, but your example works great!
Before my professor gets back to me about this encrypted content management system I am working on, I am going to play with Tcl/Tk.

We favour exactly the same things except I usually like full control. I only code on linux anymore. I usually stick to C++ no matter what, but for the past year or so I've focused on PHP/MySQL. I recently took an interest in some of these high level scripting/interpreted languages to quickly manage some basic tasks.

Are there any IDE's for Tcl/Tk that you would recommend (Or is Gedit fine?) to speed up the process of my learning further?

I suppose if I were into the business of data mining [Python/Perl] would be of more interest to me, but the work I am doing for Penn State is top priority for me. I have never and probably never will use the IRC networks.


----------



## regexorcist (Feb 15, 2010)

Thanks for trying it out!!
I would have added editing, but then evelated permissions would be needed
and it was only for fun.

Ironically I don't use any IDEs (I use *vim*), but I think there are many. 
I say Ironically, because I use the mother of all IDEs in work Visual Studio 
as I write a lot of VB (ASP.NET) and C# (C# - web services) for a living.
(I usually don't mention my work as we're a MS shop , w/ SQL server
 and Unisys, but we also have Oracle on a HPUX machine and I also do some 
scripting on that).

I much prefer Linux and scripting at home on vim.


----------



## Clement (Feb 15, 2010)

regexorcist said:


> Thanks for trying it out!!
> I would have added editing, but then evelated permissions would be needed
> and it was only for fun.
> 
> ...



Lucky you! 

Although I have been programming for going on 12 years, I can't say that my programming is my primary income anymore, it used to but I ruined that . One day it will again though.

I am using Gedit simply because it has the highlighting.

I am thinking about adding exporting to the reports, and automatic resizing of the controls. Elevated permissions for editing? That sounds kind of annoying but such is the way of these things I suppose.


----------



## Clement (Feb 16, 2010)

I was going to try to use Vtcl, but it does not like any version of Tcl other than exactly 8.5.

Any thoughts on this?

You may want to look here regexorcist:
http://wiki.tcl.tk/_/welcome

They could probably use your help!

EDIT: I'm going to stick with hand coding in Gedit for now, the 'improvements' of 8.5+ pertaining to integer/float operations makes more sense in these later versions (at least to me).


----------



## regexorcist (Feb 16, 2010)

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.


----------



## Clement (Feb 16, 2010)

regexorcist said:


> 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...).
> ...



Just a hack?  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!


----------



## Clement (Feb 16, 2010)

test.tcl:

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

$ tclsh test.tcl


----------



## regexorcist (Feb 16, 2010)

Clement said:


> 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.




Clement said:


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


Yes it will never die 

Do you have this??

```
#!/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];
```


----------



## Clement (Feb 16, 2010)

regexorcist said:


> 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.
> 
> 
> ...



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 

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


----------

