« first day (1405 days earlier)      last day (3540 days later) » 

12:00 PM
:P
 
hello, does anyone here know a similar function like base64_encode that can be decoded ?
 
Why wouldn't you just use base64_encode? :)
 
@zeeks bin2hex().
 
@Ja͢ck any particular example?
@Psychemaster i can not use it in my case. i need some other function
 
12:08 PM
@PeeHaa Thanks
 
@Danack i am not falling into that. i asked: "hello, does anyone here know a similar function like base64_encode that can be decoded ?" and I got an answer.
@Ja͢ck thanks, i found an example
 
@zeeks You're not falling into the trap of asking decent questions?
 
@zeeks Danack was just interested in why base64_encode() wasn't a viable option
 
@Ja͢ck It's had some bugs with   'appearing' randomly...
 
12:11 PM
=.= ugh
 
@Danack my questions are decent.
 
they're not complete, though.
 
That question presumed a specific set of answers are valid, rather than allowing a full set of answers.
 
Goodness, this test case is just horrifying ...
Interestingly, it still works as per normal in the old php-ng branch, but somehow fails in master .. at least for me
@DaveRandom Your commit is green =D
Forget what I said about 'working as per normal' ... I have no clue what's really expected.
empty array with 1, 2 and 4 elements ... single element array with 3 elements ... totally, not making any sense =S
 
PHP's arrays suck
5
 
12:21 PM
@AndreaFaulds Excuse me? :O
 
@Naruto PHP's arrays suck.
 
They don't :( You just needto know how to use them! :O
 
@ircmaxell ahahahahaha I mean, wtaf!
@Naruto Have you seen the 3v4l I've just posted?
 
let me see
@Ja͢ck That's kinda creepy :D
 
12:30 PM
@Ja͢ck Winner. Now I just have to wait ~1trn years for someone to merge it :-P
 
@DaveRandom Have you talked to Ferenc yet?
 
About what? Target branch?
 
Target branch = 5.6 + master, obviously.
Question is whether okay for 5.6
 
Yeh, more whether it would be allowed in 5.6, since it's a lot more feature than bugfix
 
Oh, I've figured out the array "logic" - from 2 elements onwards, it goes 0 - 1 - 0 - 2 ... it's a pattern!
 
12:33 PM
I was planning to finish up the other small DOM patch I'm working on (saveHTML accepts DOMNodeList) and then talk to him about both, so as to avoid bugging him excessively
 
@Ja͢ck Isn't it kinda logic that you are getting this result? Since you are popping all the time.. Giving you lesser results each time?
 
I'm also considering asking for VCS access after that ^
 
@DaveRandom Did you become familiar with Alert/Artax while you worked sort-of with it?
 
@Naruto The question is not whether the array becomes smaller; what's more interesting is exactly how much smaller.
 
@Fabien Well neither of them were a big stretch for me since I'd previously written my own implementations of both
 
12:36 PM
@Ja͢ck You mean in memory or in data?
 
@DaveRandom Going to pick your brain for a brief second if that's okay then.
 
@Fabien Go for it
 
@DaveRandom do it do it
 
So I am using artax/alert to basically do this pastie.org/9489105. @rdlowrey provided me with the pastie.
 
@Ja͢ck doesn't the array grow smaller each time you go trough the loop? But isn't the loop affected by it, since you pop from 4 elements you can only go trough it 3 tmes and so on...?
 
12:38 PM
The structural problem I am facing is with each onComplete response I need to do another set of asynchronous calls based on the result.
 
Oh yeh not looked at the new Alert\run() yet, one sec let me see what it does
 
Now obviously in that pastie it stops once the initial 3 calls have been completed.
 
@Naruto So what's your point?
 
@Ja͢ck my point?
 
@Fabien OK, and?
The reactor is specifically designed to bail when it runs out of things to do, otherwise it would run forever with no way to get any more work to do
 
12:41 PM
@Naruto Yeah, I don't see how that explains 0, 0, 1, 0, 2, ...
 
Correct. But you need to tell it to bail out. Either by increment as it is now or time delay. I am wondering what's a good way to run another set of calls on the callback of a set of calls and alert/stop() when those have all finished.
 
@Ja͢ck I think I'm missing something? Because I kinda fail to understand what u mean... :s
 
Never mind then.
 
@Fabien In the case of what you are doing there, you won't need to tell it to stop. Each time $onComplete is called, you analyse the result and figure out what new jobs you have obtained based on that result. Then you do $client->request() each new job - eventually the $onComplete routine stops finding new work to do, and at the point it will automatically stop when all the outstanding work is complete
 
@Ja͢ck Well ok, but would appreciate it if you tried explaining me what you mean..
 
12:45 PM
What I mean by 0, 0, 1, 0, 2? That's the remaining array length after each iteration.
 
I see. Makes sense.
 
