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



Comments:

<0> how do i only obtain the FIRST value?
<1> ozzcomet: ../../
<2> ozzcomet: .. is a directory
<3> ok
<3> 10x
<4> Fushuing: explode on space?
<2> !tell ozzcomet about typing english
<0> i want it to stay in an array... :/
<3> :)
<3> thank you
<0> and i don't want the second value
<0> second value be gone >.<
<1> Fushuing: http://php.net/array_walk
<0> noooo XD
<4> 10 ok's?



<4> Fushuing: list($first) = explode($line);
<5> Fushuing: richardlynch Are yout getting kickbacks from array_walk or something
<0> richardlynch: i currently have the stuff in an array, but i need the second value gone
<5> in the interest of full discloser I think you should tell us.
<1> Hey, this time it's right.
<5> diclosure*
<1> disclosure*
<0> Touqen: i hate array_walk
<0> it killed my innerchild
<2> Fushuing: What do you mean "the second value"?
<4> Fushuing: what do you mean "stay in an array"
<5> My fingers and brain aren't really working in unison.
<2> Fushuing: You mean like $foo[1]?
<0> filename.ext 439AVrer4
<1> $first_word = array(); foreach($file as $line) list($first_word) = explode(" ", $line); var_dump($first_word);
<6> ok, thanks for help, see ya
<4> Fushuing: maybe: list($line[$i]) = explode($line[$i]); ?
<4> Fushuing: do you mean instead of "get first value", "get rid of all but the first value"?
<7> TML: What is wrong with Apache 2.2 ?
<0> $file = file(file.txt); ?
<0> ||cw: on each line
<4> MarkR42: he said "know segfaults"
<2> MarkR42: People have been reporting segfaults in it for some time now.
<1> Fushuing: Yes.
<5> why the hell won't ie draw the border-top
<7> I have not seen any segfaults, either they never affected my apps, or happened so infrequently I didn't notice
<1> Touqen: It's outside some boundary box thingie, I think... Ask in #html
<0> richardlynch: your code only parses the first line :/
<1> Fushuing: Yeah, you'd have to do list($fw) = explode(' ', $line); $first_word[] = $fw; or somesuch. Close enough.
<2> MarkR42: Yeah, that's pretty much how it's been going so far. Some people have no problems, others have nothing but. Until it's an officially targetted platform, I haven't felt inspired to look at it any deeper.
<8> limitting the explode to 2 would already be an improvement.
<9> You can limit it.
<2> MarkR42: I know they made some changes to the request structure, I'm guessing you have to use PHP code that touches those in a particular way.
<4> Fushuing: ok so you have an array of "space delimited" strings, you want to end up with an array of the first value of each string?
<7> I have looked at our logs and there are some seg faults, they obviously haven't been causing any major problems for anyone, I wonder why not
<9> MarkR42, a simple page reload uses produces the correct response. Users don't care enough.
<9> usually*
<9> It took a while for us to discover segfaults caused by reference use in our own product.
<7> Yes, well, I'm more concerned about a seg fault happening half way through doing some important processing
<7> On the other hand, we are running a somewhat ancient version of PHP here
<9> Exactly-- it may not be a nuisance for users, but it should be a priority for you.
<7> due to not having the funding to keep the app up to date
<9> PHP5 with zend1 compatibility mode on usually works fine.
<4> Fushuing: foreach($file as $key=>$val) { list($file[$key]) = explode(' ', $val); }
<2> MarkR42: o.O
<2> MarkR42: An ancient version of PHP coupled with Apache 2.2?
<7> Like I say, no funding to upgrade
<2> But funding to upgrade Apache?
<7> Upgrading PHP would mean significant application refactoring and testing
<7> Upgrading Apache was a bit easier as it was shared with something else we were doing
<4> MarkR42: who would "anyone" be? the general public rarely complains about broken storefronts, they just shop elsewhere
<0> ||cw: $file = ?
<2> MarkR42: Is there a feature in Apache 2.2 that made the upgrade compelling for you?
<7> Looking at another server, which runs a newer app on PHP5, it appears to have had no seg faults for several months
<4> Fushuing: what you had before
<10> MarkR42: Depends on your applications... There is some significant reference changes in 4.4, but latest 4.3 should work fine
<7> That's what I'm running on this site, latest 4.3
<4> Fushuing: $file is the array of lines you said you have
<7> It ****s
<10> MarkR42: TML is correct: Why upgrade apache to "latest and "greatest"?
<7> Or indeed, no seg faults ever on the PHP5 box. It is however, a more capable box with fewer issues generally also, a nicer site



