« first day (1376 days earlier)      last day (3587 days later) » 

11:04 AM
@Danack not seeing where I modify anything here magically. docs say that the second parameter of count() is by default 0.
 
> ...fixing Imagick
 
@bwoebi No....it's an optional parameter, which has a default value of 0. That's not the same as passing in 0.
 
I guess you'll be a couple of years then
 
@Danack oO !?
 
@DaveRandom apart the bug of reading from uninitialized memory in the underlying library, it works fine.
 
11:06 AM
hi
 
@bwoebi for example - func_get_arg
right?
 
which you shouldn't rely on when your function is called by internal mechanisms.
 
Because PHP is doing magic stuff....
 
hence the doing magic stuff is bad.
 
11:08 AM
Queen are doing it right.
 
function count ($a, $mode = 0) {
    if ($a instanceof Countable) {
        return $a->count($mode);
    }
    return array_count($a);
}
@Danack That's all what happens. Where's magic here?
 
@bwoebi no array_count() available
 
@bwoebi cf. F3: Flag Arguments in Clean Code (although I guess it's feasible in this case)
 
$imagick->count();
arrives at:
PHP_METHOD(imagick, count) { }
With a parameter set.
 
@AlmaDo Z_ARRVAL($a).nNumOfElements
@Gordon ????
@Danack no, it doesn't?
 
Imagick::count() just should have a signature class Imagick implements Countable { function count ($mode = 0); }
 
Imagick is an internal class.
 
Really, this shouldn't have been implemented in the first place.
But I already told you that...
 
I just don't get your point… @Danack
 
Ok, guys, I need a tip. I receive a json string in email body(yes, yes) that I need to parse and save to DB, the problem is it has unicode encoded symbols and if that encoded symbol happens to be characters 999-1000 the json encoded string gets split with newline and json is no longer parseable. So I think the best solution is to request to send the json string base64 encoded as well. Is there any better way to handle this?
 
11:16 AM
@bwoebi We're going round in a circle then. The patch to correctly call the function with the same arguments as it was called in userland with checks to see if zend_call_method_with_1_params or zend_call_method_with_0_params should be used....doesn't seem to be the same behaviour as always passing in 0.
 
the split with a newline after a certain character in emails is in the rfc
 
Oh - should have posted this earlier:
echo count ($imagick) . PHP_EOL;
gives:
 
Good morning.
 
 Warning: Imagick::count() expects exactly 0 parameters, 1 given in /dev/shm/BUILD/php-pecl-imagick-3.2.0/NTS/tests/021-countable.php on line 10
Because a parameter has been magically added by the engine.
 
Yes, because the method isn't yet adapted to 5.6
 
11:18 AM
No, because you're doing magic shit to the parameters.
Yes, Imagick should be changed to follow the interface correctly, but the engine shouldn't be magically passing in parameters where no parameter was set.
 
There's no magic .____.
 
count ( mixed $array_or_countable [, int $mode = COUNT_NORMAL ] )
 
@Danack the parameter was implicitly set by the second argument of count being by default 0 (aka COUNT_NORMAL).
 
No it's not. An optional parameter is optional, it doesn't mean that should be passed in as that value, which is what that patch fixes.
It's only in userland that the engine actually fills in the default value, right.
 
@Danack so, you want to be internally inconsistent with userland?
 
11:24 AM
@bwoebi You know as well as I do that PHP internal functions do not behave the same as userland function, and yes indeed when a parameter is optional is does not get set to the default value outside the function by PHP.
and so inside extension functions you have to do:
    long mode = 0; //Set default value
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
  		return;
  	}
If an optional parameter is not passed in it will not be written in &mode.
You know that - yes, it's different to userland code, but it's always been like that and setting an optional paramter to the default value is magic.
 
@Danack how's that different to function ($a = 0) ?
 
@bwoebi Now you're just being obtuse.
 
No, just being confused.
 
Ok, let me try one more time. Yes, in userland code PHP fills in the default values. But it's not meant to do that for functions in extensions. Instead there, the zend_parse_parameters does not write into the optional parameters. The change you made, makes it so that the optional parameter is being filled in by the engine, rather than it not being set by the engine. That's a magic behaviour that only seems to happen here.
 
// lunch
 
11:34 AM
It shouldn't be doing that, it should be consistent with the rest of the engine, and not setting a default value.
@Leri Why would it affect your coding standards?
 
Wish we'd hire a temp sys admin to sort all this stuff out -_-. @DaveRandom, I will give you £5 and several beers. :P
Okay okay.., I'll throw in a donut too.
 
