@# 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 32 33 34 35 36



Comments:

<0> always always always
<0> Bruce_LeeRoy: use ===
<1> numist: The false "false" one is a good example.
<0> Krazylegz: yus
<2> hmmm
<0> or the false == 0 vs false === 0
<0> all. the. time.
<3> Bruce_LeeRoy, see http://php.net/types.comparisons
<4> thanks guys :)
<0> dools: that code is ridiculous :P
<5> numist: haha i know, it's the craziest piece of code i've ever produced :-)
<0> dools: did you var_dump your ob output just to see what was there? seems like it might be interesting
<5> numist: except for my way of ensuring a number is positive: (int)preg_replace('/-/','',$num);
<0> you have to be kidding
<5> numist: but (string)$inst works a treat!
<0> whats wrong with effing abs() ?



<0> to make sure its pos?
<0> calling preg for that is like shooting goldfish in a pet store with a tank
<5> numist: hehe someone asked in here how to do it and i suggested pow the sqrt
<0> o_o
<5> numist: and everyone rofl
<5> numist: so that was my next answer :-)
<0> http://us3.php.net/manual/en/function.abs.php
<0> good lord
<5> numist: i kind of like that one
<3> if ($str{0} === '-') $str = ltrim($str, '-'); :)
<0> not only does it rape the relaxed typing of php
<0> but...
<0> ...
<0> I mean jesus christ
<5> philip: that's awesome!
<0> convert to a string, preg it, and then convert back to an int?
<3> heh
<0> thats the most inefficient way I've ever seen to do that
<1> I think I have to leave. I'm not allowed to see code like this.
<6> philip WTF?
<6> philip and {} are depreciated!
<5> numist: using (string)$inst instead of ob functions saved 5609 microseconds over 10,000 executions
<0> haha nice
<5> numist: bloody beautiful!!
<6> NO CARRIER
<0> dools: thats still ridiculous
<7> hi
<5> numist: meh, gets the job done!! it's a sure fire way to identify an object uniquely
<7> so I've got php5 with apache installed on winxp
<0> dools: what was the total execution?
<3> [] {} keeps changing, screw that!
<0> 5609 microseconds doesnt sound that big
<6> philip: ****, I never changed from [] in the first place =)
<7> and it's not showing the code in the browser, and it's not prompting to just download the file.....but it's saying doesn't recognize require_once()
<8> http://pastebin.com/593950, what am i doing wrong here?
<5> numist: using (string)$inst it took 1626 microseconds to run 10,000 times
<4> can you only p*** a certain amount of variables through the url?
<9> folks, is it worth to hold description on all my input fields (type => string, len => etc..) in XML || array, and use it for auto validation, or it`s better to do validations manual ?
<0> ok, cool
<3> next it will be $str|0|
<7> humm...maybe I'm just retarded and it can't open the file
<0> ha
<5> numist: that's not too bad really, i think i can put that in my constructor... until something better pops up :-)
<0> (string) works just fine
<3> Bruce_LeeRoy, not number of variables, but size of the query string is a concern. search google for max sizes of each browser
<0> I'm kinda surprised it doesnt trigger some sort of warning though
<4> philip, ok, thanks
<0> typing an object to a string...
<3> php is loose as a goose
<5> numist: same thing that happens when you do echo($inst); i guess
<0> dools: nice
<9> any sugestions ? :)
<0> Evangelist: depends on how much data you need to check
<0> Evangelist: you probably also want to enforce typing somehow
<8> http://pastebin.com/593950, what am i doing wrong here?
<9> Evangelist, i`m care more for strip developer to do some mistaces or forget some validations, the data depends



