#perl
28 October 2007
Total 31 pages. You are browsing page 5/31.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
04:22 <****> Reemo, They're all documented.
04:22 <****> Didnt thought it's such a weird issue, just thought i need the right if clause :)
04:22 <****> sry, ill check that next time
04:22 <****> thanks anyway :)
04:23 <****> .
04:24 <****> Reemo: The paste d20f23b4e has been copied to http://erxz.com/pb/4995
04:24 <****> f00li5h: oh noes, empty hash
04:24 <****> f00li5h: Module meow does not appear to be in core. Perhaps capitalization matters or try using the 'cpan' command to search for it.
04:24 <****> Reemo: The paste m238042a6 has been copied to http://erxz.com/pb/4996
04:25 <****> buubot: way to be lagged
04:25 <****> pravus: Stored way
04:25 <****> yeah, you do that
04:26 <****> buubot: core blimey
04:26 <****> infi: Module blimey does not appear to be in core. Perhaps capitalization matters or try using the 'cpan' command to search for it.
04:26 <****> buubot, way
04:26 <****> apeiron: way to be lagged
04:27 * CPAN upload: Module-Release-1.18 by BDFOY
04:30 <****> core: infi
04:30 <****> Daveman: Module infi does not appear to be in core. Perhaps capitalization matters or try using the 'cpan' command to search for it.
04:31 <****>:)
04:31 <****> Daveman: Capitalization MatterS!
04:32 <****> haha
04:32 <****> Gumbybrain be infi
04:32 <****> i found a bug when you try to land something fairly quickly.
04:32 <****> :p
04:39 <****> hello. What would be the quickest way to count characters from a 250MB file? I'm on a dual-core machine, so I'm thinking two threads each just iterating through the lines would be fastest
04:40 <****> count ... charactes?
04:40 <****> yes.. like the number of A's, B's, etc.
04:40 <****> threads? fastest?!
04:40 <****> ah, so for each character, count its occurences?
04:41 <****> well two threads working on a CPU-bound task should be faster than one thread of execution, no?
04:41 <****> (otherwise, I'm sure there's some tool... although I don't know if wc is properly coding aware).
04:41 <****> assuming it's CPU bound.. maybe the slowness is in disk accesses to read the file, not to process? Seems like processing would be the bulk though
04:42 <****> why would two threads be faster than one?
04:42 <****> there's probably a way to do it with existing commands, scripts.. but are they multithreaded?
04:43 <****> threexk: the quickest? wc -c filename
04:43 <****> mauke: well, I'm on a dual-core system. Assuming dual core is still somewhat like dual processor, it seems like it could divide the execution among the two cores
04:43 <****> but then, just getting the size of the file would be a winner
04:43 <****> -s $filename
04:43 * jql points out teh obvious
04:43 <****> jql: I want to tally the individual characters.. # A's, # B's, etc.
04:44 <****> oh, how fun
04:44 <****> threexk: I think disk access would slow you down
04:44 <****> jql: unicode, encodings.
04:44 <****> perl is generally faster than the disk, as long as you don't allocate ram
04:44 <****> I'm fairly sure, without checking, that wc is a bit dumb.
04:44 <****> just speaking from experience
04:45 <****> maybe I will just try threaded and unthreaded, see if it makes a difference
04:45 <****> hrm using two reads would cause the disk to seek around
04:45 <****> Khisanth: good point
04:45 <****> yeah, divide-and-conquer massively kills log parsing and such things
04:45 <****> cf tim bray's wide finder challenge
04:47 <****> on the other hand, 250MB is small enough to be slurped :)
04:49 <****> GumbyBRAIN: http://cgi.4chan.org/r/src/1193543276648.jpg
04:49 <****> Heh nan is doing asleep at 4 in the chan.
04:51 <****> slurping on my 512MB RAM machine might be bad
04:52 <****> get moar RAM ! :D
04:52 <****> mem[Physical : 3545MB, 88.1% free | Swap : 1906MB, 100.0% free]
04:52 <****> :)
04:53 <****> yay ram
04:53 <****> GumbyBRAIN: GumbyBRAIN GumbyBRAIN GumbyBRAIN GumbyBRAIN GumbyBRAIN
04:53 <****> Echo gumbybrain echo.
04:54 <****> although, if you were gonna make it a habit to read 250M+ files, I'd whip out perl's :mmap mode, if possible
04:54 <****> and use getc() till the cows come home
04:54 <****> i read 250M+ files all the time in perl
04:55 <****> I'd do it in C
04:55 <****> i just do it line by line
04:55 <****> never have a problem
04:55 <****> I'd do it in C too, as long as it wasn't a utf8 file
04:55 <****> well, even with a utf8 file, I'd probably do it in C anyways
04:55 <****> continuation bytes are trivial to detect
04:55 <****> alot of times I make an index
04:56 <****> of file positions
04:56 <****> incase I might need to seek back to something
04:56 <****> whoops
04:57 * CPAN upload: Crypt-CCM-0.03 by OYAMA
05:00 <****> hello
05:02 <****> threexk : while( read(FILE,$c,1) ){ $h{$c}++; }
05:02 <****> XD
05:02 <****> hi, has http://www.nntp.perl.org/group/perl.perl6.language.flow/2000/09/msg325.html been implemented?
05:02 <****> michaelkohwj's url is at http://xrl.us/7rxs
05:02 <****> hi
05:02 <****> "RFC 120 (v4) Implicit counter in for statements, possibly $#."
05:03 <****> michaelkohwj: heh. pretty much all RFCs are obsolete
05:03 <****> or is it a perl5 thing
05:03 <****> mauke: oh ok
05:03 <****> 'perl 6, i mean
05:03 <****> huh?
05:03 <****> mauke: thanks
05:03 <****> the RFCs are (were) for perl 6
05:04 <****> mauke: ic
05:04 <****> tybalt89 : the solution didnt quite work
05:04 <****> which solution?
05:05 <****> yesterdays...on replacement of binary dump with hex codes in a string
05:06 <****> perlbot: doesn't work
05:06 <****> What do you mean it doesn't work? What happens when you try to run it? What's the output? What's the error message? What did you expect to happen? We need more information to help you.
05:07 <****> to replce bytes in a string with the hex number
05:08 <****> anybody...
05:09 <****> eval: $_ = 'some string'; $ans = join ' ', map{sprintf'%02x',ord}/./gs # works just fine :)
05:09 <****> tybalt89: 73 6f 6d 65 20 73 74 72 69 6e 67
Total 31 pages. You are browsing page 5/31.
First :: Prev :: [...] [3] [4] [5] [6] [7] [...] :: Next :: Last