Anyone uses Netbeans? I need to remove that awfull vertical line that I have ('cos it's starting to make be tick)
 
I fucking hate designers
 
how do I do that?
 
11:46 AM
@MoshMage Isn't that just the nth column marker?
 
Don't know, I'll search for it (and this is why I prefer webstorm: i can search options)
IF that's it, where is it? :|
 
Idunno. I never used netbeans
 
@PeeHaa Received some inconsistent designs? :P
 
3 mins ago, by PeeHaa
Eeeeeeek http://caniuse.com/#search=fil
They turned it into some ugly unclear thing
 
oh lol
You could always theme it yourself :P
 
11:51 AM
@PeeHaa yep Nth Column Marker indeed. Thanks :)
 
np
@Fabien I hate creating themes for other people's screw ups
 
One day there will be a consistent history to which a user can choose and use their favourite BC version of a website.
 
An actual code example @bwoebi - it's not required for classes implementing countable to have the same default value, so you should be able to do:
PHP_METHOD(imagick, count)
  {
 	long mode = SOME_CUSTOM_MODE;
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
  		return;
  	}

 // If no parameter was set mode should be SOME_CUSTOM_MODE
 // but instead it's going to be 0
 }
yeah, not great OO, but having the engine hard-coding params to zero is bad.
 
12:09 PM
@Danack I did see some Countable discussion .. what's it about?
 
@Jack Short version, Bweobi changed how PHP behaves. There is a patch in the bug discussion that I think should be applied.
 
Ah, this was done 5.6 onwards ya?
 
to revert the behaviour to not be setting parameters magically.
@Jack It wasn't in the early release candidates.
 
But I thought PHP == magic
 
sometime after that.
@Jack Good magic, not bad magic.
The whole of the conversation above can be summed by one comment:
48 mins ago, by Danack
@bwoebi You know as well as I do that PHP internal functions do not behave the same as userland function, and yes indeed when a parameter is optional is does not get set to the default value outside the function by PHP.
 
12:12 PM
Hmm, the count() mode had been around since 4.2 ... interesting
@Danack Yes, that patch looks better :)
 
@Jack I know. I don't want to rag on him too much but someone is being deliberately obtuse when they say they don't see the difference that the patch would make.
 
I suppose the question is really whether do ALL internal classes use count_elements_handler :)
oh, hang on .. when would anything use that handler ... guess i'm just babbling without looking at source code lol
 
@Jack yep - it's anything that implements count - github.com/mkoppanen/imagick/pull/35/files
remi fixed it for me ;) But I still think the magic setting a parameter should not be there.
 
yeah, so while it's okay for user land code, it's a surprise for internal code :)
 
Surprise parties good, surprise code bad.
 
12:26 PM
it's like inviting the hookers, obama and bush ... and forgetting the oxford comma :)
 
hahahah
 
@Danack well, the rest of the engine does that too. Most functions set a default value that way.
@Danack I see the difference in behaviour. I just don't see why it'd make sense.
 
Well they shouldn't, and the patch is there to stop the bad behaviour in this case. Is there any reason not to apply it, and so avoid the bad magicness in this case?
 
@bwoebi So you're saying Imagick had a lurking bug this whole time?
 
@Jack hmm?
 
12:32 PM
Well, the change caused an issue with Imagick, right?
 
with everything implementing Countable and having a count method.
 
@Jack this is the BC break:
echo count ($imagick) . PHP_EOL;
  Warning: Imagick::count() expects exactly 0 parameters, 1 given in /dev/shm/BUILD/php-pecl-imagick-3.2.0/NTS/tests/021-countable.php on line 10
It didn't give an error before.
 
Yeah, exactly.
 
@Danack I see it both ways. You have a "expected 0, got 1" issue, but "fixing" this would mean that you'd get that error when the user passes the value, which means that the thing would appear to not implement the interface correctly, which seems like a PoLA violation.
Unless I missed something
 
^^ That
Well, the Imagick patch fixes the issue properly.
 
12:35 PM
@DaveRandom Yep - I am applying the fix to Imagick, but also there's no requirement for classes implementing the countable interface to use the same parameter.
31 mins ago, by Danack
PHP_METHOD(imagick, count)
  {
 	long mode = SOME_CUSTOM_MODE;
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
  		return;
  	}

 // If no parameter was set mode should be SOME_CUSTOM_MODE
 // but instead it's going to be 0
 }
 
I'm just wondering whether it was a potential Imagick issue from the start, i.e. should they have used count_elements before and should they have accepted the optional parameter all this while.
 
Jesus an office full of macs produce a lot of heat.
 
