@# 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> b1n0ry: oh.. and whats the name of the package normally?
<1> killfill: the php documentation recommends disabling posix functions on compilation and therefore most distributed php binaries have posix functions disabled.
<2> I don't even think that's available for Windows distro of PHP is it?
<2> The POSIX functionality?
<1> nope, no posix on windows
<1> at all
<2> *nods*
<0> yah, what the hell.. ill just byp*** this thing the osftwa im trying to install uses.. :-p
<2> I would imagine that you could hack a layer on top of the MFC to simulate some of the output, but that would be a serious hack.
<3> kennebel: if there are duplicates like: array(1 => x, 2 => c, 1 => f) does that get ordered like: array(1 => ..., 1 => ..., 2 => ...) ?
<1> killfill: if you are on non-windows (because windows has no posix at all) and you want posix functionality and it's disabled (which it seems to be), you can download the source code for php and compile it with posix enabled.
<0> b1n0ry: yup.. never mind. ill byp*** this ugly thing
<4> genelisp- an array can't have duplicate keys
<1> killfill: ok
<0> thx btw..
<1> no prob



<5> genelisp: Umm, you cannot have duplicate keys in an array. :)
<3> kennebel: oh, hmm ok
<3> kennebel: bang goes my super code plan
<2> What are you trying to do genelisp?
<1> primary keys, by definition, must be unique
<1> since that's how the array keeps things straight
<6> I'm using the overload method __set in a cl*** to do something with the attribute that has to be set on the object. But I can't use this: $instance->foo['bar'] = 'test';
<5> genelisp: if you try that, the first value would be over-written with the second, Plus, that would invalidate the purpose of an indexed array. if you have that need,you could always make "1" a sub-array.
<6> Is there anything I can do about this ?
<4> airox- __set only works on object properties, not elements of a property
<3> Etriaph: it's ok, I've thought of a different way to do it - I've got a list of product ids and their supplier ids, I was going to have the supplier ids as keys, but that won't work, since a supplier id can be duplicate - so I'll just switch it round so productid is the key :-)
<1> a primarily procedural language with reliable advanced oo? interesting
<6> Damnit.
<6> Etriaph: Get back!
<1> hmm... petra broke up... oh well, they haven't been the same for years anyway
<2> I just, the people in this channel are nice and I don't want to insult the language they're all using.
<6> Anybody has a nice suggestion about how to do something similar then ?
<1> sorry, off-topic
<5> genelisp: Keep in mind asort(); then. http://www.php.net/manual/en/function.asort.php
<3> kennebel: thanks again :-)
<1> airox: p*** the new variable value to a function and have the function set the attribute?
<5> If you use regular sort();, you will lose your id's.
<1> ...sorry... "cl***" function...
<6> Hmm ... maybe I can change all of this. :)
<3> kennebel: and what happens to the duplicates in the supplierid part (not the key) do they get ordered like: 1,1,2,2,etc?
<7> hi community - i got a big problem and don't know how i should go on.. i have a form over 6 pages.. which inputs data in about 130 tables.. this works perfect.. but now i should create a form where i can search on those data inputs.. there are about 150 search options.. now my question are there some functions which make my life easier? or do i need to build every single query? cause this sounds like 3 month of work :) thanks
<5> genelisp: Yes, i don't think php has a defined method of handling the ordering of duplicates. meaning, if you have A=>1, B=>1, D=>2, C=>2, the array may be considered ordered. You may have to use uksort to get specific results.
<3> kennebel: thanks
<1> phatbyte: perhaps use variations of if(isset()) and such (parsing search form input) to dynamically generate the query such as $sql = "SELECT * FROM table WHERE "; if(isset($_POST['thischeckbox'])) $sql.= 'thischeckboxfield=true '; if(isset($_POST['anothercheckbox'])) $sql .= ' AND anothercheckbox=true'; ... ... ... ...
<1> of course, you'd have to work in the various tables, AND/OR/IN where necessary, etc.
<1> joins as required, so much more complex but still dynamic
<7> b1n0ry thanks.. hm but this still sounds about a lot of work
<7> theres nothing easier right
<1> whenever dealing with that many tables and that much data, you're going to deal with a lot of work.
<1> programmer's version of elbow grease
<7> hm ok thanks for help b1n0ry!
<1> sorry i couldn't alleviate your pain much
<7> easy :)
<8> Anyone know a handy way to make an element loop through an array and then start at the beginning again after the last array element ... ??
<1> babo: foreach() in a loop
<2> babo: Explain that a little more fully.
<8> colors=array('blue','black','red','yellow'); i++ ; // when i reaches last element, then start again at blue ... ? thanks,
<8> I'm looking for an easy or quick way that I might not have thought of ... a shortcut basically ...
<9> How could I update 4 tables which are connected each other with field ID_ART with a single query, after I am collecting the info with a php form ?
<1> $colors = array(....); $i = 1; do something with $colors[$i]; $i++; if($i > count($colors) $i = 1;
<1> actually, i think those 1's should be 0s
<1> and i missed a ) in that if statement
<1> but you get the idea
<10> you can use mod
<9> Did anyone know if could I update 4 tables which are connected each other with field ID_ART with a single query, after I am collecting the info with a php form ?
<11> ace_me: you can only updtae 1 table at a time
<8> colder: hmm ... interesting ... I never thought about that ... $i++ ; $i % sizeOf($i) ; ... ? ... thanks guys
<9> Thabk you
<12> $i % sizeof($i)?????????????????????
<10> $colors[ $i % count($colors)] $i++;
<10> $colors[ $i % count($colors)]; $i++;
<13> heh
<13> Lots of typo's this morning
<12> why... would the size... of a variable... have anything to do with what's IN the variable... ? ? ?
<13> aholmes: go read about modulus.



