@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
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



Comments:

<0> More or less, yes
<1> postgres rocks my world
<2> there's some other module that does that .. can't remember what it is though .. also capable of database to Cl***::DBI
<3> tilrman: i got it :)
<4> paladin, thanks
<5> mathieu: welcome
<6> acidjazz: does it run faster now?
<1> this may seem like a silly question, but here goes, is it faster to slurp in a file and apply s/EXPR//g to the entire file or to read into an array and s/EXPR//g only the element that is needed to be operated on?, ill paste some code so i can illistrate what i mean
<7> "nachos" at 61.8.39.67 pasted "s/EXPR//g eficiency" (39 lines, 693B) at http://sial.org/pbot/17644
<8> nachos: Benchmark.pm
<1> thanks tybalt89.
<1> that code pasted above is a 'fortune' type clone, that reads in phrases that are seperated by "%\n" from a plain text file.
<1> I'm wondering if there is anything i can do to make the code more efficient.
<9> I have a subroutine that takes a folder name and constructs a path out of it. If the path already exists, it returns it from a hash, else it creates the path and returns it
<9> For 2600 calls, it takes 12 seconds
<1> i've allready made some optimizations, by only s///g on the actual quote that is to be printed, as opposed to operating on the _ENTIRE_ file.



<9> is it slow?
<10> beerboybeerboy: That's a stupid question. Is it too slow for you?
<1> but im wondering if there is any other tricks i can do to make it more efficent.
<1> i need a dictionary, efficent, no, efficient... no, maybe it was efficent. =\
<9> it's not at all stupid. I'm thinking about the time it takes for testing if the directory exists and looking up the hash
<1> i have the strange feeling nobody is listening :-(
<11> nachos, efficient
<1> thanks Pete_I
<3> tilrman: so much faster dood :)
<10> beerboybeerboy: It takes about 0.005 seconds per call.
<6> acidjazz: good deal
<9> dngor, yeah
<3> tilrman: check it
<11> he could rewrite it in C. that might make it faster.
<3> tilrman: http://code.notchill.com/index.cgi/acidjazz/view/slickpost/register.inc
<10> beerboybeerboy: That's either a problem, or it isn't. "Slow" is relative.
<12> acidjazz's url is at http://xrl.us/m7wa
<1> would somebody mind looking at my code, seeing if there is any way to optimise it at all? pasted at -> http://sial.org/pbot/17644, thanks in advance :-D
<3> tilrman: we just wrote syntax highlight support for SVN::Web
<6> acidjazz: neat :-) . . . im sure there's a better way to do it without the tempfile, but without knowing what $file is im not sure
<3> tilrman: im gonna modify the source of highlight as well and add anchor tags
<9> nachos, did you try Devel::Prof
<3> so i can #145 the end of urls to show you a certain line number
<1> no, what is that beerboybeerboy ?
<6> acidjazz: *nod* strange it wouldnt already have that
<9> nachos, it's a way to profile your code
<9> perl -d:Dprof <yourscript>
<1> interesting
<9> it'll list the subroutines which take the most time
<9> in descending order of time taken
<9> or time spent in that subroutine
<1> very interesting
<6> acidjazz: ah, it does, but the syntax is #l_145 . . . perhaps because anchor names should start with a letter
<9> you are trying to print a quote of the day kinda thingy?
<9> to make your function reusable, return the phrase that was picked and print it outside the subroutine
<1> yes beerboybeerboy
<9> nachos, why are you setting $/="%\n"
<9> you are not slurping the file anyway
<1> can i just return a scalar, is that okay in perl
<9> yes
<1> the phrases file is delimitied by %\n
<9> ok
<1> thanks beerboybeerboy
<9> remove the newline at the end using substitution
<11> chomp is more efficient.
<9> chomp is a function call
<11> it is.
<11> but so is s///
<9> pattern match/substitution is one Op
<9> well 2 Ops
<1> thanks for the help team!
<13> You're welcome nachos.
<14> is there a cd ripper encoder in perl land?
<0> I hope not.
<0> The thought scares me.
<11> it probly exists....after all, we do say perl can do anything...
<15> What sort of perlish things are looking to do with cd rippers and audio encoders?
<11> i hope never to see it though
<14> well simply something that goes online and queries CDDB then knows how to make a "rip.sh" or whatever file necessary...
<14> i mean, i can start learning perl if necessary, since it IS the goal of software to make our lives easier (or at least hopefully)