@Danack Ahh right. Yes that doesn't make sense.
 
ah, that's your issue.
hmm.
That makes some sense…
 
@Danack I'd suggest writing a mail to internals about the issue :)
 
12:36 PM
@Jack "Yep - I am applying the fix to Imagick" but the behaviour hard codes the default value....which is not required by PHP.
 
Personally I'd suggest to revert it altogether.
 
@NikiC already did.
 
@Danack ah, cc'd to cvs
 
@NikiC I think it would be fine with the extra patch applied?
 
The patch now makes some sense to me.
 
12:37 PM
@Danack Yeah, the mode is totally not used ;-) which is fine in this case I suppose
cuz the recursive count would yield the same value heh
 
@Danack that little piece of code said more than the thousand words to me.
 
@Danack That looks more reasonable
Though I still maintain that we should revert it.
 
@NikiC any particular reason? Other than no-one seems to use the optional params?
 
second
 
@Danack Exactly that.
 
12:40 PM
Or at least hadn't for PHP4 to 5.6
 
No one uses them and now any "correct" implementation of Countable needs to handle it
 
So long as it isn't modifying the parameters passed to a function...
Also - someone in the room next to me is drilling holes with powerdrill in brick - will be back later.
 
* BAM KAPOW *
 
@Danack I'll apply that patch later, doing something different just now.
 
@bwoebi Why not just revert the earlier change?
unless you want to patch the count() method for SplHeap and buddies as well.
 
1:02 PM
 
@Ocramius You have a private registry for your docker images?
 
@Jack Haven't I patched them yet?!
 
well i just realised their count() methods aren't called .. because count_elements heh
so i guess it's just really about other extensions then ...
 
yep
 
which is kinda scary in its own right
because we don't know of all the private extensions there are
 
1:06 PM
@Ocramius can I brainstorm with you for a couple of minutes when you have time please.
 
@bwoebi oh wait, hang on .. technically i should be able to say $splHeap->count(COUNT_RECURSIVE) without an error, because ... documentation of Countable.
and from the 5.6 tree i still see zpp_none() being used.
 
@Danack Naming, mostly.
 
guys, can i (in regex) do something like input.*(!hidden).*readonly what I mean to do is search for every input which has readonly but does not have hidden
 
@Leri That's just using someone else library, rather than an inherent terrible ness of MySQLi. And you should be able to wrap any calls to it, so it isn't visible to the rest of your code.
 
1:13 PM
@Jack oh, wait. They have both? That's shit.
 
Don't you just love SPL?
 
@Fabien ?! is what I'm looking for, thanks :D
 
@Danack And why when PDO already does that?
 
@Jack love? There's not enough love in the whole multiverses to describe my love for SPL.
 
awww
spl and bwoebi, sitting in a tree ...
 
1:14 PM
@Leri I believe that PDO doesn't quite do everything that mysqli does....but don't know the exact details of the top of my head.
 
lol
 
btw, I just got back from interview. It was basically: you're cool. We'll send you little project description and send us complete project written from scratch.
 
@Danack so the acceptance of the extra param in Imagick::count() is actually required by contract ;-)
 
@Danack If I ever need those things, I'll use it. But until that I am happy with pdo. :-)
 
1:17 PM
@Danack PDO doesn't do async queries, mysqli does. // cc @Leri
 
@Jack Yes, which is why I'm applying the fix to the Imagick code - but still PHP shouldn't be setting an optional parameter to an assumed default value.
 
pgsql does too
I didn't think mysql did
 
@Danack The assumed default is count_normal .. not sure what you mean
 
1 hour ago, by Danack
PHP_METHOD(imagick, count)
  {
 	long mode = SOME_CUSTOM_MODE;
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
  		return;
  	}

 // If no parameter was set mode should be SOME_CUSTOM_MODE
 // but instead it's going to be 0
 }
 
Dec 10 '13 at 5:53, by rdlowrey
msyqli and pgsql both have async support.
:)
 
1:18 PM
@Danack Yeah, I didn't quite get the comment in that code
 
@Fabien PDO is not able to use one, anyways. :-)
 
i wonder, what name should i use for folder of presentation objects
ideas ?
 
@Danack Basically, the idea is to accept an optional parameter and then toss it in the garbage if there would be no diff in return value.
because .. lack of countable aggregate ;-)
 
@Jack Currently in PHP5.5 if you do $imagick->count() the mode value will not be set in zend_parse_parameters and so it will be SOME_CUSTOM_MODE. In the release candidate, the code will be passed 0 as the parameter.
and so it will be set in zend_parse_parameters
and so not be the expected default value.
 
