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



Comments:

<0> sili_, what's a good method?
<1> bluebeard_: to separate your model and view
<0> right now I'm $body .=ing.
<2> If you must output some data, organize the data sanely, and write a module that will pragmatically generate HTML for you using something like HTML::Treebuilder.
<1> bluebeard_: i recommend mason, but you probably want to do it sloppier than that. just use CGI
<1> CGI.pm, that is
<2> Mason and Template-Toolkit are good choices, too.
<1> a customized mason is about as good as it gets
<3> (separation of presentation and application logic)++
<1> i say.
<0> I'd rather keep my includes to a minimum
<1> sounds like a silly philosophy.
<0> why?
<0> I'm checking out mason, though.
<1> cpan Template
<1> cpan: Template



<1> gay.
<1> http://search.cpan.org/dist/Template-Toolkit/lib/Template.pm
<4> Woo,
<5> GumbyBRAIN: gay
<4> I win
<6> I think graham chapman was gay.
<2> GumbyBRAIN: Was Ted Kennedy gay?
<6> Was ted kennedy for everything but the gay who made the problem go away.
<1> buu: doesn't your gaybot have a "cpan" function thing?
<4> It used to.
<1> i see.
<2> I think 'the problem' is a euphamism for something dirty.
<4> The code made me cry
<0> sili_, I tend to have that philosophy, because things tend to get upgraded, then stuff breaks, and you've gotta go around and fix it all.
<1> plus it fails like 90% of the time
<4> sili_: Yeah, it can't find modules that don't exist
<4> That was coming ni 1.2
<1> bluebeard_: that's why documentation is so nice
<4> sili_: http://search.cpan.org/perldoc?Template::Toolkit
<0> it's still extra work.
<4> hrm
<1> bluebeard_: doing things right usually involves some sort of work, unforunately
<4> perldoc strict
<7> strict. To access this perldoc please type, at a command line, 'perldoc strict'. You may also find it at http://perldoc.perl.org/strict.html
<2> I've always been one to think, "I create more work for myself now, on the chance that it might save me work in the future."
<2> Nuts to well-documented code. If I make it monolithic, I won't have to worry about changing it EVER.
<0> ew73, well using a templating engine seems like less work.
<0> LOL
<0> also, I don't have alot of static content, at all.
<4> SATAN
<4> bye
<2> buu: I want to sleep, but I'm not tired. :(
<0> I infact have no static content, it all updates ~ once every 5 minutes.
<1> ew73: drink booze.
<1> ew73: or overdose on <drug of your choice>
<3> bluebeard_: TT is fairly substantial. if you're looking for something simpler, HTML::Template might fit the niche.
<2> sili_: I'm saving both for Monday! :(
<1> there's also Text::Template.
<1> Text::Template lets you write perl
<3> sili_: again breaking the application and presentation logic separation concept ;)
<3> sili_: why don't you just use PHP!
<0> heh.
<2> i write my web appz in vb.net
<0> that's actually one of the main reasons that I'm hesitant, because on a website with a PHP content management system I administer, the host upgraded php, and broke the templating engine.
<3> 500 Internal Server Error VBRUN500.DLL NOT FOUND
<0> and the templating engine to this day doesn't work with the newer version of php.
<0> lol
<0> visualbasic html.
<0> that makes sense.
<2> Then, thank god, you had the two seperated and it was easy to pop in a new templating engine, right?
<3> php programmers are not known for writing robust code
<0> negatory, propriatary templating engine.
<8> PHP can run robust code?
<2> See, that's where you're missing the point.
<3> dec: touche'
<2> The idea is to seperate Things That Make Output and Things That Make Data, so if one breaks, the other doesn't also need to be rewritten.
<0> I remade it in a seperate PHP file that still separates it, it just doesn't use any sort of engine.
<0> thus my hesitance to use HTML::template, or Mason.
<3> also to allow separate divisions of people to maintain the code, without trampling on the other team's work.
<3> er, maintain their aspect of the application



