logs archiveIRC Archive / Freenode / #php / 2006 / April / 9 / 1
Ries
Ciantic: yes... but ofcourse I was hoping that there was a function for it, gm supposed to do it with th -colors options but it seems that that function is broken
Ciantic
Ries, well its painfully easy, just use imagecolorsforindex to that
Ries, if the ImageColorsForIndex is the color table fetching function :)
Stormchaser
shramko: please no advertisement here...
shramko
Okay
Ries
Ciantic: But shouldn't I change each index on the image aswell?
Ciantic
Ries, i think you should loop all the index numbers on each image and look for duplicates on single image
Ries, but i can't fully understand where do you need that
xlotlu
when output buffering can a header be unset?
Ciantic
unsetting header :D
you should review your code my friend
xlotlu, it has nothing to do with output buffering
xlotlu, only to be able to send headers has something to do with output bufferin
since, of course, headers should be sent before output
xlotlu
Ciantic: it's a php engine issue i'm trying to overcome with dumb code. that is: session cookies need not be set by the server when the user already sent the cookie in the request
         

Ciantic
xlotlu, you lost me, that doesn't make sense
osinet
hi there. There's a feature I've been looking for but couldn't find in the docs: is is possible to rename an already defined function from PHP code after its definition. The ultimate goal being to wrap it in another (possibly lambda-style) function ?
Ciantic
xlotlu, header cookie (setcookie) is irrelevant to the user sent cookie
MikeSeth
whats the best way to asyncronously push loads of similar data from a bunch of different websites to a single master machine?
(Action) ponders
xlotlu
Ciantic: the cookie is a http header. well nvm
edink
osinet: not in regular php, you need stuff like pecl modules classkit and runkit which are highly experimental
MikeSeth
runkit barfs on all my experiments
Ciantic
xlotlu, yes, but explain more about your problem, that what you said is not clear
osinet
thanks for your answers
MikeSeth
does really bizzare things like remapping functions permanently until you restart apache
Stormchaser
MikeSeth: pcntl_fork or non-php language
xlotlu
Ciantic: if the browser sends a cookie along a request, it's useless for the server to set that cookie on a subsequent response, unless changing its value. agreed?
edink
MikeSeth: if you want to pull the data i recommend curl-multi
Ciantic
xlotlu, yes agreed
edink
xlotlu: its a standard practice to send a cooke along with each response
xlotlu
Ciantic: now the fun part of it: according to the http rfc, setting a cookie alongside a response effectively turns off any caching mechanism for that resource
MikeSeth
edink, basically, I migrate a lot of database rows from machine to machine
Ciantic
xlotlu, that causes some problem?
edink
xlotlu: http 1.1 specifies no such thing
xlotlu
edink: it's standard practice for everybody out there that doesn't give a damn about caching. and unfortunately browsers behave off-specs because of this "standard practive". IE for one, and then Opera to the extreme
         