<0> thanks :)
<7> Actually I did vaguely want to use an Apache 2.2 feature, although I never deployed it in production
<10> IIRC, 4.3 barely supported apache 2.0, let alone 2.2
<2> 4.3 runs fine on Apache 2.0
<0> now i need something to get rid of excess data on top of the file that is random :|
<10> TML: Wrong wording, then... Should be s/barely//
<4> Fushuing: array_shift()
<2> Personally, I think the Apache Foundation has gotten revision-happy, and they need to cut it out.
<11> so is it possible to determine which .ini files, aside from the main config, is effecting execution of a script?
<4> IMO "barely supported" implies "works fine"
<4> maybe not "works spectaculary"
<12> lol
<8> FSK405C, yes.
<2> ||cw: PHP 4.3 works wonderfully on Apache 2.0
<13> How would I go about ***igning a require or an include to a template variable?
<10> TML: Agreed... 1.3 was in the branch for how... 4? 5 years, and then they went like 3 revisions in 2 years
<10> php 4.3 work wonderfully on apache2 prefork MPM :)
<4> Crescendo: that would be template system specific, ask them
<7> I use a threaded MPM, performance was too poor on prefork
<11> colder: Alrighty. I must have missed it in my googling and rotfm. Can you direct me a. to more information or b. elaborate? My issue - safe mode is off on the system I'm devving on and turned on somewhere between there and the front page of my script. I've gone over the main .ini and the apache config and couldn't track it down. :D Care to clue me in?
<7> As prefork munches too much ram on our cheap virtual server
<8> FSK405C, check out your phpinfo(), simply
<11> did that
<14> Crescendo: return $content; from the include then $foo = include 'foo.php';
<8> so what, every scanned directory is listed
<11> it only gives a path for the primary ini
<4> MarkR42: you run 4.3 on threaded?
<7> haha yes
<2> MarkR42: o.O
<7> Actually I run 5.1.x threaded too
<7> I figured out well, if the windows users can run it on a threaded MPM (which they are forced to do as there is no prefork available), then we should be able to too
<4> MarkR42: that might be the cause the segfaults
<8> FSK405C, you should have one entry called "Scan this dir for additional .ini files"
<11> hmmm, k. will look about. thanks colder.
<7> Also the memory consumption difference is huge between prefork and worker
<11> actually no...I don't ... not even a blank field :/
<4> MarkR42: win32 libs are compiled different. it's possible that some win32 libs are thread safe while the linux one isn't
<15> does someone know how to work with function pointers ??
<8> FSK405C, what is your php version ?
<11> 4.3.3 IIRC
<8> defbyte, function pointers ?
<4> defbyte: php doens't have function pointers
<2> defbyte: You've mistaken PHP for a language that has pointers.
<15> something similar ?
<7> Possible, but relatively unlikely I would think. I'd hope they were. We don't use too many dodgy extensions - I'd imagine mysql is ok.
<11> yeah 4.3.3 definitely
<8> defbyte, you might want to take a look at references
<2> defbyte: You're going to have to explain what you mean.
<0> how to check if the first character of a string is 'a'?
<12> reference I think
<14> php does have a callback pseudo-type, like $foo = 'bar'; $foo();
<1> defbyte: php has no function pointers. You mean "callbacks" which in PHP are just the name of the function, or, in some cases, an array of an $object and the method to call, or in some cases, just the object and the name of the function is pre-determined.
<2> Fushuing: $str[0] == 'a'
<8> Fushuing, $string[0] === 'a';
<8> :)
<15> i just want to make my configinterface as variable as possible (so i can add new modules)
<0> DOH
<15> so i have a config file where i add a new module and the rest is done automaticaly
<15> so my changeconfig.php get new menupoints
<15> and a settings-screen for every module
<16> hah
<16> I just went into a business meeting with top Nokia execs wearing a Dream Theater T-shirt
<16> cl***ic
<11> should such a feature be supported in 4.3.3 - could its absence be caused, by something like say, the zend optimizer?
<0> !$val{0} == ';'
<0> should work ,right?
<12> $val{0} != ';' O.o
<0> or [0] -_-
<8> Fushuing, that will work, but probably not how you would expect.
<1> What do you think the ! part is doing?...
<15> richardlynch: i have changeconfig.php which is the main file
<0> richardlynch: if statement is false, continue?
<15> and i want to add a menupoints and a config screen for every module


Name:

Comments:

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






Return to #php
or
Go to some related logs:

dbx_connect php5
#qemu
slap.h gentoo
mqueue + purge
ubuntu win32codecs repository dapper
ubuntu hp L2335
ubuntu cdmon cron
#ldap
Stickg bit
#linux



Home  |  disclaimer  |  contact  |  submit quotes