<0> yea.
<9> bluebeard_: use mason, it's fun, and the whole family can enjoy it
<0> umm
<2> I use mason and Catalyst for ***y web development.
<3> heh, newest memepool.com post is funny. some guy ebay scammed a broken laptop, but left it full of personal information and bizarre porn
<0> LOL
<2> infi: I saw that. The crazy lady licking stuff has become an LJ icon.
<0> ah, well since amazon.com uses mason, I guess I'll use it, too.
<2> Why? Amazon ****s! I hate amazon! AND their damn tall nubian goddess-like women with their gr*** skirts and spears and crazy feather headdressess and snu-snu huts!
<0> ummm
<0> because I have a possible in with a perl internship
<0> which is why I'm learning perl at all.
<0> ah, now I sleep.
<0> haven't done any work in ~ 2 hours.
<3> why would be you working at like 3am on Saturday night anyway?
<1> buu: send me the phantom edit
<3> bluebeard_: go out to the Hurricane and get good eats. (well, "eats" anyway)
<10> while($stored_sid = $sth->fetchrow_array) { } executes only once for me; but I know that there were really 11 rows returned from $sth->execute because I check and print the return value from execute().
<3> why are you using an array in scalar context?
<3> read what fetchrow_array() returns again in perldoc DBI
<10> infi: the query executed only returns one column. The docs for DBI say that it is alright to use fetchrow_array() in a scalar context if there is only one column and you don't care about the misrepresentation of NULL.
<11> I am the black wizards
<10> infi: and yes, I've tried it in list context too; but the loop still only gets executed once.
<11> let me tell you guys something
<11> the only thing i remember about last night is that I was walking around wal-mart barefoot
<0> infi, I have no life....
<0> I'm going to change this by next weekend though...
<10> bluebeard_: what's next weekend?
<3> bluebeard_: plenty of stuff to do in Seattle proper. not so much in LEBARK ;)
<11> just drink beer and walk around places without any damn shoes
<12> oh yes
<12> barefoot is the new pink
<10> infi: should I still be waiting for a response?
<0> infi, not if I can't buy booze legaly...
<3> rutski89: probably not ;) maybe paste code to pastebin
<10> infi: there's nothing to paste. I $sth->execute() returns 11, I do that loops, it only executes once.
<0> sonova bitch! my internet is being too slow
<12> INTERNETS
<0> no, my internet.
<12> didn't you know
<0> I'm connected to the internets.
<12> the internet went down last night
<12> for 40 minutes
<12> someone spillt beer on the server
<0> china made a new virus?
<12> beer virus
<12> I left my apartment last night
<12> with the damn door wide open
<0> LOL
<0> the tachikomas sacrificed themselves!
<0> so cool
<13> "rutski89" at 68.198.111.53 pasted "The while loop only executes once, yet $sth->execute() returns 12, which means that there is certainly more than one row to loop over." (26 lines, 688B) at http://sial.org/pbot/17384
<3> rutski89: aha, it's the return value of ->execute that you are confused about.
<10> infi: you sure?
<3> rutski89: The "execute" method does not return the number of rows that will be returned by the query (because most databases can't tell in advance), it simply returns a true value.
<3> (from perldoc DBI)
<10> infi: well it seems to be pretty good at returning the same value as there are rows returned by the query
<10> i just inserted a new row
<3> anyway, perhaps a use Data::Dumper; my $aryref = $sth->fetchall_arrayref(); print Dumper($aryref); will show you what is going on.
<10> and now execute() returns 13
<10> instead of 12
<3> rutski89: if it does, it's a coincidence. DBI only guarantees a true value. don't rely on undefined or implementation-specific behaviour.
<10> just did another, now it's returning 14
<3> but anyway, try the last line.
<3> OK THAT'S NICE. DON'T CARE.
<10> and 15
<10> hehe
<10> the point is that the query is returning more than one row; i know not just because of what execute() is returning, but because it returns more than one row when I execute the query in psql from a shell.
<10> ok, i'll try that last line
<3> DBI doesn't even guarantee $sth->rows to return a correct response on all databases until the end of all the rows are fetched (though it works on many RDBMS').
<3> don't rely on that kind of behaviour.
<14> use count() to get the number of rows
<10> infi: yea, I not relying on it. I was just pointing out that in my case it wasn't returning an arbitrary true value.
<3> that's very nice.


Name:

Comments:

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






Return to #perl
or
Go to some related logs:

ubuntu libX0
aprs ubuntu
ProLiant 1600 bad data from kbc
XEN UBUNTU 64
unable to access resume device LABEL= -raid
java wine ie6 ubuntu
dns use UDP
ESPANIAN SEXY BOYS
#linux
sdwrage



Home  |  disclaimer  |  contact  |  submit quotes