« first day (1618 days earlier)      last day (3324 days later) » 

12:10 AM
Hello, i'm currently trying to count all the references from oen to another table. The first table is the table for the blog entrys and the 2nd one for the comments, which get a reference to the blog entry, when created.
Shouldn't this count all the references for each blog entry?
$query = $dbz->query("select id, title, text, creationDate, creationTime from entry order by creationTime DESC, creationTime DESC");
$entries = $query->fetchAll();

for($i = 0; $i <= count($entries); $i++)
{
    $comQuery = $dbz->prepare("SELECT COUNT(*) FROM comment WHERE comment.Blog_ID = :id");
    $comQuery->bindParam(':id', $entries->Eintrag[$i]);
    try
    {
        $comQuery->execute();
        $comAmmount[$i] = $comQuery->fetchColumn();
    }
    catch(PDOException $e)
    {
        echo 'Error!<br />' . $e;
@RonniSkansing
 
12:33 AM
yo
 
Meh… I've not thought about the case where the direct parent isn't changed but something much earlier in the chain changes the value… I need to put watches on that too :x
But I really think, that's all what's left apart from better output. I hope I can finish that by tomorrow…
 
12:57 AM
When is it okay to start putting RFCs for 7.1?
 
you'll likely not get much traction on them, but go for it
 
1:27 AM
@nikita2206 It depends if you want them to be discussed 'properly' or not.
 
Yeah, that's why I'm asking :P Will wait until first beta I think
 
whats your RFC? :3
 
@marcio I didn't write them yet... But I have almost ready implementation for callable types, and half-done (probably will rewrite from scratch) currying
Ah and exporting operators as functions, though I didn't think some details through, like strictness of arguments (operators are always weak but functions can vary, depends on the mode)
 
@nikita2206 oh nice, callable types in on my to do list of RFCs :) I'm currently trying to decided if callable types should allow argument list skipping on declaration, like:
callable myCallable:int; // then only the return type will be a requirement
 
@Leigh There's no point branching a release version until all the RFCs targeting 7 are merged. It would just be a lot more work for not much gain.
 
1:43 AM
@marcio Levi already expressed his feelings against it :) I would probably drop it, cause it actually doesn't make much sense... But at first I implemented them, it's here btw if you want to have a look github.com/nikita2206/php-src/tree/callable-signature-typehints
We can join our forces if you want
 
@nikita2206 Sure, I'm also in doubt between:
callable reducer(int ...$numbers) : int;
// vs
function reducer(int ...$numbers) : int;
 
@marcio do you want to use names for parameters? I think they aren't needed here... What about callable vs function, I know hhvm used function for some reason, but it feels more natural to use callable because it's already here, we are just extending it
 
@nikita2206 I think callable type and interfaces have a parallel so I'm favoring "callable" too
The idea about argument names is that they are often useful information + interface methods already require them (consistency)
 
@marcio and if the names don't match you are going to throw an error?
 
@nikita2206 no, it's just like on interfaces, the names a purely informational and you can change them on implementation.
 
1:50 AM
It's pretty often in FP that you write a generic function and pass it to other functions, and if there will be requirement for names to match, it's gonna lower reusability of such functions
hm... okay
Still, I think they also add some clutter, honestly
 
@nikita2206 it's not, the arg name gives useful information about what the arg means (it might be unnecessary sometimes ofc)
 
@marcio I meant, it's additional symbols to type :P
and read
 
BTW, another decision to take is that if we should allow generic callable typehints like:

function fn( (int ...$n):int $callback) { ... } // I'm against o/
 
Hm I didn't get you here, what do you mean exactly? They only difference I see is you dropped callable keyword?
 
@nikita2206 it's like a shorthand for:
callable someCallable (int ...$n):int;

function fn(someCallable $callback) { ... }
I don't like this because it would be strange to have generic type hints for callable types and not for the other things. If somebody wants generics, then it should be done for all the things on another RFC.
 
1:59 AM
@marcio ah, I actually think this is the first thing that needs to be introduced and then named signatures :P
With named types it would be as generic
 
