logs archiveIRC Archive / Freenode / #php / 2006 / February / 9 / 1
caffinated
threat: Would you put that on a letter to an employer? How about on a request for funding?
Pollita
threat: Why not?
We're not worth your effort?
caffinated
threat: The answer is, you wouldn't. Because it makes you look stupid.
Rhasta
if he says yes it's a pretty fair call
threat
caffinated, no I wouldn't, however this is IRC and does not require the same level of formality
Rhasta
:p
Pollita
threat: Because while you may want help, you don't feel you should have to be presentable while asking for it?
lith
threat: I believe, though i may be wrong, the thought behind that rule is that we are all professionals in what we do, Just like a very nice restraunt would not allow in someone in rags, or cursing loudly, (purely an intelectual basis) we hold the same truthes with our ability to communicate.
Iron_lord
how can i get a proccess list in php for windows? :S
         

lith
Iron_lord: ctrl-alt-delete?
Iron_lord
Dont have access
lith
Iron_lord: hacker!@
Iron_lord
lol no
DogWater
while(list($object)=mysql_fetch_row($current_server)) shouldnt this return whatever object is in the query current_server?
Pollita
Guys! Ease off on threat... he's not an idiot or anything, he knows how to spell. He just thinks we're all a bunch of worthless peons whom he has no reason to dignify with respect.
jonnay
Iron_lord: probably through some kind of Winapi voodoo, but that is about the best I got...
Pollita
I GET IT
threat
Pollita, lol
enygma
yay
jonnay
as apposed to a bunch of angry pedants?
opposed rather.
p0windah
(Action) yawns
caffinated
Iron_lord: without doing an outside DLL call, you'll probably need to use a commandline tool. Iirc, there is one that comes with the admin tools (probably found on the installation CD somewhere) called tlist.exe
lith
POllita: I still fail to understand women... You stand up for him, then boot him?
symoid
Hello
junix|work
jonnay: the log showed nothing
caffinated
Iron_lord: I'd help you with the Win32 API call, but I wouldn't even really know where to start with that.
Iron_lord
hehe
Pollita
lith: I hate to be so contradictory, but it's in the vagina handbook. I've got my own rules to obey.
Iron_lord
never mind
         

