| |
| |
| |
|
Page: 1 2 3 4 5 6
Comments:
<0> the other option is to re-mod the result i had <0> strlen($binstuff) + (8 - strlen($binstuff) % 8) % 8 <0> but that's just crap <0> ooh, even better <0> duh <1> @php $binstuff="101"; $size=strlen($binstuff)+(8-(strlen($binstuff) % 8)); echo 'Size needed: '.$size; <2> Result: Size needed: 8 <0> no.. it's so obvious <0> @php $binstuff="101"; $size = 8 * ceil(strlen($binstuff) / 8); echo $size; <2> Result: 8 <1> doh <3> $binstuff="101" $size=8 - strlen($binstuff); echo $size; <3> ? <0> no no <0> consider $binstuff = "1011001001001"; <3> Hrm.
<0> what you had would only work for 8 or less bits, in which case you'd readd the length to get the target length, in which case it would be a constant 8 anyway <3> Well, if I calculate the length of my longest binary string <0> we want to get the least length required to pad to the next requied multiple of 8 <3> would it be bad manner to statically ***ign it like that? <3> Oh <3> I see what you're trying to do <0> @php $binstuff="101100100100"; $size = 8 * ceil(strlen($binstuff) / 8); echo $size; <2> Result: 16 <0> see? <0> @php $binstuff="10110010010111110"; $size = 8 * ceil(strlen($binstuff) / 8); echo $size; <2> Result: 24 <3> yeah <0> @php $binstuff="11110000"; $size = 8 * ceil(strlen($binstuff) / 8); echo $size; <2> Result: 8 <0> if it's already a multiple, it stays the same <1> 01010101010101100100101101001010101010010000001100101010110100110010101101001101010101010101010101010101001100100000100110010101100101010110011000100101100010110001110001100011010001100101010111010101100101000101101001011101001101010101010101101010011001101010101010100010101010100101011001001101010010! <0> you're not going to make me decode that are you? <3> And then I could do something like $pad = strlen($binstuff) - $size; <0> just tell me if it actually says something now so i dont waste my time <0> Moridin: no, that $size is precisely what you'd p*** to str_pad <4> whats wrong with this line: if (!empty(trim($part_num[$i]))) <1> it's random <0> sofresh: well you tell us <4> Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /var/www/apache2-default/personal/process_etd.php on line 23 <0> kicken: good <1> sofresh read the manual page on empty() <1> @empty <2> (PHP 3, PHP 4, PHP 5) <2> bool empty ( mixed var ) <2> Determine whether a variable is empty <2> http://www.php.net/empty <4> so shouldnt it be enough to satisfy the if statement? <4> a returned value in the paranethesis? <1> read <0> depends on what you want to happen for each case <0> if you want the if block to execute for any trimmed value that php does not consider empty, then sure you're all set <0> and i bet that's exactly what it's doing <4> i want to process only those fields which were populated <3> Oh <3> I'm reading about str_pad wrong <0> so read about what empty() considers empty <0> is that so difficult? <1> Note: empty() only checks variables as anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). <3> For some reason, I was sitting here thinking that I had to tell it how many places I wanted it to pad by. <0> mmm, yeah see? if you had read the manual i wouldn't have had to make an *** of myself <4> oh i dee <4> see <0> bastid <4> i got the inspiration from teh manual, but didnt read that it wouldnt work <4> php is pretty fcked if you cant even do that <0> actually.... <4> dont you think <1> no <1> empty performs the same action as isset() <0> @php echo empty("i wonder how obvious the error message is"); <2> PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '$' <1> isset("abcd") is pretty dumb, don't ya think? <1> that's pretty much what you're doing. <0> hrm.. not very. <0> sofresh: what will the length of the string be if it's empty? <5> hey any of you guys make php scripts for money?
<4> zero. <0> sofresh: so what might a logical test be? <6> Scriptz: yes <4> dont know, is there a function which returns length? <1> if (trim($var) == ""){ ... } <0> do you know of a SINGLE language that doesn;t? <0> blah.. i prefer to test length <4> whats with teh smart *** poofy behaviour two bits? <1> @strlen <2> (PHP 3, PHP 4, PHP 5) <2> int strlen ( string string ) <2> Get string length <2> http://www.php.net/strlen <6> sofresh: it's standard on IRC. you must be new <5> you a member of rent a coder evulish? <0> sofresh: you made me look like an *** by being an *** so i'm being an *** on purpose which is totally acceptable in order to make you look like an *** <0> it's ***tastic <6> Scriptz: nope. i'm employed full-time <4> you make no sense two bits <4> none whatsoever <0> then i've succeeded... *** <1> made sense to me :) <1> you fail. <6> I WIN <5> ca I pm you? <6> sure <1> I tie! <6> i knot! <0> I draw! ... boobies! <1> (.v.) <0> sofresh: do you consider yourself to be a sane and rational thinker? <4> im me. <0> well that's your problem right there <7> i could see TB now. ...crayon box and all. <0> i prefer water colors.. the non-toxic stuff <7> i go for the oil pastels myself. <0> the kind with the ear amputation inducing chemicals? <7> oh yes <7> nothing but the best. <0> score <0> high five! <7> anyone know anything about png-8's ****ty dithering and how to fix it without switching to png-24? <7> because of gd crappy implementation of png-24 ;/ <0> their implementation is crappy? <0> hrm <7> well, it doesnt display transparency right in png24 <0> doesn't display it right or not at all? <7> not at all <0> i had no idea <0> are you using imagesavealpha? <7> no <7> maybe that would help though <0> would you like to? <7> sure! <7> @imagesx <2> (PHP 3, PHP 4, PHP 5) <2> int imagesx ( resource image ) <2> Get image width <2> http://www.php.net/imagesx <7> well, i'm out for the night. <7> g'nite folks. <8> where can one aquire "libpq.so.4" for bsd <9> from postgres? <8> its a pQ though I believe <8> not pg <9> yeah, its from postgres <8> H <8> ah rather <8> bastards <6> any of you ****ers know how AAdvantage works? <8> AAdvantage? <8> ne'er heard of it <8> I could figure it out though <6> yeah, american airlines frequent flier miles
Return to
#php or Go to some related
logs:
Margarette1
#india #chat-world #india #chat-world #kl #india indian netcafe #worldchat #linux
|
|