well, not a fan but I won't complain if it gets added as it's a detail and having the feature is much more important :)
 
But this can be kinda mess, yeah... Just need to get used to it
 
@marcio So you're against the named parameters RFC?
 
@Danack will this thing fly? If we make the "parameters names match" a requirement on implementations it will be a big BC (not that I care a lot).
@nikita2206 wow
 
I doubt it will (or should) pass for that reason. Though I could be wrong. TBH I am very confused by how some people think named params are 'good', when they were also so against Stas' 'default' param RFC.
 
2:08 AM
function(callable(callable(callable(callable(A)))) $cb) {
^ @nikita2206 please don't :D
 
And yes, functions are defined by their parameter order and type (subject to something similar to LSP) - and named params break that massively.
 
@Danack maybe we should just have two kinds of functions? The ones with pos. arguments and the ones with named arguments?
 
@Danack it's possible they think of named params being the right way to solve the same problem
 
@marcio I mean, it needs to be supported. Not like I'm fond of functions expecting functions expecting functions expecting functions expecting functions...
 
@nikita2206 which is possible now, using a parameterObject to hold the values.
 
2:11 AM
@Danack i was just kidding :P
 
@PaulCrovella Yes, that's the bit that confuses me.
 
I think we are better served with:

list($a, $b, $c) = get_named_args('arg_a', 'arg_b', 'arg_c');
// flees
 
@nikita2206 Other people aren't., unless they're trolling.
 
seriously, I don't really care about the BC... but if we can solve it in a simpler way and avoid all the drama, why not?
 
It's not just BC, it's forward compatibility as well. How could you be sure if it's safe to change the name of a parameter, unless you check all place where it could be called with named params?
 
2:19 AM
@Danack that's why I raised this func_get_named_args thing, so you can keep the external parameters name away from the local variable names.
oh right, yea, I don't know if anything related to named parameters is a good idea. That seems harder to pass than STH :)
@nikita2206 nevermind, keep going with this. It's not like everybody is waiting to write code like this and make life harder :) I still think it's strange to have generics for callable and not for the other things but it's a detail and consistency has never been a thing on PHP.
 
@marcio Actually the way I changed arg_info I tried to do it as close to generics as possible (well luckily it basically is generics, just not for classes), so at some point it will be fairly easy to implement generics too. I actually want them for quite some time...
thanks for heads up :)
 
:)
 
 
2 hours later…
4:00 AM
Question, I tried to send a string from PHP over to Java, and it worked just fine
But on both sides (Java and PHP) there were some weird bits of text and gibberish at the end of it.
I'm assuming they have a different network data transfer protocol?
 
 
4 hours later…
8:28 AM
@bwoebi I reverted your commits, because they broke lots of tests
I agree that severity handling is a bit fishy, because zend_parse_arg right now just ignores it (and always throws a warning)
 
on a related note, @bwoebi if you aren't running the tests locally (or using travis on a pull request first), then please at least wait for the build results after you push, so you can spot any problems and fix/revert before others have to
 
 
1 hour later…
9:56 AM
TIL being a junior developer is a mindset, not a skill level.
 
10:09 AM
good mornigs
 
morn
@Danack what mindset is that?
 
The "What could possibly go wrong?" one.
 
I prefer "oh man, so much could go wrong... let's see what does first!"
 
So long as that is done at 5:15pm on a Friday, I approve.
 
usually just before I head off for vacation
 
10:18 AM
"Good luck guys!"
 
> Anything that can go wrong, will go wrong.
 
mORNING
 
10:52 AM
@NikiC well… I just wanted to discuss it with you before doing anything (fix tests or revert)
But you weren't replying last night… so, I just waited.
 
11:29 AM
@bwoebi If tests fail, reverting it is usually the way to go (unless you have an immediate fix)
 
@NikiC Anyway… I still don't know why fast_zpp and normal handle it differently and not sure what's better. I tend towards always exception…
 
Just sent to me, not really sure if I like it: gist.github.com/anonymous/c438a64b7147e122e34b
Having a real way to hint a callables signature would be nicer I guess.
 