<14> i'm trying to find a portable way to improve all distributions by having a shell-based cd ripper/encoder
<13> You mean, you don't even know Perl?
<14> nope, not yet at least
<14> but we all used to be there
<15> There are N cd ripping programs out there. What's wrong with them?
<14> they aren't included with slackware, (i.e. they belong to gnome) or else they **** (like kaudiocreator)
<5> NeoSadist: cdparanoia and lame.. both command line..
<14> i can use both
<16> so, slackware ****s and some cd rippers **** :)
<17> cdrecord is in slack.
<14> but having to manually type in the titles and such tag info over and over is not fun either
<5> NeoSadist: so what is wrong with those?
<14> having to manually type in all the tag info
<5> NeoSadist: I've seen a number of command line scripts that combine those with others to do all the work.. google around.. shouldn't be hard to find
<15> As you can see by browsing through http://freshmeat.net/browse/118/ , CD ripping programs are rather numerous even if you are to ignore all the gnome ones and all the ones without CDDB support.
<14> paladin thanks
<14> woggle, thanks
<5> NeoSadist: welcome
<9> Pete_I, sorry mate but yeah chomp is faster than substitution
<18> slackware FTW
<9> is it because substitution has an inherent ***ignment?
<11> beerboybeerboy, s/// uses regex.
<9> what about chomp?
<11> chomp uses substr() or something like that.
<9> Pete_I, translate is much better than substitution
<3> [18:01] < tilrman> acidjazz: ah, it does, but the syntax is #l_145 . . . perhaps because anchor names should start with a letter
<3> tilrman: whered you find it dose?
<3> tilrman: sick! :)
<18> w3.org but i don't think anchor names need to begin with letters
<18> unless you're talking about a different kind of anchor
<3> integers are fine
<3> im sure its just not to interfere w/ stuff
<1> does perl have native bignums?
<0> It depends on the current definition of 'native bignums'
<19> Perl 6 SHOULD
<19> =)
<1> perl 6 is due around christmas time i belive?
<13> Correct.
<10> shazbot perl
<20> PERL SUNDERLIN
<0> ?!
<3> perl ****s
<5> nachos: the question is.. which christmas? >:>
<18> acidjazz: you just **** at perl. most people that share that sentiment do
<18> i'm good at perl and I tend to find it making my work easier in many ways
<3> linuxnohow: you're the one that suggested open2, the reason im back in here
<18> i did NOT suggest open2 man
<3> you did too
<3> IPC::Open2
<18> nope
<13> perlbot: act like acidjazz
<21> <3> Hi, can I paste this very long script I downloaded and let you fix it for me plz??
<18> perlbot: be acidjazz
<21> <3> CAN I BORROW SOME OF UR BRAINPOWER PLZ? I DONT WANNA LERN PEARL!@!
<1> ive been a good boy, santa is going to give me named arguments and a switch statement for christmas
<13> hahahah
<22> GumbyBRAIN: viruses v. Virii
<23> Wont be long til virii start targetting linux properly.
<1> loonix is a virus
<1> or line-ucks.
<1> i hate it when people pronounce it line-ucks. its LIN-UX
<1> what should i care i use openbsd.
<0> IT'S LOO-NUX
<1> hurrah
<0> Freak.
<10> shazbot
<20> SHAFT GRAFTED
<18> ahh, that brings back Tribes memories
<18> one of the best games evarf
<18> s/f//
<24> seen merlyn
<25> http://en.wikipedia.org/wiki/LUnix
<25> that is loo-nux


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #perl
or
Go to some related logs:

#gimp
gentoo xclock: OR xterm: error while loading libexpat
proftpd mod_tls with-modules with-libraries openssl
kitchens desining
v4l2 mplayer /dev/video webcam
gentoo Unable to open /dev/agpgart
mergefb beryl
#physics
linpal ubuntu
#oe



Home  |  disclaimer  |  contact  |  submit quotes