<9> but i also worry about my app performace
<9> i`m not sure how much this will slow the things, if i have to parse XML to generate validations
<9> i use this XML file (for each action), to generate XHTML via XSLT
<0> Evangelist: a bit, but if you have to do a lot of checking, or your requirements change a lot, its worth it to have the flexibility
<5> Evangelist: i recently wrote an engine to do auto validation, but i implemented a separate markup language to do it, with a <validation type="REQUIRED|NOT|MATCH|GREATER_THAN ... etc." value="someval"><error-message>You did something wrong!</error-message></validation> structure, then i parse the XML, cache it into straight PHP with an ***ociated serialised Form cl***
<5> Evangelist: then when i load the form, check if hte markup changed, if it did, reparse, otherwise just load the serialised object with all the validation in it and validate away!
<9> dools, why you choose markup language instead of array ?
<5> Evangelist: because it had greater flexibility
<5> Evangelist: hang on a tick, i'll show you an example
<5> Evangelist: i'm about to release it as open source, by the way :-) ... but just hold on, i'll do a pastebin of what i mean
<9> okay, thanks ;)
<9> i`m wondering for some kind of propel way, to use XML for validation and to do some kind of ORM, but not sure yet
<9> but i think that developer will be overburned with files for modifying
<9> *overburdened
<5> Evangelist: http://pastebin.com/593961
<10> Is there any way to declare a string variable with a set of text that contain both single and double quotes? That is to say WITHOUT using heredoc, or without having the ability to escape indivudal characters in the string?
<10> containts* individual*
<10> contains*
<10> Yikes
<11> dools: Do you know if there is a PHP function that compares 2 string such as close_enough( 'apartment', 'appartmeant' ); returns true ?
<10> Spelling distaer tonight.
<10> Hah. :P
<5> thehil: look into metaphone
<11> dools: what's metaphone?
<5> Evangelist: i've got custom widgets like checkboxes, dropdown, radio-group etc. that you can set options on, and several validation types, plus you can do CUSTOM validation as well
<5> thehil: www.php.net/metaphone
<9> dools, thats interesting approach :)
<5> Evangelist: if you want, you can download the code and take a look, if you pm me your email i'll send you a link
<9> dools, yes, i see them
<5> Evangelist: but the docs are incomplete, so i don't want to post the link in here for all to see !!!
<1> thehil: levenshtein?
<1> !+levenshtein
<5> Krazylegz: i actually did one where i took the levenshtein distance between two metaphone codes so i could use it on phrases... worked wel but it was hella slow
<1> Ah.
<9> dools, how do you handle with this type of approach foreach etc... ?
<0> dools: levenshtein is slow by definition...
<0> someone want to break some code for me?
<5> Evangelist: well, that depends!! i flat out didn't implement loop through and creating, say, 10 checkboxes, but i have <dropdown> <checkboxes> <list> etc. that create loops using an <option-pattern> node. but i figured that's where the automatic validation would end. if i need to loop through and create, say, twenty drop downs, i just do it manually. implementing a generic framework to do that seemed kind of hairy
<5> Evangelist: sorry, that sentence was screwed up :-)
<5> Evangelist: i meant 10 text boxes
<9> :P
<5> Evangelist: but maybe in the future ...
<11> Krazylegz: what's levenshtein?
<1> thehil: http://us2.php.net/manual/en/function.levenshtein.php
<12> evening... I'm looking for a little php help.
<12> Maybe a pointer to a good, simple tutorial on database access.
<13> puff http://php.net/mysql
<13> ***uming you're using MySQL
<12> I'm an experienced programmer, perl, java, been doing CGI scripts and servlets since 1995, so I'm looking for something that's written for a more technical reader.
<11> Krazylegz: thanks but metaphone is better
<12> Greenbox: Yeah, I'm using mysql.
<1> Alrighty.
<12> How about sending email?
<12> I got tired of fighting this PHP app so I'm just trying to code up a simple php script to save the data submitted to a simple mysql table, email a copy off to let the site manager know about it.
<12> Hm, is there a php mode for emacs?
<1> puff: I use htmlMimeMail, I think people like to use PEAR::Mail now.
<12> Krazylegz: I just need the shortest, quickest way to send it... the mail is more of a backup.
<14> I have use PEAR MIME_Mail - pretty easy
<2> puff:yes
<2> you have a php mode
<1> puff: There is also a mail function built-in to PHP.
<12> Krazylegz: Got a pointer to an example?
<1> http://us2.php.net/manual/en/ref.mail.php
<12> guru[1]: This one? http://ontosys.com/src/php-mode.el
<12> Krazylegz: Danke.
<1> puff: Bitte.
<15> is there any way of doing PAM authentication via PHP? I want to check the username and p***word
<2> whats PAM?
<15> Pluggable Authentication Modules
<15> basically it's apart of every Linux system
<15> it's what manages your p***words and users


Name:

Comments:

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






Return to #php
or
Go to some related logs:

#web
eternal_drake
chmextract
#css
#perl
#perl
configure conky
highest value array maximum inurl:python
bochsrc: directive 'vga' not understood
airhack



Home  |  disclaimer  |  contact  |  submit quotes