12:02 PM
Morning
 
Morning @Duikboot
 
Yo : )
@Danack Yesterday you asked me who the code gave me, but it was just a dummy. paste.jesse-obrien.ca/1RjR
 
12:28 PM
Hey @PeeHaa, thanks for pointing me to Scrutinizer.. it gave me a few pointers which I fixed up ... and added badges =]
 
badges \o/
 
12:57 PM
@bwoebi zpp should stay as it was pre 7
if you want exceptions, enable strict mode
 
@NikiC lxr.php.net/xref/PHP_TRUNK/Zend/zend_API.c#722 … so this is wrong then?
 
@bwoebi yes
that and the code that actually throws the errors (it ignores severity)
 
paste.jesse-obrien.ca/1Rk2 Is this so weird? What I am writing?
Catchable fatal error: Argument 1 passed to Watermark::__construct() must be an instance of before .. Am I not doing that then?
 
@NikiC Okay, then I'll fix that…
 
@Duikboot ? you have a contructor, which takes a instance of Before .. but when you do "new Watermark();" you passed no arguments to the ctor at all??
 
1:25 PM
Sometimes when I'm writing Javascript I want to throw up my hands and say "this is bullshit!" but I can never remember what "this" refers to
2
Anybody worked with tinymce before? I have implemented it on a test site, but for some reason I cannot select text or click at random places in the text to move the caret
^ not sure whether I fucked up, the template is fucked up or tiny is fucked up
Also possible: all of the aboce
 
@bwoebi great, thanks
 
1:41 PM
@RonniSkansing So I should always do like new Watermark($before); ?
 
@PeeHaa I think it is because all the resources are not ready
When I prefetched all the stuff it does when you click edit, it worked with setting the caret
 
Prefetch how?
 
@PeeHaa like edit the file in the browser save, recompile reclick
 
So you can click somewhere in the middle of the text?
 
Yes, I could. I opened dev tools, clicked activate, clicked edit, clicked on your console.log(..) on the console tab, removed the console.log lines saved, and redid it all again
and it worked
let me see if I can do it again
 
1:45 PM
Also what browser are you on?
 
Chrome 40 64bit
 
moin
 
@marcio mogguh
 
actually I can not reproduce it again... =[
 
:(
 
1:47 PM
/me doesn't trust inbox.google, too colorful
 
Let me at least fix the bug where the editor cannot get focus the first time when clicking. Probably a timing issue
 
hi
 
hey @Lukas
 
any experience with integrating facebook logins?
 
@Lukas somewhat
 
1:49 PM
I'm working on the login flow for an app and I'm at the stage when I have the access token
I need to store the facebook access token in the database so I can make graph api calls (from the server)
I'm thinking about how to make this secure (one thing I came across is the appsecret_proof)
 
Secure how? Against what?
 
However, there isn't an option in the app settings (on facebook) to turn that on
If say, the database was to be compromised, I don't want the stored facebook access tokens to be usable by the attacker
the appsecret_proof seems like exactly what I need
 
I don't know what appsecret_proof is or does, but can't you just encrypt the token?
 
encrypt with my own 'secret', then store to db?
 
yes
Also note that if people can access your database you probably have bugger issues
 
1:55 PM
haha, just precautions
 
hello
 
Goddamnit @RonniSkansing. It looks like that IE is the only browser it works correctly in :|
 
@PeeHaa as I'm thinking about it, seems that this will work just fine.
 
morning
@PeeHaa What's your issue?
 
Ok, I'll try that, thanks @PeeHaa
 
1:57 PM
i have sql statement like this
select * from emp where name =????
the question marks value will replaced with value comes from drop down
i add a new selection in drop down called ALL , i want that when user select ALL
the condition of name removed , i can do it using if , else but i need another way using sql query
 
30 mins ago, by PeeHaa
Anybody worked with tinymce before? I have implemented it on a test site, but for some reason I cannot select text or click at random places in the text to move the caret
It looks like FF doesn't work at all (as in the editor window never gets the focus). In chrome I cannot click anywhere in the text to move the caret / select text. In IE everything works like it should :P
All hail intarnet exploder o/
 
Right, I finally found that edit button. Seems pretty weird.
 
Ow wait. Actually IE also doesn't let me select text
 
When I edit the first box, I can't edit it and other boxes are links that hide the editor.
 
@kelunik Browser?
 
2:01 PM
@PeeHaa Chromium
 
@kelunik When the editor is active can you double click on text to select a word?
 
@PeeHaa Nope, no cursor, no selection.
 
ugggh
 
@PeeHaa works "fine" in FF after right clicking one of the boxes and clicking add/edit link and dismissing the modal. Text is editable and selectable using "shift + arrows" and the other common keyboard shortcuts, not usable with a mouse, though.
 
@PeeHaa =]
Try activate, click in a box, click edit
 
2:04 PM
Hey guys! I was just wondering if someone could explain to me how GMail or Hotmail works? I understand how I can setup a mailing server for myself but is it the same principle if you want to setup a service like GMail?
 
then in top deactivate
click in the box again
caret is now selecatable
got teamviewer, I will show you =]
 
