Feb 162012

<apeiron> So use itmore. <Teratogen> C++ is a bag on the side of C <dhoss> apeiron: i dunno what to use it for though <apeiron> Native GUI apps, if python and ruby make you rage. <apeiron> note: liberal application of high level libraries suggested <dhoss> huh. <dhoss> i didn’t think of that. <apeiron> it’s not the best suggestion. but it is the sort of thing that gives most immediate feedback. <dhoss> huh <dhoss> fascinating. <dhoss> i’ll give it a whirl <apeiron> or you could do a few rites of passage. IRC bot, etc. <apeiron> again, liberal applications of high level libraries. <apeiron> Parsing raw IRC will likely only give you segfaults. if you’re lucky. <dhoss> haha <dhoss> damn * GumbyPAN CPAN Upload: feedgnuplot-1.19 by DKOGAN http://metacpan.org/release/DKOGAN/feedgnuplot-1.19 <mordy> C isn’t hard to learn. its basic syntactical rules are much simpler than newer high level dynamic languages. the difficulty is figuring out how to use them efficiently and be able to use libraries just by readi<apeiron> if all you’ve got is a header, no manpages etc., you’re kinda fucked. <mordy> header usually have a decent amount of comments saying what they do, but that’s not an excuse for documentation <apeiron> right. By ‘just by reading their headers’ I thought you really meant ‘just function declarations’ :) <mordy> :) * GumbyPAN CPAN Upload: IO-Pager-0.20 by JPIERCE http://metacpan.org/release/JPIERCE/IO-Pager-0.20 <mordy> apparently C++ has some kind of & protyype specifier which is scary <apeiron> yeah, that’s related to what it calls references, I think. <apeiron> but I haven’t touched C++ in $YEARS <mordy> i haven’t done any C++ except from Qt, from which i understand, isn’t ‘real’ C++ <apeiron> not exactly, no, in that it has a preprocessor. <mordy> ahh yes, moc <tm604> references are one of the better features – they’re maybe somewhere between Data::Alias and Moose-style RO accessors, unlike a pointer a reference is always guaranteed to exist. <tm604> one of the things I miss most when using C, anyway. <mordy> most of the time when you’re dealing with pointers, you’re dealing with heap allocated memory <mordy> and in those cases, segfaults become welcome debugging events <mordy> even worse is that your memory has been freed and reallocated to somehting else in the same program. so you don’t get memory access errors, but your data becomes inconsistent <apeiron> segfaults are much better than the alternative. <mst> apeiron: oi <apeiron> ahum? <mst> apeiron: getting the name of a process for a pid <mst> apeiron: yes, yes, ps <mst> apeiron: but is there a saner way on *BSD <apeiron> uh <apeiron> look at the process table the way ps does <cfedde> no /proc on bsd? <apeiron> nope. <apeiron> thankfully <apeiron> big gaping security hole. <apeiron> and a kluge <thrig> doesn’t freebsd allow it optionally, or did they get rid of it? <mst> apeiron: do you have links for those two complaints? <tnt> LOL <mucker> thrig: depricated <tnt> cfedde: since when does bsd lack /proc ? <mucker> tnt: 7.0 I think <tnt> ? <perlgame><tnt> how can ELFs running under linux-compat work without a /proc ? * GumbyPAN CPAN Upload: Test-File-1.31_02 by BAREFOOT http://metacpan.org/release/BAREFOOT/Test-File-1.31_02 <apeiron> mst, the ability to see other users’ processes is a security hole. <apeiron> and it’s a kluge because of all the crap Linux shoves into it. <apeiron> herp derp, APIs are hard, let’s just shove it in /proc <apeiron> (is my raging, searing loathing for SysV showing?) <dhoss> i stopped reading at raging and finished with “erection” <apeiron> thrig, FreeBSD ditched /proc in 5.0. <apeiron> thankfully. <apeiron> you can mount it now, but nothing actually looks at it. <mordy> hi <mordy> oops wrong room <mst> this is a channel <mst> the ?: makes a group without using up a $1 number <mst> then the () is $1 <ashmew2> ($cmd =~ m/^cat(?: (.*))?/) <ashmew2> ?: is the same as $1 ?: <mst> no <mst> the (.*) makes $1 <mst> (?:…) means you have a group that the ? can apply to <mst> but doesn’t create a capture * jjore bets regexps would be much easier if people were required to learn Prolog first. <ashmew2> but doesnt the ?: (conditional operator) require a condition to work on? i mean the syntax is COND?:THEN:ELSE , right ? * GumbyPAN CPAN Upload: Dist-Zilla-Plugin-Moz-0.101 by REDICAPS http://metacpan.org/release/REDICAPS/Dist-Zilla-Plugin-Moz-0.101 <mst> ashmew2: you’re inside a regexp <mst> ashmew2: it’s nothing to do with the ?: operator <ashmew2> mst, OMG ! <ashmew2> mst, i get it * ashmew2 jumps off the window. * mst grins <ashmew2> Thanks man <ashmew2> ill look into it <ashmew2> :D * GumbyPAN CPAN Upload: DateTime-Format-ISO8601-0.08 by JHOBLITT http://metacpan.org/release/JHOBLITT/DateTime-Format-ISO8601-0.08 <roolebo> i’ve tried to create thread-safe version of a module with threads::shared but got double destruction of internal pointer… I wonder why DESTROY called twice? <mst> roolebo: can you show me the code? <mst> I suspect what’s happened is that a new thread has been spawned, thereby cloning your shared thing <roolebo> mst: sure. a few seconds to get logs from gdb. i also think it’s related to clone method, but i didn’t found details how it’s working * mst really fucking hates ithreads <mst> I don’t want gdb logs, I want your perl code. <mst> http://scsys.co.uk:8002/perl # paste here please <mauke> roolebo: DESTROY got called twice because it’s two objects <mauke> (and they had the same internal pointer) <mst> yes. the question is how he got two objects. <mauke> by spawning a thread <mst> which is what I originally said. <mst> but I was going to wait for the code <mauke> waiting for facts before jumping to conclusions? how quaint <shadowpaste> “roolebo” at pasted “double destruction” (145 lines) at http://scsys.co.uk:8002/181744 <mst> uh, so shared_clone makes a copy <mst> so you’ve already got two <mst> also, there’s already parallel SNMP things <mst> using event systems <shadowpaste> “roolebo” at pasted “OID.xs” (472 lines) at http://scsys.co.uk:8002/181745 <mst> I don’t really see what the point is of threading here <mauke> can I mention a few unrelated but awful things about the code? <roolebo> mauke: sure. i know perl only for two weeks but i’d do it better :) <mauke> $line in data_updater is unused <mauke> why the fuck is there a bare block in that while loop? <mauke> my @foo = (); is pointless <mauke> don’t use bareword filehandles <mauke> don’t ignore open’s return value <mauke> why are you using ‘readline(*STAT)’ in one line and ” in the next? <roolebo> mauke: skipping whole CPU stats <mauke> defined(chomp($request = )) makes no sense <mauke> roolebo: what? <roolebo> mauke: first line in /proc/stat has ticks for all CPUs together <roolebo> mauke: so i have to skip it <mauke> ok, how is that related to anything I said? <mauke> don’t predeclare variables <shadowpaste> “roolebo” at pasted “OID.pm” (276 lines) at http://scsys.co.uk:8002/181746 <mauke> don’t use prototypes on methods <mauke> why are you using prototypes? <mauke> why do you have 5.005 compatibility code if you’re using warnings and ithreads? <roolebo> mauke: i don’t use them in cpu.pl <pkrumins> smile http://i.imgur.com/ZgdUr.jpg <mauke> roolebo: what? <roolebo> mauke: NetSNMP::OID came from net-snmp project. i was curious how to make it usable with ithreads <mauke> er. ok? <roolebo> mst: what do you mean by parallel SNMP things? POE? <mst> also SNMP::Effective <mst> and other things <mst> I forget all of them <mst> but POE, IO::Async, AnyEvent are all usually a better option for I/O bound things than ithreads <roolebo> mst: oh, great. i think i’ll use them instead. but what should i write in the XS module to copy the internal structure? <mst> I have absolutely no idea. <mst> I’m terribly sorry, but I’m awful at XS * mst sighs <mst> FUCKING CPAN <mst> where did you restore this fucking dist from?! <roolebo> mst: me? <mst> not you <mst> CPAN.pm <mauke> roolebo: you’re not CPAN :-) <mauke> YET <mst> sigh <mst> here we go <mst> if it reanimates a build and that build was tested but not installed it gets added to the perl5lib setting stuff <mst> that would be really helpful if it was within screaming distance of what I wanted <mauke> that just means you need to scream louder <dhoss> or find a range that suits you better <Lynx_> I have a list of (tab delimiited) word pairs that I want to replace with each other in a textfile (i.e. foo t bar n bai t baz n). What’s the easiest way to do that? <mst> split “n” then split “t” <mst> then use Data::Munge’s list2re with a hash <mauke> my $fh = fopen “file.txt”; my %subst; while (my $line = readline $fh) { chomp $line; my ($k, $v) = split /t/, $line; $subst{$k} = $v; } my $re = list2re keys %subst; <mauke> $data =~ s/($re)/$subst{$1}/g <mmlevitt|> List <Lynx_> mst, mauke: thanks, didn’t know about list2re. * GumbyPAN CPAN Upload: Palm-MaTirelire-1.12 by MAXS http://metacpan.org/release/MAXS/Palm-MaTirelire-1.12 <kaitlyn> https://github.com/symkat/Daemon-Control – Welcoming feedback/testing before putting on cpan. <driller_work> I have multiple if elsif statements, something like if ($something eq “this”) { … } elsif ($something2 eq “this2″) { .. } — how do I go on with adding a IF statement within an elsif block? <kaitlyn> elsif ( $something eq “foo” ) { if ( … ) { … } }; You can nest statements. <zane> /quit <driller_work> thanks kaitlyn! <kaitlyn> You’re welcome =) <Teratogen> kaitlyn! <kaitlyn> Teratogen! <pkrumins> fandango <DrForr> Thunderbolts and lightning, very very frightening me <pkrumins> grim fandango <pkrumins> game! <mst> Brad! <DrForr> Janet! <pkrumins> I backed up this project a few days ago http://www.kickstarter.com/projects/66710809/double-fine-adventure <pkrumins> a new game by author of grim fandango! * GumbyPAN CPAN Upload: Bread-Board-Declare-0.12 by DOY http://metacpan.org/release/DOY/Bread-Board-Declare-0.12 * GumbyPAN CPAN Upload: UI-KeyboardLayout-0.04 by ILYAZ http://metacpan.org/release/ILYAZ/UI-KeyboardLayout-0.04 * GumbyPAN CPAN Upload: Text-NeatTemplate-0.10 by RUBYKAT http://metacpan.org/release/RUBYKAT/Text-NeatTemplate-0.10 <Kharec> perlbot: eval my ($a, $b, $c, $d, $e, $f, $g, $h) = rand(), rand(), rand(), rand(), rand(), rand(), rand(), rand(); <perlbot> Kharec: 0.501374150900197 * GumbyPAN CPAN Upload: Getopt-Euclid-0.3.4 by FANGLY http://metacpan.org/release/FANGLY/Getopt-Euclid-0.3.4 <LeoNerd> Surely = map { rand() } 1..8; ? * GumbyPAN CPAN Upload: WWW-Mechanize-Firefox-0.59 by CORION http://metacpan.org/release/CORION/WWW-Mechanize-Firefox-0.59 <Kharec> LeoNerd: surely :) <tybalt89> did you mean? my ($a, $b, $c, $d, $e, $f, $g, $h) = ( rand(), rand(), rand(), rand(), rand(), rand(), rand(), rand() ); <huf> lovely raaand, lovely rand <tybalt89> Kharec: you’re missing () <Kharec> tybalt89: I’ve seen, thanks :) <Kharec> Can I write a stuff like: $a*$e+$b*$g ? <mst> yes <Kharec> o/ <Kharec> thanks mst <LeoNerd> Though those are silly variable names <mst> http://perldoc.perl.org/perlop.html tells you about the precedence <LeoNerd> Avoid $a and $b, especially <Kharec> mst: thanks <Kharec> LeoNerd: it’s just for somme math stuff, no need very intelligent variable names :) <Kharec> some * <LeoNerd> Use an array maybe? <LeoNerd> my @rands = map { rand } 1..8; <LeoNerd> # there now nobody needs to count that there’s 8 of them <Kharec> Will seen, thanks for the idea. <Muska> could someone help me with setting up scp to use my public key? I’m using activestate and I’m not seeing much information via google to specify my key for login <rindolf> Muska: you should put the key in the ~/.ssh/authorized_keys in the remote host. <huf> ssh-copy-id user@host <huf> and tada <rindolf> Muska: the public key – not the private one. <rindolf> Muska: or what huf said. <huf> what i said only works if you can get in via password <huf> if not, do what rindolf said <rindolf> Whitney Houston has passed away. :-( <Muska> well I’ve got regular authentication setup and key authentication setup. what I don’t understand is how to specify my key in the perl script * GumbyPAN CPAN Upload: Nginx-Runner-0.000001_2 by UNDEF http://metacpan.org/release/UNDEF/Nginx-Runner-0.000001_2 <huf> probably depends on the ssh module you’re using <huf> dunno tho <Muska> NET::SCP or NET::SFTP should be fine <Muska> I’m just trying to copy some files over ssh and I Think either one will do the trick <huf> both of them explain how * GumbyPAN CPAN Upload: Inline-0.50_01 by SISYPHUS http://metacpan.org/release/SISYPHUS/Inline-0.50_01 * GumbyPAN CPAN Upload: Socket-1.97_002 by PEVANS http://metacpan.org/release/PEVANS/Socket-1.97_002 * GumbyPAN CPAN Upload: Finance-Quant-0.07 by SANTEX http://metacpan.org/release/SANTEX/Finance-Quant-0.07 * GumbyPAN CPAN Upload: Module-Runtime-0.012 by ZEFRAM http://metacpan.org/release/ZEFRAM/Module-Runtime-0.012 <tsousa> what is a good follow up of the perlintro docs? <tsousa> perl cookbook? another docs? * GumbyPAN welcomes CKEITH – Colin Keith to CPAN! <tsousa> can someone please help me? just point me the way <mst> Modern Perl ? <mst> http://perl-tutorial.org/ has a load of links too * Cipher-0 ponders post-modern perl. <rindolf> Cipher-0: Moose is post-modern. * Cipher-0 ponders post-apocalyptic perl <rindolf> Cipher-0: heh. <infrared> how may I display the pod I made without installing the module everytime to review? <infrared> err.. i think i ust figured it out * GumbyPAN CPAN Upload: Module-ExtractUse-0.24 by DOMM http://metacpan.org/release/DOMM/Module-ExtractUse-0.24 * GumbyPAN CPAN Upload: Log-Dump-0.13 by ISHIGAKI http://metacpan.org/release/ISHIGAKI/Log-Dump-0.13 <tsousa> Is perl a good language to do some web development? <DrForr> I would hope so, lots of places I know use it. <rindolf> perlbot: web frameworks <perlbot> rindolf: Catalyst, CGI::Application (and subclasses / extensions), Jifty, Continuity, Mojolicious, Dancer, SweetPea, WebGUI, labyrinth.missbarbell.co.uk, Web::Simple <pkrumins> hi rindolf <rindolf> pkrumins: hi. <pkrumins> rindolf: i put perl book ads on your site! <rindolf> pkrumins: I saw your ad about the Perl one-liner book on http://www.shlomifish.org/ – thanks. <pkrumins> yes :) <rindolf> pkrumins: yes, I saw. <pkrumins> rindolf: do you plan to add them to your perl site? <pkrumins> rindolf: if you did, i’d advertise right away <rindolf> pkrumins: I’m still undecided about it. * GumbyPAN CPAN Upload: B-Hooks-EndOfScope-0.09_02 by RIBASUSHI http://metacpan.org/release/RIBASUSHI/B-Hooks-EndOfScope-0.09_02 <rindolf> pkrumins: http://perl-begin.org/ is not getting a lot of traffic anyway. <pkrumins> rindolf: how much traffic is it getting? <rindolf> pkrumins: I can check my logs. <pkrumins> total uniques per day <pkrumins> please do <rindolf> pkrumins: but much less than www.shlomifish.org <rindolf> pkrumins: OK, I’ll do it when I get home. <pkrumins> rindolf: maybe you can add my book to “News”? <rindolf> pkrumins: yes, I can. <pkrumins> :) <rindolf> pkrumins: I can also put it under some of the pages <pkrumins> that would be so great! <rindolf> pkrumins: I think I’ve acculumated quite a lot of stuff I’d like to do with perl-begin.org, but I’m busy. <pkrumins> you should free 1 day up <rindolf> pkrumins: the source for perl-begin is on https://bitbucket.org/shlomif/perl-begin and I accept pull requests. <pkrumins> :) ) <pkrumins> rindolf: i shall send you a pull request! <rindolf> pkrumins: thanks. <rindolf> pkrumins: well, if you’d like to build the site you’ll need to install Latemp and its dependencies. <pkrumins> rindolf: ah <rindolf> perlbot: latemp <perlbot> rindolf: Latemp – http://web-cpan.berlios.de/latemp/ – rindolf’s pet CMS, if you can call it that. <pkrumins> thanks <rindolf> perlbot: relearn latemp is Latemp – http://web-cpan.shlomifish.org/latemp/ – rindolf’s pet CMS, if you can call it that. It’s an offline CMS, and does not aim to be the same as online CMSes like Drupal. <perlbot> rindolf: Stored relearn latemp is Latemp – http://web-cpan.shlomifish.org/latemp/ – rindolf’s pet CMS, if you can call it that. It’s an offline CMS, and does not aim to be the same as online CMSes like Drupal<rindolf> perlbot: relearn latemp as Latemp – http://web-cpan.shlomifish.org/latemp/ – rindolf’s pet CMS, if you can call it that. It’s an offline CMS, and does not aim to be the same as online CMSes like Drupal. <perlbot> rindolf: Stored relearn latemp as Latemp – http://web-cpan.shlomifish.org/latemp/ – rindolf’s pet CMS, if you can call it that. It’s an offline CMS, and does not aim to be the same as online CMSes like Drupal<rindolf> perlbot: eat flaming death. <rindolf> perlbot: you’re stupid <pkrumins> perlbot: be mjd <perlbot> pkrumins: YOU CAN’T JUST MAKE SHIT UP AND EXPECT THE COMPUTER TO MAGICALLY KNOW WHAT YOU MEAN, RETARDO! <pkrumins> perlbot: be mjd <perlbot> pkrumins: YOU CAN’T JUST MAKE SHIT UP AND EXPECT THE COMPUTER TO MAGICALLY KNOW WHAT YOU MEAN, RETARDO! <rindolf> perlbot: be pkrumins <perlbot> rindolf: CAN I BORROW SOME OF UR BRAINPOWER PLZ? I DONT WANNA LERN PEARL!@! <rindolf> Heh. <supplicant> perlbot: jerk it <perlbot> supplicant: Couldn’t parse http://www.irc.perl.org/bin/jerkcity.cgi because LWP Request Failed at /home/ryan/perl5/lib/perl5/XML/SAX/PurePerl/Reader/URI.pm line 51. <rindolf> perlbot: latemp <perlbot> rindolf: Latemp – http://web-cpan.berlios.de/latemp/ – rindolf’s pet CMS, if you can call it that. <mst> supplicant: we know, we’re fixing it