<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/5381" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-08-26T13:38:39-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/5381</id>

		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-08-26T13:38:39-04:00</updated>

		<published>2003-08-26T13:38:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25697#p25697</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25697#p25697"/>
		<title type="html"><![CDATA[What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25697#p25697"><![CDATA[
it could be added quite easy : remove the TCL Faq board (was there ever anyone using it ?) and add this one <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Tue Aug 26, 2003 1:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-08-26T13:06:39-04:00</updated>

		<published>2003-08-26T13:06:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25695#p25695</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25695#p25695"/>
		<title type="html"><![CDATA[What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25695#p25695"><![CDATA[
In the meantime if you want to post snippets you could just put them in the tcl forum and make the subject "Snippet: some good keywords" so they're easy to find. If there is later a snippets forum they could be moved.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Aug 26, 2003 1:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-26T06:32:13-04:00</updated>

		<published>2003-08-26T06:32:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25686#p25686</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25686#p25686"/>
		<title type="html"><![CDATA[What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25686#p25686"><![CDATA[
<blockquote class="uncited"><div>the main question was what you think about such a forum, not about the crappy post i made <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"></div></blockquote>I think such a forum would be great. (it would lead to lots of lame discussions like the one you've seen here though ;P)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Aug 26, 2003 6:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-08-26T03:38:20-04:00</updated>

		<published>2003-08-26T03:38:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25681#p25681</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25681#p25681"/>
		<title type="html"><![CDATA[What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25681#p25681"><![CDATA[
the main question was what you think about such a forum, not about the crappy post i made <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Tue Aug 26, 2003 3:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-08-25T21:47:41-04:00</updated>

		<published>2003-08-25T21:47:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25674#p25674</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25674#p25674"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25674#p25674"><![CDATA[
<blockquote class="uncited"><div><br>  Yea .. I know.. still mulling over a simpler solution than a lsearch... I'll get back to ya ;&gt;<br></div></blockquote>Not too happy with this, but, I think it's more efficient anyways:<br><div class="codebox"><p>Code: </p><pre><code>proc istclcommand {command} { expr {[info commands [string map {"*" "\\*" "?" "\\?"} $command]] != ""} } </code></pre></div>I'm probably missing some other special match characters, but you get the idea... (which is why I'm not _thrilled_ about this solution.. but hey, can't always have your cake and eat it too)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Aug 25, 2003 9:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-08-25T20:17:15-04:00</updated>

		<published>2003-08-25T20:17:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25670#p25670</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25670#p25670"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25670#p25670"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>They'll be matched  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"></div></blockquote>And then some <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> (risking false positives)</div></blockquote>  Yea .. I know.. still mulling over a simpler solution than a lsearch... I'll get back to ya ;&gt;<br><blockquote class="uncited"><div><blockquote class="uncited"><div>Then you are doing more than just reading from a text file.</div></blockquote>I was sorting a ~60Mb dictionary (text file) in memory  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"></div></blockquote>Ya.. reading a file that large could cause a bit of a freeze up.. but why do you have a 60mb quota =p<br><br>But what I suspect really was the culprit, was the non-optimized sorting implementation, but that's just pure speculation on my part.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Aug 25, 2003 8:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-25T20:01:45-04:00</updated>

		<published>2003-08-25T20:01:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25666#p25666</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25666#p25666"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25666#p25666"><![CDATA[
<blockquote class="uncited"><div>They'll be matched  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"></div></blockquote>And then some <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> (risking false positives)<br><blockquote class="uncited"><div>Then you are doing more than just reading from a text file.</div></blockquote>I was sorting a ~60Mb dictionary (text file) in memory  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Aug 25, 2003 8:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-08-25T19:54:09-04:00</updated>

		<published>2003-08-25T19:54:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25664#p25664</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25664#p25664"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25664#p25664"><![CDATA[
<blockquote class="uncited"><div>1) Procs return what ever was returned by the last command invoked inside them, so invoking "return" will give you the same result as just invoking expr, only a bit slower.</div></blockquote>Yes, already made an edit to my previous post regarding that..<br><blockquote class="uncited"><div>2) info commands accept glob patterns.</div></blockquote> They'll be matched  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"> <br><br><blockquote class="uncited"><div>Some shell companies kill processes or even nuke shells that use too much memory/cpu. (I'm a victim of this :/)</div></blockquote> Then you are doing more than just reading from a text file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Aug 25, 2003 7:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-25T19:49:36-04:00</updated>

		<published>2003-08-25T19:49:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25663#p25663</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25663#p25663"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25663#p25663"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>Using return at the end of the proc when the last comman executed returned what you want returned from the proc serves no purpose but slowing the execution down a bit. And how about a proc with glob matching chars in the name? (just being a grumpy old man tonight ;P)</div></blockquote>In english, por favor?</div></blockquote>1) Procs return what ever was returned by the last command invoked inside them, so invoking "return" will give you the same result as just invoking expr, only a bit slower.<br>2) info commands accept glob patterns.<br><blockquote class="uncited"><div>On todays computers, and the general text file, this isn't even an issue.<br>And even if it was, there is no combination that would make it more efficient.. The only thing that would add any sort of benefit, would be a max size check, if it were even an issue on today's computers.</div></blockquote>Some shell companies kill processes or even nuke shells that use too much memory/cpu. (I'm a victim of this :/)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Aug 25, 2003 7:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-08-25T19:50:48-04:00</updated>

		<published>2003-08-25T19:38:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25660#p25660</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25660#p25660"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25660#p25660"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc istclcommand {command} { return [expr {[info commands $command] != ""}] }</code></pre></div></div></blockquote>Using return at the end of the proc when the last comman executed returned what you want returned from the proc serves no purpose but slowing the execution down a bit. And how about a proc with glob matching chars in the name? (just being a grumpy old man tonight ;P)</div></blockquote>In english, por favor?<br><br>Edit: I think i get what you mean... I'll give you that one..<br><div class="codebox"><p>Code: </p><pre><code>proc istclcommand {command} { expr {[info commands $command] != ""} }</code></pre></div>Although, the 'return' is generally used for proper symantic rules.<br><br><blockquote class="uncited"><div>Reading line by line is alot slower than reading all the data at once...</div></blockquote><blockquote class="uncited"><div>Reading the entire file into memory without checking the size? I think a combination of your procs would be good...with a max size set some where <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"></div></blockquote>On todays computers, and the general text file, this isn't even an issue.<br>And even if it was, there is no combination that would make it more efficient.. The only thing that would add any sort of benefit, would be a max size check, if it were even an issue on today's computers.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Aug 25, 2003 7:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-25T19:35:48-04:00</updated>

		<published>2003-08-25T19:35:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25659#p25659</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25659#p25659"/>
		<title type="html"><![CDATA[What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25659#p25659"><![CDATA[
Here's my snippet...the amazing LIST proc:<div class="codebox"><p>Code: </p><pre><code>proc LIST args {set args}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Aug 25, 2003 7:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-25T19:34:03-04:00</updated>

		<published>2003-08-25T19:34:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25658#p25658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25658#p25658"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25658#p25658"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc istclcommand {command} { return [expr {[info commands $command] != ""}] }</code></pre></div></div></blockquote>Using return at the end of the proc when the last comman executed returned what you want returned from the proc serves no purpose but slowing the execution down a bit. And how about a proc with glob matching chars in the name? (just being a grumpy old man tonight ;P)<br><blockquote class="uncited"><div>Reading line by line is alot slower than reading all the data at once...</div></blockquote>Reading the entire file into memory without checking the size? I think a combination of your procs would be good...with a max size set some where <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Aug 25, 2003 7:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-08-25T19:19:27-04:00</updated>

		<published>2003-08-25T19:19:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25655#p25655</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25655#p25655"/>
		<title type="html"><![CDATA[Re: What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25655#p25655"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code># Checks if command is a valid TCL command (includes procs)proc istclcommand {command} {   if {[lsearch -exact [strlwr [info commands]] [strlwr $command]] != -1} {      return 1   }   return 0}</code></pre></div></div></blockquote>This can be simplified (and adjusted for non-dependencies, as strlwr is an alltools.tcl proc).. Hrm... thought about it, and proc names/commands are case sensitive, so we definitley need case-sensitive comparisons.. so out with strlwr and string tolower altogether...<div class="codebox"><p>Code: </p><pre><code>proc istclcommand {command} { return [expr {[info commands $command] != ""}] }</code></pre></div><blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code># Gets line $lineno from a fileproc getline {file lineno} { set i 0 set fp [open $file r] while {![eof $fp]} { set line [gets $fp] incr i if {$i==$lineno} { close $fp return $line } } close $fp return "" }</code></pre></div></div></blockquote>Reading line by line is alot slower than reading all the data at once...<div class="codebox"><p>Code: </p><pre><code># Gets line $lineno from a fileproc getline {file lineno} {   set infile [open $file r]  set buffer [read $infile]  close $infile  return [lindex [split $buffer \n] $lineno]}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Mon Aug 25, 2003 7:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-08-25T19:07:07-04:00</updated>

		<published>2003-08-25T19:07:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25654#p25654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25654#p25654"/>
		<title type="html"><![CDATA[What about a 'Snippets' forum ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25654#p25654"><![CDATA[
I've sometimes thought how usefull it would be to have a small forum that would allow users to post procs etc (examples at the bottom) that could become usefull for others.<div class="codebox"><p>Code: </p><pre><code># Checks if command is a valid TCL command (includes procs)proc istclcommand {command} {   if {[lsearch -exact [strlwr [info commands]] [strlwr $command]] != -1} {      return 1   }   return 0}# Gets line $lineno from a fileproc getline {file lineno} { set i 0 set fp [open $file r] while {![eof $fp]} { set line [gets $fp] incr i if {$i==$lineno} { close $fp return $line } } close $fp return "" }</code></pre></div>(i'm sorry if this post doesnt seam usefull for you, but for me with quite much alcohol in my blood right now it does)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Mon Aug 25, 2003 7:07 pm</p><hr />
]]></content>
	</entry>
	</feed>