edink
xlotlu: what mechanism are you using to enable caching? etags?
Ciantic
I'd sure like to know is there even a good way to create caching in PHP
I haven't cracked that yet
xlotlu
edink: if-modified-since
Ciantic
Since parsing those modified since tags from all dynamic data is not what i call easy task to create tidy
edink
xlotlu: you need to detect that on server side and send not-modified response
xlotlu: that's not something browsers do, you need to send 304 response yourself
xlotlu
edink: forget all that. it's done already. the problem is that setting cookies for a response *should* force a browser to ignore the Expires header
S^Gerbitz
hey guys
edink
xlotlu: i cache pages all the time using $_SERVER["HTTP_IF_MODIFIED_SINCE"] and setting Content-type: Content-length: and Last-Modified: http headers. Cookies do not interfere with this method
xlotlu
edink: http://www.ietf.org/rfc/rfc2109.txt
edink: see 4.2.3.: the page should be stored in caches "pre-expired"....
edink
xlotlu: i give up, you said you are using if-not-modified-since, and now it's something different... everyone is sending cookies on each request, trying to go around that will accomplish exactly nothing
xlotlu
edink: last-modified & etag are validators. running a validator implies firing a get/head request that could of course return the 304. but the UA ahs the choice of serving the resource from its cache right away (just as well as caching proxies). according to the spec, setting a cookie should prevent direct serving from the cache and require compulsory validation (but of course, browsers misbehave)
edink: this is all theory anyway. what i was trying to actually do is have session_start() not set the cookie unnecessarrily
Stormchaser
you can set that in php.ini, but it's a GOOD IDEA for session to use cookies if avaliable.
edink
xlotlu: well, nobody had need for that. anyway writing your own custom session class is trivial and then you have 100% control. this is what i do in all my projects
Stormchaser: automatic link rewriting is both slow and evil :)
Jymmm
bullsh*t
Stormchaser
edink: Who cares? :)
edink
Stormchaser: :)
Jymmm: eh?
MarkR
Yes, link rewriting is evil, I hate having session IDs in the query string - they can leak very easily
xlotlu
edink: i know, but i'd like to have it written in C... and that i hadn't had the time for. and $_SESSION is just easy to use for everyone using the code base. anyway, think i'll try to get my way around it with mod_headers
edink
xlotlu: hint: if you don't use session_* functions, you can still use $_SESSION, just make your own shutdown function that will store the vars where you want them :)
of course, you'll need session_start() equivalent too, but there you can check if cookie was sent via $_COOKIE
Lateralus
hmm... who said my nick?
Jymmm
Lateralus what if I did ?!
xlotlu
edink: very nice hint; always had the idea it'd throw an error w/out session_start()-ing it
kapishonas
<p>text</p><li>text</p> -- how can i replace </p> with </li> without losing text?
Lateralus
Jymmm: Obviously I would have to kill you.
Stormchaser
Lateralus: You can't. He holds the unimaginable power, while you don't ;)
Jymmm
When the hell did I get that?!
Stormchaser
when you became a demi-god >:)
Jymmm
Ewwwwwwwwwwwwww
Stormchaser
lol
Jymmm
Yeah! http://www.harborfreight.com/cpi/ctaf/Displayitem.taf?itemnumber=94171
MarkR
kapishonas: That isn't well-formed html - you can't close an element which wasn't opened
Stormchaser
Jymmm: Have you checked the gumstix link, that I posted yesterday?
Lateralus
Stormchaser: what are you doing with a gumstix?
Jymmm
Yeah... I'm gonna take a 55 pound solar camping with me.... NOT!
Stormchaser
Lateralus: Nothing... I don't need it. My friend is going to buy one with ethernet, USB, bluetooth and MMC.
Jymmm
Stormchaser: Ah, yes I did. I'm aware of them from about 7 years ago. They are really expensive; especially in comparison to AVR's at around $6/ea
Lateralus
Stormchaser: my roommate has one.
edink
hm, i didn't realize a demi-god yelled bulsh*t at me ;)
Jymmm
Stormchaser Hmmmm, maybe I was confusing them with another thing, got the link still?
Stormchaser
Jymmm: gumstix.com
Jymmm
ty
Stormchaser
Lateralus: I'm thinking it would be quite interesting to tackle with bluetooth module, tho :)
Jymmm
I hate their website... no specs
Stormchaser
Jymmm: They are. Just dug deep down...
Jymmm
Stormchaser: No, they shove if off to a wiki.
Stormchaser
http://www.gumstix.com/spexwaysmalls.html
kapishonas
MarkR, <li> is opened :) i need to close it
Jymmm
Stormchaser: Sorry, not those specs as much as application datasheets... like which item goes with what, what each thing/accessoery/board does, etc
Stormchaser how and what each item does/is for.
Stormchaser
Jymmm: Yah... Those are pretty bad... I coudn't find any proper datasheets :(
Jymmm
Stormchaser: Look at the 4 items on the link you just gave. price goes up, but doesn't say why (at the top), you have to look down to see the last two items have bluetooth. I would have just gone NEXT...
Stormchaser
Jymmm: *nod*.
Jymmm
Stormchaser: If you want to get into uC's, check out Atmel AVR's - theres sh*tloads of linux dev applications, support, forums, etc. very cheap too.
just google 'AVR'
37M resutls
Stormchaser
I already heard of those... Can't remember exactly... I'll google
Jymmm
Stormchaser: http://www.atmel.com/products/AVR/
that's what all the hype is about - good stuff
kapishonas
<p>text</p><li>text</p> -- i need to replace only those </p> which goes after <li>, any suggestions?
Jymmm
Stormchaser: If you want to get your feet wet, there's the butterfly $20 http://www.atmel.com/dyn/products/tools_card.asp?family_id=607&family_name=AVR+8%2DBit+RISC+&tool_id=3146
Stormchaser: That thing is VERY cool!
MarkR
kapishonas: Read the html into a html dom using the dom loadhtml function, which will automatically fix well-formedness errors.
Or use tidy
Stormchaser
Jymmm: OH, yeah... I remember now... You and itrebal had some talk about those :)
I'll look into them... IIRC, I can actually buy them in the local electronics store :)
malt
Hello can someone show me a cgi proxy script that has a working SSL config in it?
http://www.jmarshall.com/tools/cgiproxy/
that come from there
Stormchaser
!+g10
php-bot
Guideline #10) We don't support xyz script. We help you *write* PHP, not recommend or download and install/hack/modify/adapt/use pre-written scripts
mikere
Rewriting an app I did a few years back - man I wish I knew about include back then ><
archivist
"Rewriting an app" adding new improved bugs
mikere
yep - to be fixed some time in the future
Ciantic
mikere, laughs to you :)
kapishonas
lol, $doc = DOMDocument::loadHTML("<html><body>Test<br></body></html>"); says: Fatal error: Call to undefined function: loadhtml()
mikere
It was supposed to be a one off project, however it looks like we have more clients lined up that want something almost exactly like it so I'm rewriting it to be more maintainable.
and making it somewhat less ugly as soon as I get to it
Ciantic
less ugly is the Good to Go mark
archivist
looking at ones old code can be entertaining
Ciantic
mikere, don't ever go to corporate world, there is just nooo way you could do "less ugly" since there are many times so many idiots along writing
mikere
Haha
Nope, I'm not leaving consulting any time soon.
But if you think corporate is bad, you should try NGO's
hax
is there a php solution like ActiveRecord to make managing a small database really easy?
Ciantic
i was lucky that i did not began coding with PHP
it's development (PHP's) been so ugly itself that i can't even think (oh yes i can take a random "coding" page and look for the php scripts) how horrible it must be
mikere
Ciantic: I started with Watcom Pascal back in college
MattBibby
i started with C
only coz my father is a C programmer
and obviously i learnt
Stormchaser
that's so damn lame reason
Ciantic
i began with Pascal too
MattBibby
not really....
Ciantic
Stormchaser, it's not
Stormchaser
I began with C64's basic
Ciantic
its logical, my big brother taught me to code with pascal and thats how my coding began
MattBibby
my farther had enough patience to teach my the science and maths behind code
not just C
how to code in practice
which helped me
shame he died :\
mikere
indeed
MattBibby
he left me all rights to his code, and his old books
but ive stored them sumwhere
uroboros
Hello.
MattBibby
Hey
whats up
lig
re
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 next »