@Fabien in general, in a complex app, you'll want the completion callback to be an object method
I find the code easier to read in that way, and you don't have the problem of needing the closure to have a reference to itself in a var
(which can be done, but it's kind of nasty)
 
^^ I second that.
 
@Ja͢ck Seems I was looking at the wrong output.. I understand what u mean now
 
@DaveRandom Fair enough. Method would be doing a lot in my case. When I run this pastie.org/private/maiunxl9zco1wu2qzuf1ra. "Complete" is only echo'd twice. By the time the 3rd $onComplete has returned it closes the reactor.
 
12:49 PM
Epic chat fail
 
Epic edit :P
 
Oh sorry @Fabien, didn't even see the gtalk message
 
:D
 
Not a lot of point in moving away from here though
 
Indeed.
 
12:50 PM
1 sec, let me throw something togther
 
Cheers
 
what was the php function for checking if text contains a similar looking string ?
 
@tereško similar_text or levenshtein
 
1:03 PM
:-)
 
yeah , that one
 
So when getNewUrlsFromResponse() returns an empty array for every response, the thing should stop
Actually I guess you can obtain the requested URL from the response, but the closure wrapping demonstrates how you can use closures to augment the response callback arguments, and how you can use that to avoid making non-API methods public
Even though I left it public by accident
 
foreach wizardry is hurting my brain, time to find other bugs ...
 
1:20 PM
is there another word for "questionnaire answers" ?
 
@DaveRandom off-by-one-issue ++
 
@Ja͢ck @DaveRandom guys its working now via file_get_contents \o/
and now, I have two working methods. So which one to put in production?
 
@Ja͢ck classic. Somehow some HashTables count the terminating NUL byte for key length, some don't...
 
CHeers @DaveRandom I will read over it
 
user895378
1:31 PM
morning
 
Yo @rdlowrey
What do you guys use to connect to irc?
 
I use irccloud.com
 
@bwoebi I believe that's now changed with the updated hash api.
it should more or less work as one would expect
 
Cheers @ircmaxell
 
@Ja͢ck not sure about phpng now… great if this fixes it.
 
1:32 PM
then again .. heh, we're talking about php here
 
user895378
@Fabien I've been using HexChat (windows) but it crashes all the time. Whenever I have a free weekend I'm going to migrate back to a real desktop that doesn't crash every day.
 
@bwoebi it reduced failed test cases by quite a fair amount ;-)
 
@bwoebi yeah, strings don't need to be null-terminated. Except if it's an array key. Or certain other areas. But for the most part it's redundant. Kind-of. Not really.
 
user895378
@AndreaFaulds PHP arrays are a little crazy, but they're extremely useful.
 
@rdlowrey a lot crazy, but agree on useful
 
user895378
1:34 PM
yes, I'll give you that.
 
a lot? why?
 
modifying arrays during iteration will result in my foot in your ass.
 
I'd love to see 3 data structures. A List, a Dict and PHP's array...
 
Hi Anthony!
 
Freaking hate the new socket.io .. no more cluster support without breaking a blood vessel
 
user895378
1:35 PM
They're insane. But I frequently find myself saying, "Wow this ordered map is perfect for exactly what I need to do right now. Awesome."
 
user895378
Bro do you even tuple?
 
user895378
I don't hold out much hope for tuples, but a guy can dream.
 
@rdlowrey yes, there are tons of areas where it's amazingly useful. But there are also areas where "hell, I wish I could just restrict this to a simple C-style array"
 
Hey @ircmaxell. I'm thinking about trying to get rid of the default prepared statements for mysql pdo again. Worth it?
 
@PeeHaa huh?
 
1:36 PM
@ircmaxell especially for your project, it'd make life easier, yes…
 
you mean emulated prepares?
@bwoebi yup
 
Sorry typing faster than I think
yeap
 
marc.info/?l=php-internals&m=133972232919056&w=2 <-- was approved. I just never got the tests passing (like 300+ tests failed due to that 1 bit change)...
 
@tereško could you provide an example of something that could not be done if the controller would not have access to the model? — tastro 11 mins ago
sometime I feel like they are using a different "English"
 
1:37 PM
Also @rdlowrey functions don't seem to have tests?
 
user895378
@DaveRandom No they don't. Will add them soon. I added tests for functions in the after lib yesterday
 
@ircmaxell holy... Should be fairly issue to fix though right?
 
@rdlowrey well, tuples are immutable. And while that's awesome and all, I'd settle for a list structure which cannot be sparse...
 
@DaveRandom looks sensible to me… but why an array and not variadic?
 
Or is it really fooked?
 
1:39 PM
@PeeHaa yup, just need to refactor the tests (the difference is where errors are thrown. With emulated prepares, it's thrown at execute. With non-emulated prepares it's thrown at prepare...)
so it may be something to sneak in for 7, as it's definitely a BC break... But a bc break for good
 
@ircmaxell Awesome! If you need help fixing the tests let me know, because this thing is waaay long overdue
 
I gave up on it long ago, because I had more productive uses of my time :-D
 
heheh fair enough. Well if I have time and feel up to it. I will give it another shot :P
 
:-D
 