*and now, for the main event THE question* I need to replace every `input readonly` that's not `type hidden` to a `span disabled` it's about 287 lines;
*I was thinking* this should be viable via regex; Though I need to change the tags and add a class to the already existing tabs -- how viable is this? (or should I just change them by hand?)
 
1:21 PM
But instead the one assumed to be the default by the PHP engine.
 
@Danack hmm okay, i don't know the history of that code
but, following the 5.5 countable interface, you shouldn't accept any parameters until 5.6
well okay, to be fair, it doesn't say it must not accept arguments.
but i guess that's what you get when you mess with spl
 
@tereško Presentation? Assume content is classes and that will be namespace.
 
@Jack the issue is that the engine is now assuming what the default value should be outside of the function and passing it in. But that's not how php internal functions work, where zend_parse_parameters allows functions to define there own default parameters.
Which don't have to be consistent with the declaration of the interface.
 
@Leri yeah , but "presentation seems really off
 
@Danack it's not assuming, it's part of the interface now .. i'm a bit thick tonight I reckon?
 
1:27 PM
@tereško Presenters or Presentators maybe. Also what's their responsibility?
 
@Leri responsibility would be "shared UI logic"
 
@Danack or did you mean "now" as in, after bob's patch?
 
for example: almost all views will need logic for drawing main menu with current element selected
 
@Jack nah - it's not part of the interface....It's allowed to do this
@Jack It's now assuming the value is 0, which is what the patch I keep linking to fixes. Before it just wasn't passing a param (which is also wrong, but in a different way).
 
@tereško In .net world they are called Partials. if that helps.
Partial views to be more precise.
 
1:30 PM
In fact - I think having default values on parameters defined in interfaces is probably bogus.
 
@Leri I am referring tho this concept: martinfowler.com/eaaDev/PresentationModel.html (and yes, Fowler has this annoying habbit of slapping "model" on every term)
 
@Danack the fact that such a thing is allowed doesn't mean you should, though :)
 
@tereško How'd the meetings go?
 
@Fabien better then I expected
 
Oh?
 
1:31 PM
The whole thing is rather twisted at this point, because count_element isn't even aware of the count mode ... but the interface should be =S
 
@Fabien boss was mostly pissed at the PM and not the two developers in the room
 
Nice.
Did you put some points across just to kick him while he was down too?
 
Jan 23 at 16:33, by DaveRandom
Just a quick reminder: SVN sucks fat hairy testicles
 
@Jack yeah, it's a wtf (though as I said, I am really not sure that defined the default values of parameters in an interface is sensible, but it's the only way of indicating a value is optional in PHP). But hard-coding values in the engine is an even bigger wtf.
 
@tereško PresentationObjects or PresentationModels looks sane to me for that.
 
1:32 PM
@DaveRandom SVN sucks all manner of testicles, not just the fat and hairy ones.
 
Depends, how you hate Models. ;)
 
@DaveRandom why is that bad? /cc @cspray
 
@Danack I guess they didn't want to break BC too bad on this one ... making the param required would break more
 
hi guys
I have a question about Twilio and it doesn't have answers
 
@Leri yeah, but it makes for shitty folder name
 
1:33 PM
@Jack I think everything would be fine after applying the patch - then the engine doesn't make assumptions about the optional parameter.
 
any Twilio evangelist here?
 
@Gordon I'm all for some testicle sucking... until it is my SCM software.
 
Good morning
@cspray you never worked with CSV, have you...?
 
@cspray you shouldnt be so picky ;)
 
@MaxiCapodacqua Dont ask to ask
 
1:34 PM
@ircmaxell No, I haven't. I've heard enough stories that I'm thankful that I haven't
And I will also admit that my exposure to SVN was in a system that didn't utilize it correctly so I'm fairly biased
 
hi guys
 
But learning about SCM through Git and then going to SVN... yea, SVN sucks
 
@Danack I'd rather have it rolled back altogether; if count_elements doesn't get passed the mode, it makes more sense not to pass any parameter.
 
@Jack It is a bit late in the day of RC's to be changing this.
 
what's count_elements?
 
1:36 PM
@bwoebi The handler.
 
@cspray if you had, you would realize that SVN isn't nearly as bad as you think... Don't get me wrong, it's painful. But CVS was MUCH worse...
 
@SecondRikudo I remember you said you were gona do some tutorial and you would put up the link.If you did please ping me the link.hanks
 
@Danack But applying that patch isn't a bit late as well? :)
 
Stupid question time - is it possible to compile SPL as a shared library in PHP5.6? (trying to check a separate SPL issue).
 