@RonniSkansing Let me start tv
id?
 
actually, I do not have teamviewer, moment downloading =]
 
:P
 
but after you click edit,
just reclick the activate/deactivate in top
 
2:07 PM
@RonniSkansing Have you maybe a second to help me out setting up my class the right way so I can learn it also the right way?
 
@RonniSkansing Doesn't work for me?
 
Yes @Duikboot. Do you understand how the typehint you are using the ctor works?
@PeeHaa works every tiem for me..
sorry slow connection
 
Show me, because I think I don't understand :P
 
I got teamviewer in 4 min
 
lol
 
2:09 PM
I will =]
And I think it will lead you straight to the bug
 
That would be tits
 
@RonniSkansing Not yet I was testing that out.
 
@Duikboot okay, the (Before $dependency) means that the $dependency must be a instance of the Class Before
 
Which means that it should be like $wm = new Watermark( ... in here ... ); ?
 
yes, which would mean your watermark class would depend on another class called Before
and a instance of that must be passed to the constructor via. the new call
$before = new Before;
$watermark = new Watermark($before);
 
2:12 PM
Just in this exapmle would you do it that way too?
 
no, I do not understand what the Before is
 
Oh well I have received some base class to test this where I receive a 'image before' and a 'watermark'.
NowI would like to generate the watermark on the image.
 
So the before is the Image before ?
 
Yes 1sec. I'll give you the start I had.
 
@PeeHaa at my place or your place?
 
2:14 PM
Yours
 
@RonniSkansing this is my initial start paste.jesse-obrien.ca/1RkM
 
@Duikboot A class name of Watermark indicates that this class represents a watermark entity or value object. But before and after don't seem like they would belong in there. What does the class do? Might want to name it more accurately :)
 
^ @Duikboot that is a good point
 
Well soon it will receive automatically a logo. let's say an apple.png or something and then there will be an image gallery with laptops and every image which is going trough the class should generate a new one with that apple.png logo on it on a specific X Y position
 
@Duikboot I am not sure I get it, is what you just said now attached to your issue with the before stuff?
 
2:24 PM
Yes the 'before is the old image '
wait ill sketch it
 
Is it the old image or the path to the old image?
 
OMFG you sir just won the internet for a day! @RonniSkansing
 
Is see there is another bug now, but that can be solved easily I think
 
Ok I sketched it.
Ther you go :) i.imgur.com/lMivuIb.png
 
2:29 PM
PeeHaa "can be solved easily I think " famous last words =]
 
@Duikboot a watermark is just adding an image to another image. So either you have an addWatermark method on your Image class or you have a Watermarker class with a method that takes two images and adds a watermark. Or you could create an ImageCollection and the method takes an imagecollection and an image (the watermark).
 
What's the best approach? :)
 
I like the Watermarker class with a method that takes two images and .... or the last suggestion also
 
