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



Comments:

<0> i'm willing to wager none of you play eve-online, huh
<1> eh?
<2> !php $percent = 50; $position = $percent * 250 -125; echo $position;
<3> 12375
<2> !php $percent = 50; $position = ($percent * 250 -125)/100; echo $position;
<3> 123.75
<1> 50 as a percent value is 5000%
<0> olinux: wrong input
<1> and you dont add the lower bounds first
<0> $percent = 0.5
<1> order of operations
<4> i'm confused
<2> !php $percent = .5; $position = ($percent * 250 -125); echo $position;



<3> 0
<2> thats right
<1> create_vibe: i gave you two functions to do reverse calculations
<2> !php $percent = .75; $position = ($percent * 250 -125); echo $position;
<3> 62.5
<2> !php $percent = .25; $position = ($percent * 250 -125); echo $position;
<3> -62.5
<1> very basic algebraic expressions that rely on 3 inputs
<0> well, i ask because i played it a while ago, and it rocked. it simply rocked. it had a kick*** market (just like the stock market), it looked amazing, but it lacked depth
<0> it was like a really advanced trade wars
<4> $p * ($ub-$lb)+$lb;
<4> that one ?
<0> but i quit playing because there was only so much
<0> like, you couldn't immerse yourself
<1> create_vibe: yes, that yeilds the position in the range based on $p being a percentage
<1> lb and ub are lower bound and upper bound respectively
<4> but I don't have the percent
<4> that's what I need
<1> then use the one before it
<0> but now i see they've doubled the number of ships available, so i'm considering playing it again, and i'm willing to wager none of you can suggest either way
<2> jed, nope no one
<0> hence why i asked
<1> [16:16:50] <@Two-Bits> !php function percentInRange($lb, $ub, $v) { return ($v - $lb)/($ub-$lb); } echo percentInRange(-125, 125, -35);
<4> didn't go that far up :)
<1> jedzilla: none of us can suggest either what?
<4> kthx !
<0> either way on whether i should buy it again, because none of you are players
<0> i was explaining why i asked, but olinux says none of you care, so i'm just going to forget i ask
<1> i think you should play it. because you SOOO need a hobby
<0> because he's so right
<4> (_rotation - -(125)) / (125 - -(125))
<0> i do?
<4> ?
<4> that sounds weird
<0> create_vibe: oh simplify that
<0> (_rotation + 125) / 250
<1> create_vibe: that's because you're trying to subtract a negative number (addition). it's clearer if you DONT use "magic numbers"
<4> well, there's nothing magic about it. that is what the range is set at
<1> put those values into variables at the start of your script and you wont have to change so much later if the values change for whatever reason
<1> literal numerical values in code are called "magic numbers"
<4> i know
<1> they are evil
<4> but that's what it turns out to be
<1> they killed mother theresa
<4> i got 3 different things here
<4> (_rotation + 125) / 250 ?
<1> that's the same thing you just wrong, but simplified
<4> I just gathered that
<4> :)



<4> ok
<1> just write a function like i showed and you can abstract the whole process so it doesn't muddle up the logic readibility of the code that's using it
<4> you da man
<4> thanks all
<4> and to think. I used to be good at math
<5> yeah, back in kindergarten
<4> more like 6th grade
<4> hehe
<5> you wish you could have made it to 6th grade
<4> no, I made it to the 12'th and stayed and extra couple years
<4> :\
<4> continuation school
<4> stayed 1.5 years actualy
<5> yeah.. is that what they call getting "held back" these days? Continuation school?
<4> no, I transferred my sr. year. I could have finished, but I partied instead
<4> is why I'm taking math092 at the moment at devry
<4> bah
<6> g'nite
<7> hello
<8> hello
<7> if i write a php script which reads something from a file and make it hyperlink, how can i avoid the file type?
<5> avoid?
<9> use mod_rewrite
<7> example: foreign policy of USA.txt
<7> make it: foreign policy of USA
<9> oh
<8> you just want www.blah.com/usa?
<9> heh. explode it, pop off the last item
<5> what if filename has something.that.html =P
<1> **** explode
<8> regex
<8> easy
<1> strrpos substr
<10> I use htaccess and make a file called 'content' a php file
<10> then
<7> i am newbie
<7> can anyone give me an examples
<7> example*
<10> www.blah.com/content/section/section/articleid/pageid
<10> via the explode
<8> $name = preg_replace("!^(.*?)\..+$!si", "\\1", $filename);
<5> l33t
<1> um
<1> "/\..*?$/" would suffice to be replaced by nothing
<7> let's say i have a directory named "news" and it contains X *.txt and i want to make php print them like * without .txt, i am going to.... ?
<7> i wrote the $handle = opendir('news') bla bla bla
<1> the i does nothing, and a filename shouldn't have newlines anyway so the s does nothing
<8> banxt: use either mine or Two-Bits's regexps
<1> or use strrpos because it's more efficient
<7> strrpos is a function?
<8> TB, si is just something I've gotten into the habbit of putting on my regexps, since I usually am dealing with file contents
<1> reverse string position
<7> is it a function!?
<8> banxt: yes, duh
<1> !php function strip_ext($fn) { if ($p = strrpos('.', $fn)) $fn = substr($fn, 0, $p); return $fn; } echo strip_ext("foo.txt");
<3> foo.txt
<1> hrm
<1> !php function strip_ext($fn) { if ($p = strrpos($fn, '.')) $fn = substr($fn, 0, $p); return $fn; } echo strip_ext("foo.txt");
<3> foo


Name:

Comments:

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






Return to #php
or
Go to some related logs:

#allnitecafe
#c++
#allnitecafe
budhape me jawani
#allnitecafe
#vb
#linux
anti fener1
gokos
python ImportError invalid ELF header



Home  |  disclaimer  |  contact  |  submit quotes