@# 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



Comments:

<0> of course it can only contain a bug-ridden incomplete implementation of CL. :P
<1> If I'm not doing line by line character entry, how do I find out how much data is available for reading from the STDIN buffer?
<1> (I'm trying not to block)
<2> helo
<2> figured out the error in the logfile
<2> [Sun Apr 16 00:22:12 2006] [error] [client 192.168.1.1] Premature end of script headers: b.cgi
<2> i think that i am not allowed to pars strings as commands
<3> premature end just means you didn't put out a valid header
<3> add BEGIN { print "content-type: text/plain\n\n" } to your script
<3> then you'll see exactly what it's sending out
<4> Baka3: Are you trying to read from a keyboard?
<1> woggle: yes
<1> ack... no
<5> Elly: that page is pretty crappy!
<2> merlyn do i need to add this



<2> print "content-type: text/plain\n\n"
<1> Reading from the output of another program
<4> Baka3: What platform?
<1> linux/2.6
<3> I said inside BEGIN please
<3> BEGIN { ... }
<3> like that
<4> You can use IO::Select on STDIN to determine when a sysread() [sysread() only, not read()] will return without blocking.
<3> I mean exactly what I say, usually. :)
<4> You can also use IO::Handle's blocking() function to make sysread() fail [return undef and set $! to EAGAIN, see also perldoc Errno] instead of blocking.
<6> Errno. To access this perldoc please type, at a command line, 'perldoc Errno'. You may also find it at http://perldoc.perl.org/Errno.html
<4> You can't actually find out how much data is available in the buffer, but you can make generously sized sysread() requests and if you don't read it all still, the next select call will say it is still readable immediately.
<7> Hi Perl People!
<2> merlyn should that be above this line
<2> #!/usr/bin/perl -w
<3> Nope
<3> right after it
<3> before anything else
<2> including the begin and every thin inside the angle braces?
<3> yes
<1> woggle: Or just if(select){ if(sysread){ ... for one char until it fails... I might do that
<3> R078902 - perhaps you should hire a Perl programmer
<3> or learn a lot more before you try to do CGI stuff
<3> what you're doing is dangerous, and you're not up to the task.
<7> I have a problem to work through, but need some advice. I have an XML file that contains a store category dump (4 levels deep), and a spreadsheet of categories in columns and I need to find all the ones on the spreadsheet that don't exist in the XML file. Any thoughts?
<3> Baka3 - char at a time is extremely expensive
<4> Baka3: You can sysread() for more. If not enough data is available, sysread() will not block; instead it will return a smaller number of bytes than you request.
<7> I generally use XML::Smart for generating my XML but haven't used it for anything else.
<3> what part of that problem are you having trouble with?
<3> Smart is a good way to **** in an XML as well
<8> what is a regular expression
<3> and you can get a "slice" that you can put into a hash to compare with the spreadsheet
<8> and why is it important?
<2> merlyn "Internal Server Error"
<4> Baka3: Usually system call overhead is not a problem, but if you sysread() only a char at a time, it will probably become one.
<7> merlyn, really? great. I wasn't aware that smart could **** in too.
<3> yes - I used it on a project
<2> but i have not log file error????
<3> let's see if it was a column
<3> R078902 - HIRE A PROGRAMMER
<3> or go ask on #apache
<1> Overhead isn't that much of a problem in this case, but I'll research/play with your suggestions. Thanks :)
<3> you need to be able to do basic CGI before you get much further
<3> apparently, I didn't do a column with XML::Smart
<3> it was just a contract somewhere.
<9> Hi all: Is there a perl equivilant to the c "sizeof()"? If so, what?
<3> what do you want the size of?
<3> number of elements in an array?
<9> Yes, at the moment :)
<3> my $number_of_elements = @arrayname
<3> very simple
<5> don't ask indirect questions!
<3> @arrayname in a scalar context is the number of elements
<10> kusznir: if (@array > 3) { it has more than 3 elements }
<3> oh, hey mjd
<10> kusznir: if (@array == 17) { it has 17 elements }
<10> Hi, Randal. What's up?
<11> but sizeof is done at compile time
<3> not much. preparing for my upcoming brazil trip
<3> speaking at the Brazilian "OSCON". 5000 attendees.
<10> 5000!



