| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Comments:
<0> buu@ded430-deb-175-30:~/eb/plugins$ patch -i eval.pm < eval.diff <0> patch: **** Only garbage was found in the patch input. <1> buu: I'll just mail you the patch. Where to? <1> buu: nevermind. http://hobbs.dynup.net/evalbot.diff should be clean <1> applies with patch -p0 from project root <1> I'm going to go for a walk and then try to fall asleep <0> erm <0> patch -p0 foo.diff; ? <1> patch -p0 < foo.diff <2> how do I check if something is a number? <3> helllo folks <2> hello. <1> bluebeard: perldoc -q 'determine whether' <2> thanks! <0> buubot: reload <4> buu: Reloading!
<0> eval: "foo\n"; <4> buu: Return: "foo\n" <1> eval: v5.8.7 <4> hobbs: Return: "\x 5\x 8\x 7" <1> hmm... that's not quite right ;) <3> can anyone tell me how i can merge two ararys. one of active hosts, one of inactive ones, so one list should be printed showing (hostname1: active, hostname2: inactive) the arrays arte filled with the hostnames depending on they are active or inactive they go in one of the arrays. <1> buu: replace \x%2x with \x%02x please :) <5> sts: ditch the arrays and use a hash? <0> buubot: reload <4> buu: Reloading! <1> sts: @list = map { "$_: active } @active; push @list, map { "$_: inactive" } @inactive; and then sort or whatever you feel like :) <1> eval: v5.8.7 <4> hobbs: Return: "\x05\x08\x07" <1> buu: nifty keen <0> Committed revision 27. <2> heh. <2> nice <0> Yeah <0> I don't commit much <2> what's that nifty goto loop you can do with a {}? <1> I commit as often as possible. It's like saving your game ;) <0> redo ? <2> yes! <2> thanks <6> should I do 'foreach my $line (<FH>)' or 'while (my $line = <FH>)'? <2> while. <1> ryan`: the latter, unless you like wasting memory pointlessly <6> thanks. <7> I love wasting memory. <7> It gets me hot. <6> the foreach has to read the whole file in, then? <0> hobbs: Well, I do it when I think about it =/ <1> ryan`: yep. Produces a list by reading every line in the file, and then iterates over it <6> ah. yes. that is wasteful. <1> It doesn't _have_ to, strictly speaking; there's a hack that makes for (RANGE) work lazily <1> but there's no such optimization for for (<FILE>) yet that I know of ;) <0> Yay p6 <0> ! <3> thanks hobbs, i'll try to use that.\ <7> Horray, 2 days to payday. <2> chomp($answer = <STDIN>) will make $answer be chomped, right? <8> is shift equivalent to pop? <2> no <8> whats the difference? <1> jonx: they happen at opposite ends <2> Shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down <8> hobbs, hmm oh yes i just read the perldoc on it <9> 6 and 9, son, 6 and 9 <9> GumbyBRAIN, Text messages <10> $Text =~ $game->{q}->[2] i have this lung splattered all over the messages. <8> so its different then the C++ implementation of a standard stack that pushes in the front and pops from the front <1> GumbyBRAIN: And if 6 turned out to be 9, I don't mind, I don't mind <10> Mind i can to. <8> perl pushes from the back and pops from the back <0> jonx: No.. <0> jonx: Perl's stacks are bidirectional. <11> jonx: push, pop, shift, unshift are all just functions <8> oh i see <0> (Why yes, that does mean they like it from both ends!)
<11> if you us shift and pop you can make a fifo <11> um... push <8> buu :) <11> and if you use unshift and pop you get a fifo the other way <9> GumbyBRAIN, snakes on a plane! <10> Maybe #1a should be on the plane. <8> StoneToad, so if i use shift and push i could make a queue <1> jonx: Unshift and pop. Or push and shift. <8> StoneToad, shift takes from the front, push pushes from the back <11> you could also use splice if you wanted to do somethign nasty <1> everything can be implemented in terms of splice :) <8> hmm.. I am converting my perl script to C code, so I use push/shift.. i am figuring out how that would translate to the STL c++ stack implementation <1> jonx: if you use push _and_ shift, then it _doesn't_ translate to an STL stack. <11> push/shift would be a fifo.... not a stack.... <8> oops.. i mean STL queue <8> sorry <1> jonx: well then. push == enqueue, shift == dequeue <8> hobbs, i see.. thanks <8> so i could just use a std::dequeue <8> or even easier.. a std::list <1> you mean deque? No, that's entirely different <1> dequeue is something you do to a queue ;) <8> hobbs, someone in the c++ room suggested deque <8> oh :) <8> sorry <3> one more: is there an simple way to run each value of an array through regex match and replace? <1> jonx: Yes, a deque can be a replacement for a perl array in some uses <7> There's like fourty ways. <1> sts: uh, sure. s/foo/bar/ for @array; <2> eval:use strict; my ($foo=>'bar', $baz); <4> bluebeard: Error: Can't declare constant item in "my" at (eval 142) line 1, at EOF <0> sts: 325. <8> hobbs, thanks.. i will try a deque <2> damn <3> ah! thanks again hobbs <11> sts: map <1> jonx: but it sounded like you wanted a queue. <11> though hobb's is prob better <7> You could also use grep! <8> hobbs, well whatever is equivalent to push/shift <8> i thought push/shift was deque <8> remove from front, add to back <1> jonx: That's still a queue. <8> hobbs, oh.. does deque do opposite? <1> jonx: a deque lets you do either at either end (so do perl arrays, but so far you haven't indicated that _you're_ doing that) <7> eval: my @l = qw(one two three); my @new = grep { s/one/four/} @l; $new[0]; <4> ew73: Return: four <1> jonx: no... how would the "opposite" be any different? <7> Horray! <1> jonx: besides meaningless labels? <1> jonx: please apply common sense. <8> oh.. thats true hobbs <8> haha <8> yeah i deserve that one <8> i have a lot of sense, but its not too common <11> eval: my @l = qw(one two three); my @new = grep { s/one/four/} @l; @new; <4> StoneToad: Return: 1 <11> eval: my @l = qw(one two three); my @new = grep { s/one/four/} @l; print @new; <4> StoneToad: fourReturn: 1 <11> yea, @new only has four in it <1> StoneToad: eew :) <11> eval: my @l = qw(one two three); my @new = grep { s/three/four/} @l; print @new; <4> StoneToad: fourReturn: 1 <12> how do you check the size in byes of a variable? <11> like a string? <1> eval: my @l = qw(one two three); my @new = grep {s/three/four/} @l; @l; <4> hobbs: Return: 3 <12> yeah <1> eval: my @l = qw(one two three); my @new = grep {s/three/four/} @l; [@l]; <4> hobbs: Return: ['one','two','four'] <13> ew73 <1> that's... not so good ;) <11> aedwards232: if you're NOT using unicode, length($var) <12> and what if I am....?
Return to
#perl or Go to some related
logs:
#fedora dagmar lost #python howto opendchub aircrack 2.41 etch wepattack deb #debian saik0 DirectFB/core/vt: Error opening `/dev/tty0'! #gentoo
|
|