Popular recipes by Jeff Hobbs http://code.activestate.com/recipes/users/98167/2003-02-23T22:42:28-08:00ActiveState Code RecipesInline GIF image into code (Tcl)
2002-03-18T13:47:20-08:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/117247-inline-gif-image-into-code/
<p style="color: grey">
Tcl
recipe 117247
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/binding/">binding</a>).
</p>
<p>This recipe shows how to inline a GIF image directly into your Tcl code.</p>
HTTP Posting w/ File Upload (Tcl)
2002-01-24T10:55:29-08:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/109363-http-posting-w-file-upload/
<p style="color: grey">
Tcl
recipe 109363
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/binding/">binding</a>).
</p>
<p>The following script does general http posting and has support for uploading of files as well. It does this by sending the data as "multipart/form-data".</p>
Repeat procedure every X seconds (Tcl)
2001-09-10T15:20:39-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/68393-repeat-procedure-every-x-seconds/
<p style="color: grey">
Tcl
recipe 68393
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/debugging/">debugging</a>).
</p>
<p>This is a cheap rescheduler that uses the built-in after command to repeat a command every X milliseconds. It has cancel and info commands similar to the after command.</p>
Multi-character split (Tcl)
2001-09-10T10:07:20-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/68386-multi-character-split/
<p style="color: grey">
Tcl
recipe 68386
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/text/">text</a>).
</p>
<p>The split command splits a string based on each character that is in the splitString. This version handles the splitString as a combined string, splitting the string into constituent parts.</p>
Random number in a range (Tcl)
2001-09-10T11:25:18-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/68391-random-number-in-a-range/
<p style="color: grey">
Tcl
recipe 68391
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/math/">math</a>).
</p>
<p>Tcl 8.0 added the rand() expr function. Here's a simple way to return the random number in a range.</p>
Color gradient image (Tcl)
2001-09-10T12:34:29-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/68392-color-gradient-image/
<p style="color: grey">
Tcl
recipe 68392
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/binding/">binding</a>).
</p>
<p>This little script creates an image with the RGB and cyan, magenta, yellow color gradients.</p>
Obtaining the name of a procedure (Tcl)
2001-06-21T16:28:41-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65429-obtaining-the-name-of-a-procedure/
<p style="color: grey">
Tcl
recipe 65429
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/debugging/">debugging</a>).
</p>
<p>How to obtain the name of a procedure from within it.</p>
Socket based communication (Tcl)
2001-06-21T17:02:20-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65436-socket-based-communication/
<p style="color: grey">
Tcl
recipe 65436
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/distributed/">distributed</a>).
</p>
<p>Here we write the most simple socket based server application we
can think of. Starting from this minimal example it is very easy to
extend it to the actually wanted functionality</p>
Sending mail with attachments (Tcl)
2003-02-23T22:42:28-08:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65434-sending-mail-with-attachments/
<p style="color: grey">
Tcl
recipe 65434
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
Revision 2.
</p>
<p>How to send an email using the SMTP and MIME packages in tcllib (part of ActiveTcl).</p>
Tail a file (Tcl)
2001-06-21T17:03:08-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65437-tail-a-file/
<p style="color: grey">
Tcl
recipe 65437
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/text/">text</a>).
</p>
<p>Comp.lang.tcl questioners frequently demand some sort of
gadget to monitor an ongoing process and display the result in a
text. The following widget is the simplest answer I know that meets
the common intent of these requests.</p>
Parsing comma separated values (Tcl)
2001-06-21T16:53:14-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65433-parsing-comma-separated-values/
<p style="color: grey">
Tcl
recipe 65433
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>How to parse lines containing comma-separated values.</p>
Shuffling a list (Tcl)
2001-06-21T16:59:34-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65435-shuffling-a-list/
<p style="color: grey">
Tcl
recipe 65435
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>How to randomly shuffle a list</p>
Text to HTML (Tcl)
2001-06-21T16:27:26-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65428-text-to-html/
<p style="color: grey">
Tcl
recipe 65428
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/text/">text</a>).
</p>
<p>Scan the files in the current directory and wrap them into html/body tags so that netscape will display them as HTML and not as text.</p>
A minimal debugger (Tcl)
2001-06-21T16:47:46-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65431-a-minimal-debugger/
<p style="color: grey">
Tcl
recipe 65431
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/debugging/">debugging</a>).
</p>
<p>Of course, Tcl's most minimal debugger is puts. But here is a cute
little piece of code that offers some more debugging functionality (if
you have stdin and stdout available - so not for wish on Windows)</p>
Dialect for sort by... then by.. (Tcl)
2001-06-21T16:49:17-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65432-dialect-for-sort-by-then-by/
<p style="color: grey">
Tcl
recipe 65432
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/datastructures/">datastructures</a>).
</p>
<p>In a number of applications it is necessary to sort a list after
several keys, for example first after a date and then after a name.</p>
A minimal console (Tcl)
2001-06-21T16:44:30-07:00Jeff Hobbshttp://code.activestate.com/recipes/users/98167/http://code.activestate.com/recipes/65430-a-minimal-console/
<p style="color: grey">
Tcl
recipe 65430
by <a href="/recipes/users/98167/">Jeff Hobbs</a>
(<a href="/recipes/tags/debugging/">debugging</a>).
</p>
<p>The following 14-command codelet gives you a window with entry and
text widget, where you type commands into the entry, hit Return, and
get the results (or error message) of evaluating the entry content in
the text widget.</p>