@Duikboot also you don't need to pass the path around, you can work directly with the image data so you don't have to access the filesystem in all your imageclasses. see php.net/manual/en/function.imagecreatefromstring.php
 
Now to fix the minor bugs I just found...
 
2:36 PM
So a setup like this? paste.jesse-obrien.ca/1RkT
 
@PeeHaa yay works here
 
@PeeHaa doesnt work here
 
@Patrick Wait wut?
 
firefox
let me try in chromium
 
And let me try it ff
 
2:37 PM
@Duikboot it's probably best to avoid public variables altogether
 
Works for me in FF (I think)
 
works for me in FF 35
but I had to make sure all resources was loaded (slow connection) before clicking away
 
So I can make them best all private
 
@Duikboot paste.jesse-obrien.ca/1RkU (don't use the return type hint, that's just so you know what will be returned)
 
yo
 
2:39 PM
Morning @ircmaxell
 
@Duikboot you shouldn't need any of them anyways
chromium works
Doesn't work on FF 35
Blocked loading mixed active content "http://fonts.googleapis.com/css?family=Open+Sans:400,700,600,800"[Learn More] webeditor.pieterhordijk.com
Blocked loading mixed active content "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"[Learn More] webeditor.pieterhordijk.com
Blocked loading mixed active content "http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js"[Learn More]
chromium blocks them too I think and yet it works, dunno
 
@Patrick Hard refresh the thing
hmmm I'm still on ff 33. Let me also update
 
@PeeHaa works sometimes now. I can edit one field, but not a second one (unless I refresh again)
 
what's the good word
 
@Patrick How would the getimages method interact with my addwatermark method? - currently here: paste.jesse-obrien.ca/1Rl5
 
2:46 PM
hmmm, what film to load this time
 
@Duikboot why would a watermarker class need a getimages method?
 
@Patrick I think I can repro now
 
Would you grab it just when calling the class and the method?
 
Hi People :)
I'm new here, glad to be here.
 
Hey people
 
2:54 PM
Welcome @MihaiEnescu
 
@MihaiEnescu you might find room-11.github.io worth a fast read
 
does anyone know any guides for analysis of the stack trance of requests and optimizing their code
actually I need to know how I can attribute function execution time and execution count to bad performance to be able to fix it later
 
@ziGi I did not understand that.. =] Was it like.. I want to find out why X is slow and make it faster?
 
I am using xdebug and PHP Storm
and I get a stack trace more or less
with three factors
for each function
Total time, Own Time, Call Count
 
3:01 PM
have a look into profiling
you need to understand the specific bottleneck to optimize anything
 
exactly
but there are many bottlenecks
or at least I think so
 
what good does it to reduce the amount of calls if it just mysql blocking because of bad queries?
or etc
Look into profilling, sensio labs made a profily thingy some time ago, maybe you could give that a try blackfire.io
 
Hmm I setup these bird food balls in nearby trees.. so I could watch some cute squiky birds while they eat... they ignored them for 2 weeks now... /me feels sad
maybe there are too many cats in the neighborhood
 
@Patrick Suggestions how I write the generated images into a directory?
Now they are 'generated' but they doen't exist yet as an image.
 
3:16 PM
@Duikboot nope... header('Content-type: image/png');
 
I got that one : )
 
Wow I have been debugging a cached page for the last 30 minutes. Thanks firefox
4
 
hihi =]
 
3:39 PM
Vote @ircmaxell for PHP 7.0 Release Manager!
 
aha! tiny add ids to edited elements! Meaning I end up with multiple dupe ids in the dom
 
hi
 
hi
 
hi
 
3:53 PM
Eih @ircmaxell You're sure zval things got more complicated with PHP 7… or rather simpler?
 
@bwoebi complicated. Because of all of the new types and type relationships
@LeviMorrison I don't want it, so no thanks
 
@ircmaxell there are new types, but they're much more decoupled and refcounting is unified etc.
 
@Patrick Could you test it again in firefox pr0n mode? The only thing I think doesn't work right now in FF is that it doesn't give the editor the focus automagically, but you need to click it first. But editing works now (at least for me)
 
