| |
| |
| |
|
Page: 1 2 3
Comments:
<0> soulfly-, sending email with tcl is just as easy as php <1> I know, and it was not my question, mate <1> :) <2> [PASTE] leprechau just pasted code at http://paste.anbcs.com/4272 (simple mailer code for tcl) <0> just incase anyone ever needs it <3> alamar leave #tcl <4> goodbye, t|to. <1> Btw leprechau <1> :P <1> ****er, don't slap me! 172 people have been wanked around! <1> ****er, don't slap me! 173 people have been wanked around! <1> ****er, don't slap me! 174 people have been wanked around!
<1> ****er, don't slap me! 175 people have been wanked around! <1> ****er, don't slap me! 176 people have been wanked around! <1> ****er, don't slap me! 177 people have been wanked around! <1> ****er, don't slap me! 178 people have been wanked around! <1> owned! <1> ;)) <1> Aye <1> ^^ <0> hehe <1> Wasn't funny :< <0> lol ... owned <0> :} <1> :< <0> lol i thought it was funny <1> It wasn't dude :P <0> that's up for debate <5> ;puts hi <6> th3dge: #901 (stdout) hi <7> "It is currently more efficient and easier to use either the array get or array names, together with foreach, to iterate over all but very large arrays. See the examples below for how to do this." <7> does this mean its better for big arrays <7> or better for everything besides big arrays? <7> and when is an array very large? <8> Gotisch: foreach is best for small arrays, I know that.. But I dunno what constitutes a "very large" array...I'd guess an array with thousands of elements... Hey, I bet http://wiki.tcl.tk/ would know! =) <7> :] <7> i just used array get and then worked with list <8> One-line summary: "When is [array startsearch] the better approach?" "Almost never, unless the array is so huge that a second copy would crash the program or thrash the virtual memory." <7> is fast enough for what i want to do <7> ye <8> BTW, using [array names] and then referencing the array like $array(element) is faster than using [array get].. <9> no its not <9> foreach {x y} [array get blah] { <9> is faster <9> especially if you use y several times <8> Now I'm obligated to prove myself... hold on.. =) <9> use a large array <8> How large? <9> i dont know <9> why dont you just ask dkf or dgp <8> ask what? There's nothing to ask... All it takes is me writing some code as proof.. Gimme a little bit. =P <10> who/what is dkf dgp ?` <9> who what is anc <11> .tcl expr rand()*10 <6> poci: #949 (256 clicks) Tcl: 4.8171189077278225 <11> .tcl expr rand()*10 <6> poci: #951 (225 clicks) Tcl: 1.3174821815069215 <11> .tcl expr rand()*10 <6> poci: #953 (232 clicks) Tcl: 2.9230245868316969 <11> .tcl expr rand()*10 <6> poci: #955 (227 clicks) Tcl: 7.2742308803248363 <10> idunno
<10> i stated the question <10> you said dkf dgp ? <9> and i answered it <10> wondered what/who it was <10> is it two nicks <10> is it two languages <10> is it a dictionary <10> is it a horse <10> ? <9> isnt it obvious from the context <10> nevermind then... <10> not that importent <12> ;for {set x 0} {$x < 1000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #969 (224631 clicks) Tcl: <12> ;for {set x 1000} {$x < 2000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #970 (222886 clicks) Tcl: <12> ;for {set x 2000} {$x < 3000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #971 (224306 clicks) Tcl: <12> ;for {set x 3000} {$x < 4000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #972 (225963 clicks) Tcl: <12> ;for {set x 4000} {$x < 5000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #973 (224446 clicks) Tcl: <12> ;for {set x 6000} {$x < 7000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #974 (225904 clicks) Tcl: <12> ;for {set x 7000} {$x < 8000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #975 (228832 clicks) Tcl: <12> ;for {set x 9000} {$x < 8000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #976 (508 clicks) Tcl: <12> ;for {set x 8000} {$x < 9000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #977 (3192647 clicks) Tcl: <12> ;for {set x 9000} {$x < 10000} {incr x} {set myArray($x) "this is array $x"} <6> [GRiMMY]: #978 (225721 clicks) Tcl: <12> foreach {x y} [array get myArray] { set answer "$x | $y" };puts $answer <6> [GRiMMY]: #979 (stdout) 7727 | this is array 7727 <12> foreach {x y} [array get myArray] { set answer "$x | $y" } <12> hmm <12> ;foreach {x y} [array get myArray] { set answer "$x | $y" } <6> [GRiMMY]: #982 (281792 clicks) Tcl: <12> ;foreach x [array names myArray] { set answer "$x | $myArray($x)" } <6> [GRiMMY]: #983 (261333 clicks) Tcl: <12> puts $answer <6> [GRiMMY]: #984 (stdout) 2166 | this is array 2166 <12> lol dunno if thats any proof <9> ;foreach x [array names myArray] { set answer "$x | $myArray($x)"; set answer "$x | $myArray($x)"; set answer "$x | $myArray($x)" } <6> RockShox: #986 (432566 clicks) Tcl: <9> hows that <9> theres overhead to using array(index) in large arrays <12> lol there ;foreach {x y} [array get myArray] { set answer "$x | $y" } <12> ..(18:40:17).. ..+[GRiMMY].. hmm <12> ooops <12> ;foreach {x y} [array get myArray] { set answer "$x | $y";set answer "$x | $y";set answer "$x | $y";} <2> [PASTE] FireEgl just pasted code at http://paste.anbcs.com/4278 (Proof that [array names] is faster than [array get] for iterating an array.) <6> [GRiMMY]: #992 (406892 clicks) Tcl: <9> 281792 vs 432566 when using the var 3 times <8> RockShox: See that paste.. Now it's your turn to come up with code that shows that [array get] is faster. =P <9> uh scroll up <2> [PASTE] FireEgl just pasted code at http://paste.anbcs.com/4279 ([array names] still faster in this case. But the margin is smaller.) <8> RockShox: It'll take more than 3... I'd guess 5+.. But basically, we're both right. <9> depends on the size of the array <9> <9> 281792 vs 432566 when using the var 3 times <9> for grimmys array <8> No, depending on how many times you reference $myarray($a) <9> and the size of the array <9> Names: 22199.04 microseconds per iteration <9> Get: 26871.45 microseconds per iteration <9> 3 references, 5000 array elements <8> Put your code on the paste site.. I don't like re-writing your proofs. <9> forget it <8> I said we're both right.. You should leave it at that.. Cuz that's what the code says. <9> didnt i say that <9> <9> depends on the size of the array <9> the thing to remember from all of this is that theres overhead to using variables in large arrays <8> It's more depending on the size of the array AND the number of times you reference $myarray($a) <9> so even if youre not iterating it
Return to
#tcl or Go to some related
logs:
#nhl #unixhelp freenode ban list limit #flash #netbsd symmetra sucks
#gamedev #linuxhelp nero freezes #windows
|
|