user895378
@DaveRandom I don't know ... I kind of hate adding args like that. Why can't someone just bind params via use to a closure if they want that?
 
user895378
1:43 PM
Also, if $args is added there it needs to be added to the Reactor::run() method for each of the individual reactor implementations
 
@tereško I think we should mass-close all questions tagged with + as "Rethink your life" :-P
 
actually, I could do it
 
user895378
lol
 
=D
 
@bwoebi Originally did it as varags, but Alert supports 5.4 (atm) so it's messy
@rdlowrey Idea was only for sugar/convenience when using the func
Or are the funcs supposed to mirror the methods exactly?
 
1:44 PM
@tereško please don't give away our secret: reddit.com/r/PHP/comments/2e52os/advanced_php_community/cjwg1mm
:-P
 
user895378
@DaveRandom Yeah they're supposed to be the exact same
 
@ircmaxell ok
=P
 
I'm kidding of course
 
@ircmaxell - no love? :-)
 
1:45 PM
nope
 
user895378
I just think that closures make that addition unnecessary. If you want the args just bind them yourself.
 
comment removed
 
@ircmaxell - re: "Hi Anthony!"
 
@tereško you could have left it there. I was teasing mostly
 
.. mostly
 
1:46 PM
@DaveRandom I meant func_get_args?
 
@PaulDragoonis hi
 
@rdlowrey OK no worries, forget it then - I personally won't be using the funcs anyway because I'm not incompetent :-P
 
I was actually unsure about posting it to begin with \
 
user895378
@DaveRandom yeah, I don't use the functions either -- it just (hopefully) makes it easier for people who are incompetent.
 
user895378
And it makes examples easier to understand.
 
user895378
1:47 PM
@DaveRandom I appreciate the involvement, though, not trying to dump on that.
 
@bwoebi Yeh, is kind of clumsy IMO. I used to use it a lot but I've kind of gone off it, sort of a weird reaction to desperately wanting ...$args right now (yes, I'm aware that doesn't make a whole bunch of sense)
@rdlowrey Yeh no worries, no offence taken :-)
 
user895378
Did someone say "desperately wanting?"
 
user895378
 
user895378
Ah, crappy white-people rock music of my adolescence!
 
Anyone seen any working examples of socket.io 1.x with clustering? I know it's not php related , but it's more active here to ask.
 
user895378
@ircmaxell awesome!
 
@rdlowrey Better than Ezra, "crappy white-people rock music"? you're dead to me
 
niiiice
 
user895378
hahaha I love it. I just feel like all 90s music like that is inherently garbage though.
 
user895378
It's a guilty pleasure.
 
1:51 PM
@rdlowrey heresy
 
user895378
FWIW I immediately queued up their entire catalog as programming background music for today after Chris said, "desperately wanting"
 
user895378
Oh man REM = awesome. Appending them to playlist as well.
 
@ircmaxell - what are you working on lately ?
 
naming question: what would you call a service, which conducts surveys and collects response to the questionnaires ?\
 
user895378
1:53 PM
@Fabien How is that stuff going for you? Do you have any questions or issues?
 
@rdlowrey there was a ton of crap in the 90's. But there are some amazing things as well...
@tereško survey service?
 
@rdlowrey some of the craziness limits their usefulness
 
@PaulDragoonis something that people will find interesting when I finally can release it
 
One of my qualms with PHP arrays (that I intend to fix sometime soon hopefully) is they're destructive hashtables
Which means they are not usable to store any key, only ones you know PHP won't mangle
 
@ircmaxell that's the one I currently have , but it feels a bit off
 
1:55 PM
@AndreaFaulds which is amazingly useful in a lot of situations
 
@ircmaxell How so?
 
@rdlowrey Nothing but my own noob issues :) @DaveRandom gave me a hand with organisation.
 
"survey" is something you do with a single questionnaire
 
@AndreaFaulds because you can't have key collisions, where two keys "hash" to the same value
like you can get with other languages
 
@ircmaxell You can and they're a serious problem
 
user895378
1:56 PM
PHP arrays are like a Jackson Pollock painting; someone just mixed every possible thing you could do with a data structure in a paint can and splattered it all over the canvas.
 
@rdlowrey Fairly accurate
 
Oh yeah, well ... check this out =D okay, not related to arrays at all =/
 
@AndreaFaulds no, you have bucket collisions, where two keys get stored in the same bucket, but are resolved via a linked list. That's how most hash tables work.
 
Maybe I should express my problem with PHP hash tables in code:
By destructive, I mean this function doesn't always return false: function isMangled($key) { $key = (string)$key; $arr = []; $arr[$key] = null; return $key !== (string)key($arr); }
 
user895378
@Fabien Did you have the good sense to completely avoid the procedural API and put things in a class where you can actually name your callback functions so it's easy to understand the code?
 
user895378
1:59 PM
@Fabien Also, I'll see about adding some generator examples today so you can use yield for flow-control to make the async code feel synchronous and not need callbacks everywhere.
 

« first day (1405 days earlier)      last day (3540 days later) »