symoid
This is a newbie question but i want to take a "Crash course in PHP"
caffinated
symoid: http://php.net/tutorial
Pollita
symoid: That's a statement, not a question.
lith
Pollita: lol ... (psst) mind if i borrow that handbook for a while? :>
symoid
Is that the best way.
lith
Pollita: I'd be an instant billionare selling that thing :>
Pollita
lith: Trade ya for the penis pamplett
symoid
Pollita: ok sorry, where s the best place to take a crash course in PHP please?
lith
Pollita: ANY TIME @!
threat
Pollita, any way
caffinated
symoid: I just told you where.
jonnay
junix|work mmm. That seems odd then. how about an apachectl configtest?
lith
guys are easy... beer, food, sex... its a 3 page flyer
symoid
I know, i was just correcting myself for Pollita
Pollita
symoid: caffinated told you: http://php.net/tutorial
lith
and written in big ass font
caffinated
lith: three pages is probably being generous. or did it also include pictures?
Pollita
oh, alrighty then
symoid
Thanks caffinated
Pollita
lith: An 8.5x11 trifold?
Not so much with the words... but it has nice pictures?
ezrafree
hello all
junix|work
1 sec
Pollita
[BEER STEIN] [HAMBURGER] [NAKED GIRL]
lith
Pollita: Well not of me, you see, My novel would would have to say "illustration continued on page, 2, 3, 4, 5, 6, 7, 8, 9"
ezrafree
anyone know what the best function to use to get the very last line of a file would be?
lith
:D
junix|work
jonnay: its says the syntax is ok
Pollita
ezra: Depends if "best" means "most efficient" or "laziest"
ralle89
would a function like this: http://pastebin.com/545687 be of any good? I mean would it sometimes output \' ? cause I would like it to put the stuff correct into database but also output it right
ezrafree
Pollita: hmm good point... i'll go with most efficient :)
caffinated
lith: I can sum the whole thing up in one photo actually: http://www.anvari.org/fun/Gender/A_Little_Difference_Between_Men_and_Women.html
ezrafree
i presume i would fread() the file?
Pollita
fgets() but yeah
ezrafree
or i could exec()
and just do tail
for the very last line
lith
caffinated: BRILLIAN!
ezrafree
oh fgets, my bad
lith
er brilliant!
caffinated
lith: hehe, i thought you'd like it
ezrafree
Pollita: are there any reasons to do one or the other?
jonnay
junix|work: Mmm.. are you sure that the apache conf that you modified is the same apache conf that apache is loading?
Pollita
I like the phallic imagry in that switch
ezra: Memory usage versus CPU usage
caffinated
Pollita: it would be better if it was to scale
ezrafree
Pollita: ah, hmmm... a hard decision either way then :)
Pollita
ezra: Depending on what you know about your file, a SEEK_END and a series of fgets() might be the most efficient for both
jonnay
junix|work: I am rusty on my apache, maybe ther eis some kinda option to turn debugging on in the error log, so you can see if the php module is actually being loaded.
caffinated
realisticly, it should be a 14" knife switch
ezrafree
Pollita: well it's a log file, and i need to get the last line of it... i know that much
kosh[0]
hiya, if I want to send a variable, called $length, which denotes the length of a file I'm sending across the socket I've got open, how can I tell how many bytes I'm sending?
caffinated
or at least, it should have the illusion that it is
Smegzor
I would like to build a PDF in PHP. There are a lot of PDF classes etc out there. Can anyone recommend one? I need to be able to build the PDF dynamically (ie. not just spit out SQL results).
kosh[0]
since $length is a variable, I aint sure how to find it's length in bytes so I can tell socket_send() how many to expect
DogWater
can anyone give me the abridged version of getting a column out of a mysql_fetch_row?
caffinated
Pollita
Like, if you know that no line will be longer than 200 characters, you might do: function last_line($filename) { $fp = fopen($filename, 'r'); fseek(-210,SEEK_END); while ($line = fgets($fp)) $last = $line; return $last; }
Smegzor
Why are there so many independant PDF classes when thats there?
lith
DogWatter: $query = "select col1,col2,col3 from table where table.col1 = '$value'"; $result = mysql_query($query); $row = mysql_fetch_assoc($result);
jonez
kosh[0], if the data is in $data, $data = "foobarbaz", $length = strlen($data); $length will then equal 9, which is the number of bytes. understand?
Pollita
erm.... fseek($fp, -200, SEEK_END);
DogWater
lith: the query part is easy
Pollita
or -210 or whatever
kosh[0]
jonez: thats not really what I wanted
I've got $length = ftell($handle)
I want to send to variable, $length, across the socket
lith
DogWater: really? thats probably the hardest part for me :D
ebow
hi, i need to try changing the mysql.default_socket setting in php.ini to see if it will solve an error i have connecting to php. i'm running mac os x 10.4.4 and my /etc/php.ini only has a php.ini.default file (no php.ini and not php-recommended.ini) - my question: what file do i use and how/where do i modify the setting?
DogWater
lith: i just want to know how to get the field object for this one row assigned as variable $service
kosh[0]
so, socket_send($socket, $length, sizeof($length)) ?
Pollita
Basicly, seek till you know you're in the second to last line or earlier, then start spooling lines until you get to the actual last
enygma
DogWater - eh?
DogWater
lith: without pulling out the thing into an array
jonez
kosh[0], did you try that?
kosh[0]
no, I didnt tbh, I thought it wouldnt work
lith
DogWater: ? You want _1_ column from a result?
enygma
DogWater - mysql_fetch_row returns an array
jonez
kosh[0], try it and see.. if it doesn't work then come back and ask again
kosh[0]
php has sizeof ?
lith
DogWater: YOu can do that, though i _promise_ your computer/server wont be pissed that it has to create an array
mindamp
lets say each mysql record has two fields... *time* and *created* ... time is in unixtimestamp format... created is in regular datestamp format... update every record so that the time field correlates with the created field... heres what i have so far, but it stuck the first $row[time] it found into all the created field rows.... http://pastebin.com/545690
Pollita
kosh[0]: Yes, but it's not what you think it is.
DogWater
enygma: yeah; alright, I just didnt know if i always had to do a 40 step while loop to get a single field out of my db
mindamp
can anyone help with this?
kosh[0]
Pollita: well, I'm coming from C, so I'm thinking it'll return the number of bytes that make up whatever I'm doing it with
jonez
kosh[0], maybe pack() is what you want?
kosh[0]
jonez: is it?
Pollita
kosh[0] How should the length be encoded? As an ASCII string? As a single octet? As a big-endian short? As a little-endian long?
jonez
kosh[0], *maybe*
Pollita
kosh[0]: Right, and it won't.
lith
dogwater: php.net/mysql_result
kosh[0]
Pollita: well I want to send the length of a file, across a socket
Pollita
kosh[0] How should the length be encoded? As an ASCII string? As a single octet? As a big-endian short? As a little-endian long?
kosh[0]
so I use ftell() to return that
Pollita: I know, but how else can I do it
I don't know how php encodes these things
Pollita
(Action) head plants
lith
DOgWater: Then you want to limit your query to 1 row... by using the WHERE clause in your query.
kosh[0]
so I'm unsure as to how to obtain the information in order to send it
Pollita
I'm asking you, how does the protocol you're using EXPECT the data?
lith
(Action) passes pollita a 2liter of pepsi and a straw
kosh[0]
Pollita: it's a simple socket, it's just bytes
Pollita
okay nevermind
ezrafree
Pollita: wow thanks, let me try that
enygma
ew, papsi
Pollita
I assumed since you're "coming from C" you had some concept of network programming
kosh[0]
Pollita: I know about that
mindamp
anyone?
Pollita
No, you don't.
kosh[0]
yes I do
I know all about little and big endian
Pollita
The fact that you're so miserably unable to answer my simple question proves you don't
kosh[0]
that was not my question
repeat the question, I dont think I read it properly
Pollita
kosh[0] How should the length be encoded? As an ASCII string? As a single octet? As a big-endian short? As a little-endian long?
To restate: At the other end of the socket is some server process...
kosh[0]
as far as I know, it's network byte order, which is big endian
mindamp
i though indians were red
Pollita
That server process is expecting you to send a length value
« prev 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 next »