@bwoebi it was unified (ctor and dtor). The difference is now you have multiple levels (thanks to having zvals that point to zvals
 
3:56 PM
@ircmaxell yo dawg :)
 
well, it makes sense why it's done, It's a good thing
just more you need to keep track of when developing
hence more complicated ;-)
I am off for the day, later
 
@ircmaxell latert
 
@ircmaxell But integers, floats, and booleans all got easier.
 
@PeeHaa i can edit a field, but not save it or edit another one/exit the edit mode
 
@Patrick WTF
What happens when you click save?
 
4:09 PM
@Duikboot this is still procedural code... Why do you keep ignoring my suggestions? :(
@PeeHaa can't click it, it's disabled
 
@Patrick Huh? Are you clicking the webeditor save button or the global save button?
Do you even see the webeditor button panel?
 
I never noticed the bar on top... The one in the content didn't work
 
@Patrick :) You first have to save the block only after that you can save the entire page
 
@PeeHaa got it. very confusing though ;)
 
@nikita2206 You were the one with a proof-of-concept for callable type signatures, right?
 
4:12 PM
Yeah. I hope it is going to be less confusing when I have integrated it into a real project
 
@LeviMorrison yup
 
@PeeHaa also, would be nice if you can highlight the field that is currently being edited
 
@PeeHaa did you fix the clam sig thing?
 
@Patrick The thing is in all browser except FF it does just that by default. But fore some reason FF gets confused
 
function f(callable $g) {
    return function(...$args) use ($g): callable {
        return $g(...$args)
    };
}
 
4:14 PM
@Leigh I thought I did. But when I added more signatures last friday it suddenly stopped working again and weak as I am I gave up for the week
 
aw :(
well, sucks it wasn't as simple as I hoped then
 
I keep trying to come up with examples where I know the types of things and keep getting stuff like the above.
Ah, here's one: Oh wait, doesn't work either.
 
Not 100% sure yet, but I don't think it is. I do have a isolated test case now on that machine which I can reproduce on my own personal machine though. So I am failry certain I have either fixed it tomorrow or I will bug the maintainers with it
 
But essentially, without generics I can't find that many uses for typed callables :)
 
@LeviMorrison for example one of the possible methods of event dispatcher: function attach(string $event, callable(Event) $cb);
 
4:20 PM
Sure, there are uses. I just keep thinking about highly generic ones >.<
 
ahoy hoy
 
ohai @PaulCrovella
 
@LeviMorrison yeah, I want to get them in PHP at some point. But I'm not sure they will be accepted by a majority :/ Also they will for sure harm performance at least for cases when you use them vs. when you don't (but could also do it for normal objects/functions as well)
 
@nikita2206 I think we may want to wait for more type-system stuff to go in first.
Union types, maybe an "any" or "mixed" type.
For instance, if I know I take one parameter but don't know its type you can't really hint against it with what you proposed (I think).
Also, @nikita2206, are you checking against an object's __invoke method for correctness?
(It may be abstracted before it hits your checking code; I am unsure)
 
@LeviMorrison hm yeah, that's a problem... Probably need to use mixed in this case
@LeviMorrison let me check
 
4:29 PM
I'm going to check to make sure return types works with those really quick :)
 
@LeviMorrison do you know if zend_is_callable_ex checks for __invoke? I think it does it here, but I'm not sure
 
I think it does.
 
BTW there are some pretty dirty parts in the code... I just rushed it to make it work first :)
 
posted on March 22, 2015 by nikic

### Changed * To ensure compatibility with PHP 7, the following node classes have been renamed: OLD => NEW PhpParser\Node\Expr\Cast\Bool => PhpParser\Node\Expr\Cast\Bool_ PhpParser\Node\Ex...

 
4:56 PM
Morning
 
Yes, classes with __invoke work properly for return types. Phew. I never explicitly checked it.
 
@LeviMorrison you just compiled it?
 
Yeah, checked out latest master.
 
Ah master, ok. I will need to check variance on return types, I think I messed up there
 

« first day (1618 days earlier)      last day (3324 days later) »