@Jack actually my goal was only to pass it to userland functions… feel free to add it if you think it's needed.
 
1:37 PM
@Danack I think so...
 
@Jack Yes, but it reverts the BC break for extensions of them suddenly receiving a parameter where none was set. It also stops the new bad magic-ness from being the behaviour of an actual release.
 
@bwoebi I guess it depends on whether we have any SPL stuff (or otherwise) that would be able to use it.
 
Wow it's not often you find services doing sensible things. My GP now does early early appointments. 7:00am! A consideration for the working man. Nice.
 
@Jack definitely. Especially if these SPL data structures contain arrays
 
hmm, guess it comes down to 'forward' or 'backward' heh
 
1:40 PM
@ircmaxell any idea what the config parameter would be or where to look for it? --enable-spl=shared and --with-spl=shared both give an unrecognized option warning.
 
@Danack well, build without spl, then build spl as an extension (using phpize)
 
@ircmaxell php.net/manual/en/spl.installation.php - "As of PHP 5.3.0 this extension can no longer be disabled and is therefore always available."
 
but changing count_elements will cause binary breakage in an RC .. not sure i want to have that on my conscience heh
 
actually, yeah, it can't be disabled: lxr.php.net/xref/PHP_TRUNK/ext/spl/config.m4
 
btw context - github.com/mkoppanen/imagick/pull/36 they appear to be compileing it as shared......I'll just ask them to clarify wtf they're doing.
 
1:42 PM
> Please, create a site that will have twitter functionality.
LOL wut
 
@Leri that's easy
 
ah, the voting booths are open again
 
it's a good "10h challenge", I guess
maybe even less
 
@Danack they are running 5.2?
 
okay, vote all for 6 again…
 
1:43 PM
@FlorianMargaine Yeah, unless you expect twitter's traffic. /me hopes, they don't. as long as it's just for interview
:D
 
@ircmaxell They claim php-5.5.14 - so somethings weird.
 
all for 6 and 6 for one .. ehh, whatever
 
xD
 
@Leri that's really the first thing you're thinking about? It just means write something where you can send new tweets and have people follow each other
 
@Danack yeah, close as CNR
 
1:46 PM
@FlorianMargaine Oh, cool few hours will be enough then. I mean without that extended caching and optimizations.
 
@Leri if it's an interview question, it's to see what you can do in a limited time, so you need enough features, and you have to keep it open but relatively closed too
 
@ircmaxell Weirdly, other people are seeing it as well it's not just one guy.
 
@FlorianMargaine you have to keep it open but relatively closed too not sure I understand.
 
> We risk nothing by calling it PHP 7. We risk confusion and negative perception if we insist on reusing 6 for a completely different project.
 
@Danack replied
 
1:50 PM
@Fabien meh ... :)
 
Wonder if we can see if anyones vote changed since the last one.
 
user895378
Good morning 11ers. Just stopping by to wish you all a happy, productive day. Keep learning, improving and being generally awesome in the face of crazy expectations and external WTFs :)
 
@Leri closed = limited set of features, so easily done by many people. open = many subtle features can be added
 
@rdlowrey have you been drinking? :)
 
That or his girlfriends didn't find out about each other.
 
user895378
1:52 PM
@Jack Nope, just got way more sleep than usual. So the birds are chirping and the sky is blue :)
 
it's pitch black here =/ and no birds
though, pitch black in singapore is relative, there's a lot of light pollution at night.
 
You're in Singapore?
The capital and/or the country? :P
 
haha, funny, yes ... both
 
@rdlowrey morning. Just mentioned some of your frameworks (Alert and Artax) in interview I had. They never heard of them. :/ I told them to have a look. dunno what they will. :D
 
Chewing gum still banned out there?
 
1:54 PM
pretty much, gay people too
 
user895378
wat
 
okay, they're not banned
 
user895378
@Leri Oh I don't care if they do. I don't publish my code for recognition. But thanks :)
 
@FlorianMargaine Oh, okay. Thanks for useful advice.
 
But if you're a gay man chewing gum, you're not going to have a good time in Singapore :P
 
1:55 PM
yeah, according to the rules, sexual gay relationships aren't allowed
 
@rdlowrey Meh, it's not you. It's me who wants that people here wrote good code.
 
though i've never seen it enforced, evah
@Fabien jails here can't be as bad as ... say, mexico
 
Singapore seems nice. I'd like to go one day.
 
user895378
@Leri Oh, that's a reasonable frustration.
 

« first day (1376 days earlier)      last day (3587 days later) »