<10> Wow!
<9> Ok. I was also going to use sizeof() in another part of code dealing with a hash. I'm not sure how to explain it well yet.
<3> Yeah, makes ORM's version look puny. :)
<10> Wow!
<10> <---- speechless
<8> brazil big boobs n butts
<11> kusznir: why do you think you need sizeof? Perl doesn't have malloc()
<3> I'm a keynote speaker (like last year), and I'm also doing a talk on inside-out objects for YAPC::BR (running as a track)
<3> brazil is huge into FLOSS
<9> mauke: I was trying to deturmine how many elements were in various data types.
<3> government's basically thumbing their nose at M$
<3> kusznir - you have to ask about each kind
<11> kusznir: length for strings, context for arrays, keys for hashes
<3> scalar @ARR = number of elements in @ARR
<9> Ok. So array's are handled :)
<3> sclar keys %HASH = number of elements in %HASH
<3> length $STRING = number of chars in string (usually useless :)
<3> there ya go.
<9> How about hashes? (I have a two dementional hash, and I need to know how many values each key has)
<3> you don't have a two dimensional hash
<3> you *might* have a hash where some or all of the values are also hashrefs
<9> $edge{@field[0]}{@field[1]} = 1;
<3> in which case you need to derefernce the hashref and call keys on it, just like there.
<3> ewwww
<3> no no no
<3> you want $field[0] there
<3> not @field[0]
<3> I should now recommend a good book or two for you to learn.
<9> Oops...you're right.
<3> you've learned only enough to be dangerous. :)
<3> so that means that $edge{something} is a hashref
<10> So, suppose I want to find out why the standard Java "Observable" cl*** has a method called .notifyObservers rather than .updateObservers. Who would I ask?
<9> I've got O'Reilly's learning perl and programming perl. I just don't mess with it enough to keep it strait from c, c++, java, etc..
<3> to get the number of keys of that hash, use scalar keys %{$edge{something}}
<3> kusznir - get the alpaca
<3> followon to the llama
<3> and also check out "perldoc perllol"
<6> perllol - Perl data structures: arrays of arrays. To access this perldoc please type, at a command line, 'perldoc perllol'. You may also find it at http://perldoc.perl.org/perllol.html
<3> and "perldoc perlreftut"
<6> perlreftut - Perl references short introduction. To access this perldoc please type, at a command line, 'perldoc perlreftut'. You may also find it at http://perldoc.perl.org/perlreftut.html
<3> and I've written at least a half dozen columns on refs, and nearly all of them use refs in some way
<3> see http://www.stonehenge.com/merlyn/columns.html for 220+ magazine articles.
<9> cool!
<3> but get the alapca
<3> then I can get $1.00 from you. :)
<3> (roughly)
<9> merlyn: what's the title of the alpaca book?
<9> merlyn: (I ***ume its an oreilly book)
<3> old title = mouthful = Learning Perl Objects References and Modules
<3> new title = optimized = Intermediate Perl
<3> it's the sequel in spirit and form to the llama
<3> written by many of the same people!
<9> Oh, and so I have a representation of edges in a graph where the data structure is a hash in the form $edges{vert1}{vert2} = weight; I need to find the vertex with the highest degree (most edges connected to it). Origionally I was planning on sizeof(%edges{vertex1}) and iterate through a loop until I found the max (where vert1 is incremented)
<9> Any suggestions for cleaner ways of doing this? It seems like perl should have some shortcut for retrieving the most referenced key or something.
<11> what's the type of vert1?
<9> int
<9> (scalar, I suppose in perl-speak :) )
<11> why don't you use an array?
<3> kusznir - why are you writing this instead of using the Graph::* moduels in the CPAN?
<3> or even PDL?
<9> In this case, they're int's. In the general case, they can be letters as often as ints. We're basing our work off someone elses' work.
<9> I started using a Graph::Paths module, but my partner found it to be too much work, and thus switched to this one that doesn't depend on any modules.
<3> PDL deals with matrix operations on ints very efficiently
<9> What's PDL?
<12> my $node = List::Util::reduce { keys(%{$verts{$a}}) > keys(%{$verts{$b}}) ? $a : $b } keys %verts
<3> it's in the CPAN
<12> roughly :p
<8> is there a good perl module for making fast database driven website?
<8> something liek a business sales data list?
<8> than can be used for reporting?
<12> yes but there's no support for french.
<9> Botje: so I'm not quite certian what is being referenced inside the (%{$verts{$a}})
<12> perldoc perlreftut


Name:

Comments:

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






Return to #perl
or
Go to some related logs:

dhclient.conf get nameserver
#perl
#fluxbox
reading device Bad file descriptor flickrfs ubuntu
Python StdOut.ReadLine
#fedora
amavised
ubuntu bcm43xx wmp11v27
spacing between inline elements
Telarian02



Home  |  disclaimer  |  contact  |  submit quotes