<13> Ahroun even
<13> hey colder, it's been awhile since I've seen you here
<10> hi Lateralus
<12> Lateralus: Okay, I'm looking at the arithmatic operators but I don't see anything hinting at a reason for modding on sizeof... ahhh, I see. sizeof is not the sizeof I'm thinking of from C.
<13> Ahroun: no, it isn't.
<12> $i % sizeof($i) makes sense to me now.
<3> hi, I'm struggling a little here. I've got an array that looks like array($productid => $supplierid) what I want to do is create another array with many sub arrays grouped by SID, so I'd have something like array(array($prod1 => SID1), array($prod2 => SID2)) etc, can anyone suggest any way to do this?
<14> whats a good bug tracking program in php?
<13> Ahroun: I guess the closest is sizeof(arr) / sizeof(arr[0])
<12> prolly better to use count() though, since sizeof is potentially confusing like that and it's just an alias of count() anyways.
<13> Ahroun: sizeof() seems to be the preferred function. I see it used more often, atleast.
<12> Lateralus: Really? Ew.
<13> I use it.
<1> disagreed. count() is the prefered function as it is the documented one
<15> I have this string : "/streamer/?file=/play/maxpod/Video/dj_dd.m4v.flv&to=1732528" and would like to extract the following portion : "/play/maxpod/Video/dj_dd.m4v.flv". I have tried this : preg_match("@[^=][=]([^&])[&].*@i",$url,$f); but it doesn't work... any tips?
<12> bbiaf
<1> sizeof() is documented merely as an alias of count() and documentation is pointed to count()
<13> b1n0ry: That doesn't mean ****.
<11> Lateralus: since when is using aliases prefered?
<13> ||cw: "seems." I never stated that it was, I only pointed out the fact that I see it used more often.
<11> "oh, lets make the engine to more work by looking up aliases"
<11> sizeof is not prefered in php, and I've no idea where you got that idea.
<1> it means that the folks who developed php created an official function count() and created an alias called sizeof() merely for compatibility and to silence the whiners. an alias is not a "prefered" method and it's spread of useage does not make it "prefered" merely "common"
<13> ||cw: are you telling me what I see used more often? Are you seriously going to ice-skate uphill?
<16> I've got a problem when parsing large amounts of data via xml_parse. It simply crashes after about 750kb of data. Anyone got any ideas?
<1> "used more often" !== "prefered"
<1> it just proves that there are a lot more half-witted programmers than good, experienced ones.
<11> Lateralus: you see it used more often, 3 other poeple here don't.
<3> do people understand my question?
<11> sometimes common sence should prevail. using direct aliases isn't prefered in any language.
<13> sense.
<11> genelisp: looks like you answered it yourself, really. so we probably didn't understand it
<1> irregardless of spread of usage, that is no indiciation of language preference, documented defintion, or language construct intention.
<17> if i declare a variable outside of cl*** is it still avaialbe to the cl*** ?
<3> ||cw: shall I ask again then (in a different way)?
<11> danols: only through p***ing it in or via $GLOBALS
<11> genelisp: you can try.
<17> ||cw makes sense
<17> can one declare CONSTANTS inside cl***es; i believe that throws an exception
<18> in php5, you can
<10> danols, const name = 'scala'r;
<10> arr
<11> danols: in php5
<17> colder hmmm brb
<10> danols, http://php.net/language.oop5.constants
<17> colder isn't a constant the same as define() ?
<10> danols, not exactly, you'll have to access it using the cl*** name : CL***_NAME::constant
<3> I have an array of productids as keys, and supplierids. I want to create a new array which groups with sub arrays according to supplierid, for each new supplierid it should create a new subarray, otherwise, it should simply append to the current array, so I'll end up with something like array(array(1 => SID, 2=>SID, 3=>SID), array(4=>SID2, 5=>SID2)) can anyone help?
<11> genelisp: maybe more like array(SID1=>array(1,2,3), SID2=>array(4,5,6))
<5> genelisp: i agree with ||cw
<3> ||cw: yes, that'd be better
<17> colder hmmm
<11> genelisp: that will make it harder to find a sid for a product though
<3> ||cw: why?
<11> you'll have to do a recursive search
<3> ||cw: I see why
<5> genelisp: sound like you'll need two arrays, one for easy find either way.
<11> what's this reasoning for this array? seems like a good task for SQL, then you just query for what you want
<3> ||cw, I have to deal with a load of items which a customer has ordered, and then create supplier orders for each batch of items from that supplier
<17> i need some guidance, what is a good way to declare global settings, i for now use defines but one global setting i need is an array and define must be simple types
<11> genelisp: how are you storing the info?
<3> ||cw: there is a customer_order table which has many customer_order_items each customer_order_item has a foreign key to a product which has an supplier_id
<11> danols: just make an array. unless you are youing insecure thigns like extract() an array is hard for user input to overwrite anyway
<11> genelisp: sql is doing the work anyway
<17> ||cw true but where is a good place to put it ? outside the cl***, inside ?
<3> ||cw: oh right, so you're saying, I don't need to write a recursive search?
<11> danols: depends on why it would need to be changed
<11> genelisp: right. let sql sort and group
<3> ||cw: sort and group - how do I do that with SQL?
<3> ||cw: ORDER BY - but I don't know how to group
<19> GROUP BY field
<19> before ORDERY BY
<19> order*


Name:

Comments:

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






Return to #php
or
Go to some related logs:

/var/gdm does not exist aborting
#bash
#perl
#suse
ubuntu bootclean
aoc 9klr linux driver
#perl
#mysql
xgl tightvnc
qmail-ldap ldap proxy cache



Home  |  disclaimer  |  contact  |  submit quotes